You know I was working with the Human Task Manager API, so it was interesting for me to know where the EJB is deployed. There is the information:

On IBM ProcessServer:

ejb/BusinessFlowManagerHome ist part of BPE_Container Application. Concrete it’s a part of the EJB module bpecontainer.jar inside this application. ejb/HumanTaskManagerHome is part of TaskContainer Application, located inside EJB module taskejb.jar.


I currently working with IBM ProcessServer and I created a BPEL process doing some stuff.

I wanted to use the Human Task API inside a snippet. I got this error message:

javax.naming.NameNotFoundException: Name comp/env/ejb not found in context “java:”

How to make it work:

Add a reference to the HumanTaskManager EJB at your EJB project, in my case this was TestProcessEJB . There is a ejb-jar.xml under ejbModule/META-INF/. Don’t forget to add the JNDI name to the EJB reference at the references tab. If this JNDI name is not set you will receive such an error message:

Stack-Trace: com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object.  Root exception is javax.naming.NameNotFoundException: Context: ctrNode01Cell/nodes/wps/servers/server1, name: ejb/HumanTaskManagerHome: First component in name HumanTaskManagerHome not found.  Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0

java.lang.ClassCastException: Unable to load class: com.ibm.task.api._HumanTaskManagerHome_Stub

Now have have to package task137650.jar  with your enterprise application. In my case I had to place this file to TEST_ProcessWeb\WebContent\WEB-INF\lib\task137650.jar. In my case I found it here: IBM\Rational\SDP\6.0\runtimes\bi_v6\ProcessChoreographer\client

If you work with the BusinessFlowManager Bean inside your snippet you have to add bpe137650.jar.

Now this code would work inside a Java Snippet:

TKIID tkiid = null;
try
{
System.out.println(”Prozess Starter ” + processInstance().getStarter());
// Obtain the default initial JNDI context

Context initialContext = new InitialContext();
Object resultHTMHome = initialContext.lookup(”java:comp/env/ejb/HumanTaskManagerHome”);

// Get the home interface
HumanTaskManagerHome taskHome =
(HumanTaskManagerHome) javax.rmi.PortableRemoteObject.narrow(resultHTMHome, HumanTaskManagerHome.class);

// Create the EJB
HumanTaskManager taskManager = taskHome.create();

QueryResultSet result = taskManager.query(”DISTINCT TASK.TKIID”,
“TASK.NAME = ‘ATestTask’”,
(String)null, (Integer)null, (TimeZone)null);
if (result.size() > 0)
{
result.first();
tkiid = (TKIID) result.getOID(1);
System.out.println(”TKIID+ ” + tkiid.toString() );
Task startCreateECOTask = taskManager.getTask(tkiid);
String ownerOfStartCreateECOTask = startCreateECOTask.getOwner();startCreateECOTask.
System.out.println(”ownerOfStartCreateECOTask ” + ownerOfStartCreateECOTask);
}
}
catch (Exception e)
{
e.printStackTrace(System.out);
}

There are some static methods which can be used within a process snippet to perform some context relevant functions, for e.g. processInstance() returns a ProcessInstanceData object of the  current process. processInstance().getStarter() returns process starter user id. There are some other methods, further information see here.

I currently work with the IBM Process Server. I created a process using BPEL and wanted to test it. I got the stack trace below. The application can’t start because the Session EJB isn’t available. I enabled the function (projects menu) that automatically performs a rebuild, due to this I recognized (used unkown variables inside a java snippet) some errors. After I fixed these errors I could restart the application without an error, the the Session EJB for the process could be created.

“Clean often” if you work with Websphere Integration Developer is what I suggest. This is also mentioned here at this ‘Get started’ article from Websphere technical developer journal.

If you also work with IBM ProcessServer you may find these tutorials helpful: http://www.webagesolutions.com/knowledgebase/waskb/index.html

I’m glad to see some comments with helpful ‘BPEL with Websphere products’ Tutorials.

SystemErr R com.ibm.websphere.management.exception.AdminException: CWWBF0060E: Die Session-EJB component.Create_Something_1 für den Prozess konnte nicht gefunden werden.
at com.ibm.bpe.processarchive.ProcessServerTask.throwAdminException(ProcessServerTask.java:851)
at com.ibm.bpe.processarchive.SCDLProcessComponentConfigureTask.getBPELContext(SCDLProcessComponentConfigureTask.java:246)
at com.ibm.bpe.processarchive.SCDLProcessComponentConfigureTask.populateBpcDeploymentExtension(SCDLProcessComponentConfigureTask.java:675)
at com.ibm.bpe.processarchive.SCDLProcessComponentConfigureTask.performTask(SCDLProcessComponentConfigureTask.java:153)
at com.ibm.ws.management.application.SchedulerImpl.run(SchedulerImpl.java:253)
at java.lang.Thread.run(Thread.java:570)

[11.06.08 11:11:54:421 CEST] 0000007b SystemErr R at com.ibm.bpe.processarchive.ProcessServerTask.throwAdminException(ProcessServerTask.java:851)
[11.06.08 11:11:54:421 CEST] 0000007b SystemErr R at com.ibm.bpe.processarchive.SCDLProcessComponentConfigureTask.getBPELContext(SCDLProcessComponentConfigureTask.java:246)
[11.06.08 11:11:54:421 CEST] 0000007b SystemErr R at com.ibm.bpe.processarchive.SCDLProcessComponentConfigureTask.populateBpcDeploymentExtension(SCDLProcessComponentConfigureTask.java:675)
[11.06.08 11:11:54:421 CEST] 0000007b SystemErr R at com.ibm.bpe.processarchive.SCDLProcessComponentConfigureTask.performTask(SCDLProcessComponentConfigureTask.java:153)
[11.06.08 11:11:54:421 CEST] 0000007b SystemErr R at com.ibm.ws.management.application.SchedulerImpl.run(SchedulerImpl.java:253)
[11.06.08 11:11:54:421 CEST] 0000007b SystemErr R at java.lang.Thread.run(Thread.java:570)

Update: Regarding the above error you may also find this useful: http://www-01.ibm.com/support/docview.wss?uid=swg21318484 ( Session EJB bean not found during application deployment ).

What helped me really in an other case having the above error: I created a new workspace and imported the existing projects. So I could get rid of the error. The ejb-xml was created now with EJB references.