This content has been marked as final.
Show 5 replies
-
1. Re: Error getting CommandServiceBean
kukeltje Sep 12, 2008 2:39 PM (in response to ajanz)My first response would be:
Your error is that you post to way to little relevant info...
:-) -
2. Re: Error getting CommandServiceBean
ajanz Sep 15, 2008 5:55 AM (in response to ajanz)ok what information do you need?
i generated the initial context withHashtable p = new Hashtable(); p.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); p.put(InitialContext.PROVIDER_URL, "jnp://localhost:1099"); p.put(InitialContext.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); jndiContext = new InitialContext(p);
i am using an jboss 4.2.2 GA with the jbpm-enterprise.ear deployed -
3. Re: Error getting CommandServiceBean
ajanz Sep 16, 2008 6:21 PM (in response to ajanz)sorry but still not getting it work
iterate through the jndi gives me
Name : java:ejb/CommandServiceBean
Classe java:ejb/CommandServiceBeanHome
and
LocalCommandServiceHome localCommandServiceHome = (LocalCommandServiceHome) initialContext.lookup("java:ejb/CommandServiceBean");
gives me a class cast exception.
what am i doing wrong? -
4. Re: Error getting CommandServiceBean
salaboy21 Sep 16, 2008 6:35 PM (in response to ajanz)Look.. here i made it thru injection.. but it's the same:
@EJB(mappedName="ejb/CommandServiceBean") RemoteCommandServiceHome cmdService;
and then in one method:try { cmdService.create().execute(cmd); } catch (CreateException e) { e.printStackTrace(); } catch (RemoteException e) { e.printStackTrace(); }
You must use RemoteCommandServiceHome because it's EJB 2.1 compatible and then use the method create(), to call the real methods!
I Hope it helps! -
5. Re: Error getting CommandServiceBean
ajanz Sep 17, 2008 4:00 AM (in response to ajanz)ok i changed it to
RemoteCommandServiceHome remoteCommandServiceHome = (RemoteCommandServiceHome) initialContext .lookup("ejb/CommandServiceBean"); remoteCMDService = remoteCommandServiceHome.create();
but now i got
Invalid invocation, check your deployment packaging, method=public abstract org.jbpm.ejb.RemoteCommandService org.jbpm.ejb.RemoteCommandServiceHome.create() throws javax.ejb.CreateException,java.rmi.RemoteException
i deployed the jbpm-enterprise.ear on a jboss 4.2.2.