[JBoss Microcontainer Users] - Confused about POJO service
by karypid
Hello,
The new mc is probably the most feature-rich container out there. You can roll with anything from POJOs to MBeans. However, I am a little confused due to the multitude of options. My predicament is this:
I want to create a service to be deployed in JBoss. Until recently, I'd create a SAR and launch my thread in start(), then kill it in stop() of my MBean. I do this at deployment/undeployment time, so I do not really need the JMX features to control the service. Therefore I want to turn it into a POJO service and remove dependencies on MBean classes. How would you go about packaging such a POJO service so that:
1) it may be included in an EAR (The SAR approach requires that an MBean be defined in jboss-service.xml so it is no longer an option)
2) it executes on application startup / shutdown
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4259323#4259323
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4259323
15 years, 3 months
[jBPM Users] - Re: How to stop a process instance
by fdegrigny
Last I found how to do this.
In fact the ProcessIntance.end() method really terminate the process but not all the running process tasks in it (this has confused me).
The process tasks have to be terminated separately.
At last, I have made all my ActionHandlers extends a custom base one :
public abstract class BaseActionHandler implements ActionHandler {
|
| public void execute(ExecutionContext executionContext) throws Exception {
| try {
| doAction(executionContext);
| } catch (Throwable t) {
| handleException(t, executionContext);
| }
| }
|
| public abstract void doAction(ExecutionContext executionContext) throws Exception;
|
| protected void handleException(Throwable t, ExecutionContext executionContext) throws Exception {
| log.fatal("Error in " + this.getClass().getName() + ": " + t.getMessage(), t);
|
| //try to stop process instance and associated tasks
| ProcessInstance processInstance = executionContext.getProcessInstance();
| stopProcess(processInstance);
|
| throw new JbpmException(t.getMessage(), t);
| }
|
| protected void stopProcess(ProcessInstance processInstance) {
| JbpmContext jbpmContext = JbpmConfiguration.getInstance().getCurrentJbpmContext();
| Collection<TaskInstance> taskInstances = unchekedCast(processInstance.getTaskMgmtInstance().getTaskInstances());
| for(TaskInstance task : taskInstances) {
| if( ! task.hasEnded() ) {
| task.setSignalling(false);
| task.cancel();
| jbpmContext.save(task);
| }
| }
| processInstance.end();
| }
| }
What I have found over-complicated is the JBPM API itself. I'm working with for few month now and there is many things I still cannot understand. For example, the various variables scopes are very confusing and the semantic of many operations are not very clear.
My customers have very basics needs for their workflows but I have discover that they cannot be done simply with the JBPM API.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4259303#4259303
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4259303
15 years, 3 months
[JBoss Messaging Users] - Re: User: null is NOT authenticated
by gbansal80
We are currently using JBoss v4.2.3.ga and have upgraded JBoss messaging to v 1.4.4 and JBoss remoting to v2.2.3.
JMS messages are sent & received without any exceptions for initial 3-4 days. After that we are observing exception messagesjavax.jms.JMSSecurityException: User null is NOT authenticated, whenever we are trying to create the connection.
We have seen that there is no deadlock on JBoss AS and other DB operations are working normally.
We are using the following security domain for JMS
<application-policy name="messaging">
<login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
flag = "required">
<module-option name = "unauthenticatedIdentity">guest</module-option>
<module-option name = "dsJndiName">java:/DefaultDS</module-option>
<module-option name = "principalsQuery">SELECT PASSWD FROM JBM_USER WHERE USER_ID=?</module-option>
<module-option name = "rolesQuery">SELECT ROLE_ID, 'Roles' FROM JBM_ROLE WHERE USER_ID=?</module-option>
</login-module>
</application-policy>
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4259299#4259299
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4259299
15 years, 3 months
Re: [jboss-user] Switching message store databases: problem with AS 5.1
by samk@twinix.com
See Thread at: http://www.techienuggets.com/Detail?tx=95591 Posted on behalf of a User
<mbean code="org.jboss.jms.server.destination.TopicService"
name="jboss.messaging.destination:service=Topic,name=jachymProgress"
xmbean-dd="xmdesc/Topic-xmbean.xml">
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
<depends>jboss.messaging:service=PostOffice</depends>
You probably don't have PostOffice dependence configured properly? at least this helped me :-)
In Response To:
Daniel Bevenius of the JBoss ESB Group suggest me to post my question in this forum:
I'm trying to switch the message store database from the default hypersonic to oracle.
No problem with AS 4.2.2 (JMQ) and esb 4.6, but with AS 5.1 (JBM) I get this exception:
| 19:06:39,478 ERROR [ExceptionUtil] Queue[null, name=DeadMessageQueue] startService
| java.lang.NullPointerException
| at org.jboss.jms.server.ServerPeer.getPostOfficeInstance(ServerPeer.java:1382)
| at org.jboss.jms.server.destination.DestinationServiceSupport.setMaxSizeForQueues(DestinationServic
| eSupport.java:273)
| at org.jboss.jms.server.destination.DestinationServiceSupport.startService(DestinationServiceSuppor
| t.java:110)
| at org.jboss.jms.server.destination.QueueService.startService(QueueService.java:65)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:376)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:322)
| at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.ja
| va:140)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
| at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:189)
| at $Proxy38.start(Unknown Source)
| at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.
| java:42)
| at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.
| java:37)
| at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleCont
| rollerContextAction.java:62)
| at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContex
| tAction.java:71)
| at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextA
| ctions.java:51)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:34
| 8)
| at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:2
| 86)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
| at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
| at org.jboss.system.ServiceController.start(ServiceController.java:460)
| at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
| at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
| at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
| at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpl
| eRealDeployer.java:62)
| at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:5
| 0)
| at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157
| )
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178
| )
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210
| )
| at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:34
| 8)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
| at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapte
| r.java:117)
| at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployActio
| n.java:70)
| at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileA
| ction.java:53)
| at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfile
| Service.java:361)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:34
| 8)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
| at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(Abstrac
| tProfileService.java:306)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.jav
| a:271)
| at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
| at org.jboss.Main.boot(Main.java:221)
| at org.jboss.Main$1.run(Main.java:556)
| at java.lang.Thread.run(Thread.java:619)
| 19:06:39,480 ERROR [AbstractKernelController] Error installing to Start: name=jboss.esb.destination:
| name=DeadMessageQueue,service=Queue state=Create mode=Manual requiredState=Installed
| java.lang.NullPointerException
| at org.jboss.jms.server.ServerPeer.getPostOfficeInstance(ServerPeer.java:1382)
| at org.jboss.jms.server.destination.DestinationServiceSupport.setMaxSizeForQueues(DestinationServic
| eSupport.java:273)
| at org.jboss.jms.server.destination.DestinationServiceSupport.startService(DestinationServiceSuppor
| t.java:110)
| at org.jboss.jms.server.destination.QueueService.startService(QueueService.java:65)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:376)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:322)
| at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.ja
| va:140)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
| at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:189)
| at $Proxy38.start(Unknown Source)
| at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.
| java:42)
| at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.
| java:37)
| at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleCont
| rollerContextAction.java:62)
| at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContex
| tAction.java:71)
| at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextA
| ctions.java:51)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:34
| 8)
| at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:2
| 86)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
| at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
| at org.jboss.system.ServiceController.start(ServiceController.java:460)
| at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
| at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
| at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
| at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpl
| eRealDeployer.java:62)
| at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:5
| 0)
| at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157
| )
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178
| )
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210
| )
| at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:34
| 8)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
| at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapte
| r.java:117)
| at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployActio
| n.java:70)
| at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileA
| ction.java:53)
| at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfile
| Service.java:361)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:34
| 8)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
| at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(Abstrac
| tProfileService.java:306)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.jav
| a:271)
| at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
| at org.jboss.Main.boot(Main.java:221)
| at org.jboss.Main$1.run(Main.java:556)
| at java.lang.Thread.run(Thread.java:619)
|
Can you help me?
Thank you very much
Stefano
15 years, 3 months