[EJB 3.0 Development] - Unexpected behavious when binding to java:comp and @Startup beans
by Marius Bogoevici
Marius Bogoevici [http://community.jboss.org/people/marius.bogoevici] created the discussion
"Unexpected behavious when binding to java:comp and @Startup beans"
To view the discussion, visit: http://community.jboss.org/message/548547#548547
--------------------------------------------------------------
So, for Weld-int we bind a BeanManager to java:comp/BeanManager. In order to make it accessible to EJBs, the binding procedure works like this:
1) Obtain the JavaEEComponent which corresponds to the EJBs DU
2) From the JavaEEComponent, obtain the Context (which represents java:comp for said component)
3) Bind the BeanManager
As a bit of background, one of the interceptors that are applied to CDI-enabled EJBs is injected with a @Resource("java:comp/BeanManager")
This works fine, as long as the EJB is not a @Startup bean. For the latter, the lookup that is performed during EJBContainer.startup() seems to miss the JavaEEComponent (debugging ComponentObjectFactory shows that CurrentComponent.get() returns null and thus JavaEEComponent is ignored - so that the BeanManager that is bound to JavaEEComponent's context is not found).
So, I'm looking forward to some clarifications concerning this - mainly to discuss what's the best way to move forward:
a) open a JIRA, fix the issue, or
b) use the SwitchBoard
Thanks,
Marius
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/548547#548547]
Start a new discussion in EJB 3.0 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 10 months
[jBPM] - Invoking web service from an ExternalActivityBehaviour
by Stephane Malbequi
Stephane Malbequi [http://community.jboss.org/people/smalbequi] created the discussion
"Invoking web service from an ExternalActivityBehaviour"
To view the discussion, visit: http://community.jboss.org/message/548545#548545
--------------------------------------------------------------
Hi,
I have a class loading problem when I try to consume a web service from an ExternalActivityBehaviour.
I will try to explain :
1 I have generated a web service client with the jaxws maven plugin
2 I have tested it with a JUnit test : it's ok
3 I have created a process and have used the same code as the unit test in an ExternalActivityBehaviour in order to consume the web service
4 I have packaged the process in a *bar file* and deployed it with an ant build file. The bar file contains the jpdl files, the ExternalActivityBehaviour class and all jaxws generated classes.
5 When the process starts and enter in the custom node, I obtain "*Cannot load service endpoint interface*" because "*ClassNotFoundException*" (the generated client interface in fact)
If I have understood, the classloader (the same used by the SOAP stack) can't find the classes of my bar file.
I read some posts that say : with jbpm3 we have to add java source files in the process archive. So I have tested and packaged a new bar file with the .java files near .class files, but same result.
So my question is : *How to consume a web service from an ExternalActivityBehaviour with the generated client classes all packaged in a bar file*.
I have no war file, just a bar file to deploy. I hope I haven't to put all generated classes in a jar and in a jboss lib directory.
Thanks in advance.
Stéphane.
jBPM 4.3, JBoss 4.2.1.GA
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/548545#548545]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 10 months
Re: [jboss-user] [Beginner's Corner] - JMS MDB (Message Driven Bean)
by Tuan Nguyen
Tuan Nguyen [http://community.jboss.org/people/tnguyen_75] replied to the discussion
"JMS MDB (Message Driven Bean)"
To view the discussion, visit: http://community.jboss.org/message/548536#548536
--------------------------------------------------------------
Thanks for the link. It's very helpful.
However, I ran into a problem when I deploy the MDB ear file to Jboss. I got the following message:
Failed to create Resource SimpleMessageApp.ear - cause: java.lang.RuntimeException:org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS): *** DEPLOYMENTS IN ERROR: Name -> Error vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/SimpleMessageApp.ear/ -> org.jboss.deployers.spi.DeploymentException: Could not deploy vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/SimpleMessageApp.ear/app-client-ic.jar/ DEPLOYMENTS IN ERROR: Deployment "vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/SimpleMessageApp.ear/" is in error due to the following reason(s): java.lang.RuntimeException: message-destination has no jndi-name/resolved-jndi-name MessageDestinationReferenceMetaData{name=jms/QueueName,type=javax.jms.Queue,link=ejb-jar-ic.jar#PhysicalQueue,ignore-dependecy=false,jndi-name=null,resolvoed-jndi-
Do you have any idea? (i'm not using EJB 3, just regular EJB)
Here's the code of my SimpleMessageBean:
public class SimpleMessageBean implements MessageDrivenBean, MessageListener {
static final Logger logger = Logger.getLogger("SimpleMessageBean");
private transient MessageDrivenContext mdc = null;
private Context context;
public SimpleMessageBean() {
logger.info("In SimpleMessageBean.SimpleMessageBean()");
}
public void setMessageDrivenContext(MessageDrivenContext mdc) {
logger.info("In SimpleMessageBean.setMessageDrivenContext()");
this.mdc = mdc;
}
public void ejbCreate() {
logger.info("In SimpleMessageBean.ejbCreate()");
}
public void onMessage(Message inMessage) {
TextMessage msg = null;
try {
if (inMessage instanceof TextMessage) {
msg = (TextMessage) inMessage;
logger.info("MESSAGE BEAN: Message received: " + msg.getText());
} else {
logger.warning("Message of wrong type: " +
inMessage.getClass().getName());
}
} catch (JMSException e) {
e.printStackTrace();
mdc.setRollbackOnly();
} catch (Throwable te) {
te.printStackTrace();
}
} // onMessage
public void ejbRemove() {
logger.info("In SimpleMessageBean.remove()");
}
} // class
Thanks a bunch!
Tuan
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/548536#548536]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 10 months
[jBPM] - Deploying jbpm 4.4 snapshot on tomcat issue
by Jaber C. Mourad
Jaber C. Mourad [http://community.jboss.org/people/newbeewan] created the discussion
"Deploying jbpm 4.4 snapshot on tomcat issue"
To view the discussion, visit: http://community.jboss.org/message/548534#548534
--------------------------------------------------------------
Hi,
I'm experimenting jbpm4.4 (build for svn commit 6420) and I have serious problem at deployment on tomcat.
My unit tests works as usual after correcting some comportments due to evolution of jbpm.
Prevouisly with jbpm 4.3 it was working, but now, when I want to deploy on the app server, I got :
java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, com/sun/faces/config/ConfigureListener, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type javax/el/ExpressionFactory used in the signature
at com.sun.faces.config.ConfigureListener.registerELResolverAndListenerWithJsp(ConfigureListener.java:581)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:212)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:521)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1359)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1475)
at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:824)
at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:350)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:558)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Any idea to solve that issue are welcome ?
Regards
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/548534#548534]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 10 months
Re: [jboss-user] [JBoss Cache] - help upgrading from 1.2.1 to 3.2.5 needed
by Dirk Mallon
Dirk Mallon [http://community.jboss.org/people/blakkorange] replied to the discussion
"help upgrading from 1.2.1 to 3.2.5 needed"
To view the discussion, visit: http://community.jboss.org/message/548511#548511
--------------------------------------------------------------
Hallo Galder and thx for reply!
I was in Holidays so did not answer.
i describe the situation more detailed:
productive system:
I run two Tomcats running on different servers with same webApp using hibernate on one DB.
JbossCache is second-level-cache for hibernate.
Jbosscache has no connection to DB.
testing:
to test the new jars and config i made to testprojects in eclipse similar to the productive system.
I load and save some hibernate-entities.
Got the same error as described in initial post.(full Trace at end of msg)
then i switched off serialization in treecache.xml and the error disappeared.
1) considering the scenario i described above:
What configurations in treecache.xml are necessary to match our needs(two cache-instances syncronizing permanently after changes in one of them). Do we need serialization?
trace-----------------
(main CommandAwareRpcDispatcher.java:387 ) ERROR java.lang.NullPointerException
2010-06-17 16:06:54,231 (main CommandAwareRpcDispatcher.java:387 ) ERROR java.lang.NullPointerException
2010-06-17 16:06:54,231 (main AbstractFlushingEventListener.java:324 ) ERROR Could not synchronize database state with session
org.hibernate.cache.CacheException: org.hibernate.cache.CacheException: java.lang.RuntimeException: Failure to marshal argument(s)
at org.hibernate.cache.jbc.timestamp.TimestampsRegionImpl.put(TimestampsRegionImpl.java:138)
at org.hibernate.cache.UpdateTimestampsCache.preinvalidate(UpdateTimestampsCache.java:70)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:275)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:260)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:179)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:375)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
at cas.cache.test.AbstractService.save(AbstractService.java:202)
at cas.cache.test.Starter.createSubs(Starter.java:45)
at cas.cache.test.Starter.run(Starter.java:30)
at cas.cache.test.Starter.main(Starter.java:21)
Caused by: org.hibernate.cache.CacheException: java.lang.RuntimeException: Failure to marshal argument(s)
at org.hibernate.cache.jbc.util.CacheHelper.put(CacheHelper.java:216)
at org.hibernate.cache.jbc.timestamp.TimestampsRegionImpl.put(TimestampsRegionImpl.java:136)
... 13 more
Caused by: java.lang.RuntimeException: Failure to marshal argument(s)
at org.jboss.cache.marshall.CommandAwareRpcDispatcher$ReplicationTask.call(CommandAwareRpcDispatcher.java:388)
at org.jboss.cache.marshall.CommandAwareRpcDispatcher$ReplicationTask.call(CommandAwareRpcDispatcher.java:355)
at org.jboss.cache.util.concurrent.WithinThreadExecutor.submit(WithinThreadExecutor.java:82)
at org.jboss.cache.marshall.CommandAwareRpcDispatcher.invokeRemoteCommands(CommandAwareRpcDispatcher.java:210)
at org.jboss.cache.RPCManagerImpl.callRemoteMethods(RPCManagerImpl.java:744)
at org.jboss.cache.RPCManagerImpl.callRemoteMethods(RPCManagerImpl.java:712)
at org.jboss.cache.RPCManagerImpl.callRemoteMethods(RPCManagerImpl.java:717)
at org.jboss.cache.interceptors.BaseRpcInterceptor.replicateCall(BaseRpcInterceptor.java:161)
at org.jboss.cache.interceptors.BaseRpcInterceptor.replicateCall(BaseRpcInterceptor.java:135)
at org.jboss.cache.interceptors.BaseRpcInterceptor.replicateCall(BaseRpcInterceptor.java:107)
at org.jboss.cache.interceptors.ReplicationInterceptor.handleCrudMethod(ReplicationInterceptor.java:160)
at org.jboss.cache.interceptors.ReplicationInterceptor.visitPutKeyValueCommand(ReplicationInterceptor.java:107)
at org.jboss.cache.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:100)
at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
at org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:131)
at org.jboss.cache.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:65)
at org.jboss.cache.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:100)
at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
at org.jboss.cache.interceptors.TxInterceptor.attachGtxAndPassUpChain(TxInterceptor.java:301)
at org.jboss.cache.interceptors.TxInterceptor.handleDefault(TxInterceptor.java:283)
at org.jboss.cache.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:65)
at org.jboss.cache.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:100)
at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
at org.jboss.cache.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:178)
at org.jboss.cache.interceptors.InvocationContextInterceptor.visitPutKeyValueCommand(InvocationContextInterceptor.java:82)
at org.jboss.cache.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:100)
at org.jboss.cache.interceptors.InterceptorChain.invoke(InterceptorChain.java:287)
at org.jboss.cache.invocation.CacheInvocationDelegate.put(CacheInvocationDelegate.java:555)
at org.hibernate.cache.jbc.util.CacheHelper.put(CacheHelper.java:214)
... 14 more
Caused by: java.lang.NullPointerException
at org.jboss.cache.marshall.VersionAwareMarshaller.objectToObjectStream(VersionAwareMarshaller.java:342)
at org.jboss.cache.marshall.VersionAwareMarshaller.objectToBuffer(VersionAwareMarshaller.java:183)
at org.jboss.cache.marshall.VersionAwareMarshaller.objectToBuffer(VersionAwareMarshaller.java:52)
at org.jboss.cache.marshall.CommandAwareRpcDispatcher$ReplicationTask.call(CommandAwareRpcDispatcher.java:383)
... 42 more
trace-----------------
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/548511#548511]
Start a new discussion in JBoss Cache at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 10 months
Re: [jboss-user] [jBPM] - Variables from ended process ...
by Jaber C. Mourad
Jaber C. Mourad [http://community.jboss.org/people/newbeewan] replied to the discussion
"Variables from ended process ..."
To view the discussion, visit: http://community.jboss.org/message/548508#548508
--------------------------------------------------------------
Hi,
I'm trying to use history varaibles in jbpm 4.4 and I encounter an NPE :
2010-06-17 15:56:07,742 [INFO ] org.jbpm.pvm.internal.svc.DefaultCommandService 54 - exception while executing command org.jbpm.pvm.internal.cmd.GetHistoryVariablesCmd@194d4313
java.lang.NullPointerException
at org.jbpm.pvm.internal.cmd.GetHistoryVariablesCmd.execute(GetHistoryVariablesCmd.java:60)
at org.jbpm.pvm.internal.cmd.GetHistoryVariablesCmd.execute(GetHistoryVariablesCmd.java:40)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.SpringCommandCallback.doInTransaction(SpringCommandCallback.java:45)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)
at org.jbpm.pvm.internal.svc.HistoryServiceImpl.getVariables(HistoryServiceImpl.java:97)
Is there something particula to configure to make it available ?
I'm using the executionService method executionService.createVariables(executionId, myVariables, true); to activate the history on the current process variable, and I can see some sql insert to the table PROCESS_HISTORY_VARIABLE so I think data are available...
Regards
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/548508#548508]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 10 months