[jBPM] - Resources Handling on TaskClient in JBPM5
by Andy Yeung
Andy Yeung [http://community.jboss.org/people/andy.yeung] created the discussion
"Resources Handling on TaskClient in JBPM5"
To view the discussion, visit: http://community.jboss.org/message/634736#634736
--------------------------------------------------------------
We are currently using the MinaTaskClientConnector within the TaskClient based on the example given. I noticed that CommandBasedWSHumanTaskHandler indeed need to create TaskClient by itself. Since TaskClient involves making connection to server, I want to ask the following in order to decide how to manage the TaskClient instances.
1. Does every TaskClient take up large amount of resources?
2. Is TaskClient thread safe which I can shared among multiple knowledgeSession?
3. I notice that clientConnnector within the TaskClient owned the BaseHandler and I notice that everytime CommandBasedWSHumanTaskHandler execute an workitem, it register an event handler in the BaseHandler. But it seems won't unregister it after use. Does it mean TaskClient is not meant to be shared?
4. I notice that there is a isRemove interface in EventResponseHandler but I find that TaskCompletedHandler isRemove always return false. Don't know if there is reason behind that.
Anyone has idea on this?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/634736#634736]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years
[jBPM] - MapBasedPersistenceTest issue
by Donald Walters
Donald Walters [http://community.jboss.org/people/dondragon2] created the discussion
"MapBasedPersistenceTest issue"
To view the discussion, visit: http://community.jboss.org/message/633511#633511
--------------------------------------------------------------
I am tring to use the MapPersistence instead of a database underlying the JPAKnowledgeService but I keep getting an exception. I have done the setup according to the MapBasedPersistenceTest
What could I be doing wrong here?
StatefulKnowledgeSession ksession = newStatefulKnowledgeSession();
WorkflowProcessInstance processInstance = (WorkflowProcessInstance) ksession.startProcess("ServiceProcess", params); //<==exception
public static StatefulKnowledgeSession newStatefulKnowledgeSession() {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("workflowtest/MyProcess.xml"), ResourceType.BPMN2);
KnowledgeBase kbase = kbuilder.newKnowledgeBase();
EnvironmentBuilder envBuilder = new KnowledgeSessionStorageEnvironmentBuilder(storage);
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.TRANSACTION_MANAGER, envBuilder.getTransactionManager());
env.set(EnvironmentName.PERSISTENCE_CONTEXT_MANAGER, envBuilder.getPersistenceContextManager());
return JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
}
===================================================
java.lang.ClassCastException: org.drools.persistence.map.MapPersistenceContextManager cannot be cast to org.jbpm.persistence.ProcessPersistenceContextManager
at org.jbpm.persistence.processinstance.JPAProcessInstanceManager.addProcessInstance(JPAProcessInstanceManager.java:32)
at org.jbpm.process.instance.AbstractProcessInstanceFactory.createProcessInstance(AbstractProcessInstanceFactory.java:36)
at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:168)
at org.jbpm.process.instance.ProcessRuntimeImpl.createProcessInstance(ProcessRuntimeImpl.java:140)
at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:121)
at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1095)
at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:306)
at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:119)
at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:38)
at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:292)
at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:222)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/633511#633511]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years
[JBoss Web Services] - JBoss AS 7 - Call Glassfish WS - None of the policy alternatives can be satisfied
by Tiago Sudeval
Tiago Sudeval [http://community.jboss.org/people/sudeval] created the discussion
"JBoss AS 7 - Call Glassfish WS - None of the policy alternatives can be satisfied"
To view the discussion, visit: http://community.jboss.org/message/635620#635620
--------------------------------------------------------------
My app need consume a web service on an Glassfish, but when calling the method (searchMethod) get the error "None of the policy alternatives can be satisfied.".
The webservice client classes are imported as jar-archive in the my app.
I use Jboss AS 7.0.1, my app hasn´t lib of Spring or CXF (it´s necessary ?).
How do I solve this problem ?
links:
http://community.jboss.org/message/519968#519968 http://community.jboss.org/message/519968
JBossWS - Meter is descontinued and hasn´t version compatible with JBoss AS 7 ( http://community.jboss.org/en/jbossws/metro http://community.jboss.org/en/jbossws/metro).
Trace:
> 19:25:39,438 INFO [org.apache.cxf.service.facto
> ry.ReflectionServiceFactoryBean] (http--0.0.0.0-8080-3) Creating Service { http://nfe.consultas.ws.nfecorp.sefaz.ce.gov.br/%7DConsultaNfeService http://my.company.domain.project.ws/}SearchSomethingService from WSDL: http://dese2.sefaz.ce.gov.br/ConsultaNfeService/ConsultaNfe?wsdl http://my.company.host/SearchSomethingService/SearchSomething?wsdl
> 19:25:48,523 WARN [org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl] (http--0.0.0.0-8080-3) No assertion builder for type { http://schemas.xmlsoap.org/ws/2004/10/wsat%7DATAlwaysCapability http://schemas.xmlsoap.org/ws/2004/10/wsat}ATAlwaysCapability registered.
> 19:25:48,523 WARN [org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl] (http--0.0.0.0-8080-3) No assertion builder for type { http://schemas.xmlsoap.org/ws/2004/10/wsat%7DATAssertion http://schemas.xmlsoap.org/ws/2004/10/wsat}ATAssertion registered.
> 19:25:48,695 WARN [org.apache.cxf.phase.PhaseInterceptorChain] (http--0.0.0.0-8080-3) Interceptor for { http://nfe.consultas.ws.nfecorp.sefaz.ce.gov.br/%7DConsultaNfeService http://my.company.domain.project.ws http://nfe.consultas.ws.nfecorp.sefaz.ce.gov.br/%7DConsultaNfeService#%7B... /}SearchSomethingService#{ http://nfe.consultas.ws.nfecorp.sefaz.ce.gov.br/%7DConsultaNfeService http://my.company.domain.project.ws http://nfe.consultas.ws.nfecorp.sefaz.ce.gov.br/%7DConsultaNfeService#%7B... /}searchMethod has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: None of the policy alternatives can be satisfied.
> at org.apache.cxf.ws.policy.AbstractPolicyInterceptor.handleMessage(AbstractPolicyInterceptor.java:47)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
> at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:510)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:440)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:343)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:295)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy149.consultar(Unknown Source) at my.company.domain.project.web.action.SomethingAction.loadSomething(SomethingAction.java:276) [classes:7.0.1.Final]
> at my.company.domain.project.web.action.SomethingAction$Proxy$_$$_WeldClientProxy.loadSomething(SomethingAction$Proxy$_$$_WeldClientProxy.java) [classes:7.0.1.Final]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_27]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_27]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_27]
> at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_27]
> at org.apache.el.parser.AstValue.invoke(AstValue.java:196) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
> at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
> at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
> at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:56) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
> at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
> at com.sun.faces.facelets.tag.jsf.core.DeclarativeSystemEventListener.processEvent(EventHandler.java:128) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
> at javax.faces.component.UIComponent$ComponentSystemEventListenerAdapter.processEvent(UIComponent.java:2477) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
> at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
> at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2102) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
> at com.sun.faces.application.ApplicationImpl.invokeComponentListenersFor(ApplicationImpl.java:2050) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
> at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:287) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
> at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:245) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
> at org.jboss.as.weld.webtier.jsf.ForwardingApplication.publishEvent(ForwardingApplication.java:293) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]
> at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:670) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
> at org.jboss.seam.faces.environment.SeamApplicationWrapper$Proxy$_$$_WeldClientProxy.publishEvent(SeamApplicationWrapper$Proxy$_$$_WeldClientProxy.java) [seam-faces-3.0.2.Final.jar:7.0.1.Final]
> at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
> at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
> at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
> at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
> at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:118) [prettyfaces-jsf2-3.2.1.jar:7.0.1.Final]
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
> at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final]
> at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final]
> at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:49) [jboss-as-jpa-7.0.1.Final.jar:7.0.1.Final]
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
> at http://org.apache.tomcat.util.net/ org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
> at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]
> Caused by: org.apache.cxf.ws.policy.PolicyException: None of the policy alternatives can be satisfied.
> at org.apache.cxf.ws.policy.EffectivePolicyImpl.chooseAlternative(EffectivePolicyImpl.java:152)
> at org.apache.cxf.ws.policy.EffectivePolicyImpl.initialise(EffectivePolicyImpl.java:88)
> at org.apache.cxf.ws.policy.PolicyEngineImpl.getEffectiveClientRequestPolicy(PolicyEngineImpl.java:196)
> at org.apache.cxf.ws.policy.PolicyOutInterceptor.handle(PolicyOutInterceptor.java:111)
> at org.apache.cxf.ws.policy.AbstractPolicyInterceptor.handleMessage(AbstractPolicyInterceptor.java:45)
> ... 54 more
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/635620#635620]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years
[jBPM] - JbpmOnTomcat
by Anibal Sanchez
Anibal Sanchez [http://community.jboss.org/people/anibal.sanchez] modified the document:
"JbpmOnTomcat"
To view the document, visit: http://community.jboss.org/docs/DOC-11161
--------------------------------------------------------------
h3. This how-to outlines the necessary steps to get *jBPM 3.2* working with *Tomcat* and *MySQL*.
It has been tested with the following *environments:*
Tomcat 5.0.28 / 5.5.26 / 6.0.10 / 7.0.22 (see the notes at the bottom of this page)
MySQL 5.0.15
jBPM 3.2.GA *and also with jBPM 3.2.1/3.2.2/3.2.3* (just some minor changes highlighted in the text below!)
h4. *1. Create schema and tables in MySQL*
1.1 In this example a schema 'jbpm32' with a user 'jbossjbpm' is used.
1.2 Generate all jBPM tables using the script from the downloaded jBPM 3.2 suite, which has to be modified a bit to suite the MySQL syntax. Attached to this page is a script (jbpm.jpdl.mysql.sql) with these modifications already done - just for your convenience! If you want your users/roles information (the identity components) also from the MySQL db, use the second sql script attached here (mysql.identity.script.sql for jBPM 3.2.GA and mysql.identity.script.jbpm321.sql for *jBPM 3.2.1*) to set up the necessary tables and fill them with the demo values.
h4. *2. Prepare your jBPM archive*
2.1 In jbpm-jpdl-3.2.GA/deploy (or jbpm-jpdl-3.2.1/deploy) run
ant customize.console.for.tomcat
2.2 This builds a jbpm-console.war in jbpm-jpdl-3.2.GA/deploy/customized (almost) ready for deployment in TC
2.3 Change the jbpm-console.war/WEB-INF/classes/hibernate.cfg.xml to reflect the following changes:
<hibernate-configuration>
<session-factory>
<!-- hibernate dialect -->
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<!-- JDBC connection properties (begin) -->
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/jbpm32</property>
<property name="hibernate.connection.username">jbossjbpm</property>
<property name="hibernate.connection.password">jbossjbpm</property>
<!-- JDBC connection properties (end) -->
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<!-- DataSource properties (begin) ==
<property name="hibernate.connection.datasource">java:/JbpmDS</property>
== DataSource properties (end) -->
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
...
(Make sure to use the hibernate.connection.driver/url attributes to connect to the db and not the hibernate.connection.datasource property. Also set hibernate.transaction.factory_class to JDBCTransactionFactory instead of the JTATransactionFactory or CMTTransactionFactory which are already in this file.)
2.4 Copy jboss-j2ee.jar (or maybe as well any jar that contains the default javax.transaction package) to jbpm-console.war/WEB-INF/lib. (Note: jboss-j2ee.jar can be found in a standard JBoss AS distribution eg. jboss-4.0.5.GA/client or in the http://repository.jboss.com/jbossas/core-libs/4.0.5.GA/lib/jboss-j2ee.jar repo)
2.4.1 For *jBPM 3.2.1 and higher*: Copy commons-collections.jar to jbpm-console.war/WEB-INF/lib. (Note: commons-collections.jar can be found in a standard JBoss AS distribution eg. jboss-4.0.5.GA/server/default/lib or in the http://repository.jboss.com/apache-commons/mixed/lib/commons-collections.jar repo)
2.5 Copy the jar containing the mysql jdbc driver to /$CATALINA_HOME/common/lib
2.6 Copy the adapted jbpm-console.war to /$CATALINA_HOME/webapps
+You can now give it a try and start Tomcat. You should be able to start the jbpm web application, but for now you cannot successfully log in. +
Next thing to do would be to properly configure your security realm. You could either go for the standard file based MemoryRealm and just add the jBPM specific users and roles to /$CATALINA_HOME/conf/tomcat-users.xml, OR...
h4. *3. Setup a JDBC Realm in Tomcat*
3.1 Create a file jbpm-console.xml in /$CATALINA_HOME/conf/Catalina/localhost similar to
<Context>
<Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/jbpm32"
connectionName="jbossjbpm"
connectionPassword="jbossjbpm"
userTable="JBPM_ID_USER u, JBPM_ID_MEMBERSHIP m, JBPM_ID_GROUP g"
userNameCol="g.TYPE_ = 'security-role' AND m.GROUP_ = g.ID_ AND m.USER_ = u.ID_ AND u.NAME_"
userCredCol="DISTINCT u.PASSWORD_"
userRoleTable="JBPM_ID_USER u, JBPM_ID_MEMBERSHIP m, JBPM_ID_GROUP g"
roleNameCol="g.NAME_" ></Realm>
</Context>
Now you should be able to run jBPM default web app in Tomcat and login with the username/password (eg. ernie/ernie for jBPM 3.2.GA or manager/manager for *jBPM 3.2.1*) from the db.
(Note: This how-to first found its way in http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032532 this post, so you might find some more discussion about this there.)
h4. **4.** Notes for users of Tomcat 7.x
The Sun jsf libs 1.2 ( http://javaserverfaces.java.net/ jsf-api.jar and http://javaserverfaces.java.net/ jsf-impl.jar) need to be included in the jbpm-console.war/WEB-INF/lib directory.
h4. **5.** Notes for users of Tomcat versions older than Tomcat 6.x
Notes for users of Tomcat versions older than Tomcat 6.x, such as *Tomcat 5.0.28* or *Tomcat 5.5.26*: Tomcat 5.0.28/5.5.26 doesn't include the el.jars by default as the TC 6.0 series does, you will have to repackage http://repository.jboss.com/el/1.0/lib/el-api.jar el-api.jar and http://repository.jboss.com/el/1.0/lib/el-ri.jar el-ri.jar back into jbpm-console.war/WEB-INF/lib (these files get deleted by the ant call described in step 2.1 above and can be found in the original web app jbpm-jpdl-3.2.1/deploy/jbpm-console.war/WEB-INF/lib). In addition, the included xml parses make problems as well, so you will also have to replace/delete the content in common/endorsed.
Notes for users of Tomcat 5.x and *jBPM 3.2.2*: The Sun jsf libs ( http://repository.jboss.com/sun-jsf/1.2.1/lib/ jsf-api.jar and http://repository.jboss.com/sun-jsf/1.2.1/lib/jsf-impl.jar jsf-impl.jar) need to be included in the jbpm-console.war/WEB-INF/lib directory as well.
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-11161]
Create a new document in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
13 years
[JBoss Messaging] - Sometimes consume message, sometimes doesn't...
by everson .
everson . [http://community.jboss.org/people/everjava] created the discussion
"Sometimes consume message, sometimes doesn't..."
To view the discussion, visit: http://community.jboss.org/message/635513#635513
--------------------------------------------------------------
Hello!
I have this code below and sometimes I can't consume a message, I get return null. But when I'll go to jboss admin-console and
search on "list durable messages" using the message selector as I used inside the code it is found.
Initially it happend when I call getMessage(..) inside a loop for(), so I thought it was a problem because of several calls. But happend again when just have
one call. It doesn't happen everytime, just sometimes
What could be wrong ??
ObjectMessage om = jms.getMessage( "queue/MyQueue", "cpf='" + p.getCpf().trim()+ "'");
public ObjectMessage getMessage( String lookup, String messageSelector) {
Session session = null;
Connection connection = null;
ObjectMessage om = null;
try {
ConnectionFactory factory = (QueueConnectionFactory) getInitialContext().lookup("/ConnectionFactory");//java:/ConnectionFactory
connection = factory.createConnection();
session = connection.createSession(false, QueueSession.AUTO_ACKNOWLEDGE);
Destination destination = (Destination) getInitialContext().lookup(lookup);
MessageConsumer consumer = session.createConsumer(destination, messageSelector);
connection.start();
Message message = consumer.receive(5000);
om = (ObjectMessage) message;
} catch (Exception e) {}
return om;
}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/635513#635513]
Start a new discussion in JBoss Messaging at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years
[Beginner's Corner] - Messaging in AS7
by el_paso
el_paso [http://community.jboss.org/people/el_paso] created the discussion
"Messaging in AS7"
To view the discussion, visit: http://community.jboss.org/message/635511#635511
--------------------------------------------------------------
Hi,
I'm trying to make this code http://docs.jboss.org/jbossas/docs/Server_Configuration_Guide/4/html/JMS_... http://docs.jboss.org/jbossas/docs/Server_Configuration_Guide/4/html/JMS_... but I always get this error:
11:13:51,470 INFO [stdout] (http--127.0.0.1-8080-4) Begin sendAsync
11:13:51,470 ERROR [stderr] (http--127.0.0.1-8080-4) javax.naming.NameNotFoundException: ConnectionFactory -- service jboss.naming.context.java.ConnectionFactory
11:13:51,470 ERROR [stderr] (http--127.0.0.1-8080-4) at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:87)
11:13:51,470 ERROR [stderr] (http--127.0.0.1-8080-4) at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:173)
11:13:51,470 ERROR [stderr] (http--127.0.0.1-8080-4) at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:47)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:209)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at javax.naming.InitialContext.lookup(Unknown Source)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at com.lsyh.salespotential.CommandOutput.setupPubSub(CommandOutput.java:26)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at com.lsyh.salespotential.CommandOutput.sendAsync(CommandOutput.java:40)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at com.lsyh.salespotential.CommandInputBean.sendCommand(CommandInputBean.java:40)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at com.lsyh.salespotential.CommandInputBean.submitButton(CommandInputBean.java:57)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at java.lang.reflect.Method.invoke(Unknown Source)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at org.apache.el.parser.AstValue.invoke(AstValue.java:196)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at javax.faces.component.UICommand.broadcast(UICommand.java:300)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
11:13:51,473 ERROR [stderr] (http--127.0.0.1-8080-4) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
11:13:51,475 ERROR [stderr] (http--127.0.0.1-8080-4) at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
11:13:51,475 ERROR [stderr] (http--127.0.0.1-8080-4) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
11:13:51,475 ERROR [stderr] (http--127.0.0.1-8080-4) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
11:13:51,475 ERROR [stderr] (http--127.0.0.1-8080-4) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
11:13:51,475 ERROR [stderr] (http--127.0.0.1-8080-4) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
11:13:51,475 ERROR [stderr] (http--127.0.0.1-8080-4) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
11:13:51,475 ERROR [stderr] (http--127.0.0.1-8080-4) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
11:13:51,475 ERROR [stderr] (http--127.0.0.1-8080-4) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
11:13:51,475 ERROR [stderr] (http--127.0.0.1-8080-4) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139)
11:13:51,475 ERROR [stderr] (http--127.0.0.1-8080-4) at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57)
11:13:51,475 ERROR [stderr] (http--127.0.0.1-8080-4) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154)
11:13:51,475 ERROR [stderr] (http--127.0.0.1-8080-4) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
11:13:51,475 ERROR [stderr] (http--127.0.0.1-8080-4) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
11:13:51,478 ERROR [stderr] (http--127.0.0.1-8080-4) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
11:13:51,478 ERROR [stderr] (http--127.0.0.1-8080-4) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
11:13:51,478 ERROR [stderr] (http--127.0.0.1-8080-4) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667)
11:13:51,478 ERROR [stderr] (http--127.0.0.1-8080-4) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952)
11:13:51,478 ERROR [stderr] (http--127.0.0.1-8080-4) at java.lang.Thread.run(Unknown Source)
Seems the problem is this:
InitialContext iniCtx = new InitialContext();
Object tmp = iniCtx.lookup("ConnectionFactory");
Maybe I'm not configuring something but what?
Please help
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/635511#635511]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years