[EJB 3.0] - Re: JBoss 5 deployment error
by jhsingle
OK, I have fixed the classloader issues and my ear now deploys. Now the JUnit tests are failing with a transaction error that I do not understand. I have searched the forums for this message and saw a few mentions, but nothing relevant to this case.
| -------------------------------------------------------------------------------
| Test set: workflow.test.ejb.LoopTest
| -------------------------------------------------------------------------------
| Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.567 sec <<< FAILURE!
| testDefine(workflow.test.ejb.LoopTest) Time elapsed: 3.525 sec <<< ERROR!
| javax.persistence.TransactionRequiredException: EntityManager must be access within a transaction
| at org.jboss.jpa.deployment.ManagedEntityManagerFactory.verifyInTx(ManagedEntityManagerFactory.java:155)
| at org.jboss.jpa.tx.TransactionScopedEntityManager.persist(TransactionScopedEntityManager.java:186)
| at workflow.ejb.server.WorkflowManager.persistExecutionSummaryImplementation(WorkflowManager.java:386)
| at workflow.ejb.server.WorkflowManager.persistExecutionSummary(WorkflowManager.java:93)
| at workflow.ejb.server.WorkflowManager.startImplementation(WorkflowManager.java:717)
| at workflow.ejb.server.WorkflowManager.start(WorkflowManager.java:263)
| 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:585)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
| at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
| at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
| at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
| 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:585)
| at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
| at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_25059428.invoke(InvocationContextInterceptor_z_fillMethod_25059428.java)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
| at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_25059428.invoke(InvocationContextInterceptor_z_setup_25059428.java)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
| at org.jboss.ejb3.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:114)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.security.RunAsSecurityInterceptorv2.invoke(RunAsSecurityInterceptorv2.java:94)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:201)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:159)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:65)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:486)
| at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:56)
| at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
| at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:908)
| at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:742)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:522)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230)
| at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:206)
| at org.jboss.remoting.Client.invoke(Client.java:1708)
| at org.jboss.remoting.Client.invoke(Client.java:612)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
| at $Proxy32.invoke(Unknown Source)
| at org.jboss.ejb3.proxy.handler.ProxyInvocationHandlerBase.invoke(ProxyInvocationHandlerBase.java:261)
| at org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase.invoke(SessionSpecProxyInvocationHandlerBase.java:101)
| at $Proxy3.start(Unknown Source)
| at workflow.test.ejb.LoopTest.testDefine(LoopTest.java:128)
| 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:585)
| at junit.framework.TestCase.runTest(TestCase.java:164)
| at junit.framework.TestCase.runBare(TestCase.java:130)
| at junit.framework.TestResult$1.protect(TestResult.java:106)
| at junit.framework.TestResult.runProtected(TestResult.java:124)
| at junit.framework.TestResult.run(TestResult.java:109)
| at junit.framework.TestCase.run(TestCase.java:120)
| at junit.framework.TestSuite.runTest(TestSuite.java:230)
| at junit.framework.TestSuite.run(TestSuite.java:225)
| 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:585)
| at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
| at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
| at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
| at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
| 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:585)
| at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
| at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
| at $Proxy32.invoke(Unknown Source)
| at org.jboss.ejb3.proxy.handler.ProxyInvocationHandlerBase.invoke(ProxyInvocationHandlerBase.java:261)
| at org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase.invoke(SessionSpecProxyInvocationHandlerBase.java:101)
| at $Proxy3.start(Unknown Source)
| at workflow.test.ejb.LoopTest.testDefine(LoopTest.java:128)
|
Here is the code for my test:
| package workflow.test.ejb;
|
|
|
| import java.io.FileNotFoundException;
|
| import java.io.InputStream;
|
| import java.util.List;
|
| import java.util.Properties;
|
|
|
| import javax.naming.InitialContext;
|
|
|
| import junit.framework.TestCase;
|
|
|
| import org.wfmc._2004.xpdl2.Activity;
|
| import org.wfmc._2004.xpdl2.DataField;
|
| import org.wfmc._2004.xpdl2.ExtendedAttributes;
|
| import org.wfmc._2004.xpdl2.Loop;
|
| import org.wfmc._2004.xpdl2.Transition;
|
|
|
| import workflow.ejb.client.ExecutionDetail;
|
| import workflow.ejb.client.ExecutionSummary;
|
| import workflow.ejb.client.WorkflowManagerRemote;
|
| import workflow.ejb.client.WorkflowPackage;
|
|
|
| /**
|
| * Test Looping
|
| *
|
| */
|
| public class LoopTest extends TestCase {
|
| /**
|
| * Remote interface for Workflow Manager
|
| */
|
| private WorkflowManagerRemote mgr = null;
|
|
|
| /**
|
| * Polling time
|
| */
|
| private static final int POLL_TIME = 10000;
|
|
|
| /**
|
| * Loop wait time
|
| */
|
| private static final int LOOP_WAIT_TIME = 5000;
|
|
|
| /**
|
| * Maximum number of iterations (i < 6)
|
| */
|
| private static final int MAX_ITERATIONS = 3;
|
|
|
| /**
|
| * Initial iteration value (i = 0)
|
| */
|
| private static final int INITIAL_ITERATION_VALUE = 0;
|
|
|
| /**
|
| * When to test after = do/while loop before = for loop
|
| */
|
| private static final String WHEN_TO_TEST = "after";
|
|
|
|
| /**
|
| * main()
|
| *
|
| * @param args
|
| */
|
| public static void main(String[] args) {
|
| junit.textui.TestRunner.run(BasicWorkflowTest.class);
|
| }
|
|
|
| /**
|
| * Constructor()
|
| *
|
| * @param name
|
| */
|
| public LoopTest(String name) {
|
| super(name);
|
| }
|
|
|
| /**
|
| * This method is the actual test case that is executed
|
| *
|
| * @throws Exception
|
| */
|
| public void testDefine() throws Exception {
|
| long id = -1;
|
|
|
| String name = "Name_" + System.currentTimeMillis() + "_"
|
| + Thread.currentThread().getId();
|
| try {
|
| // Construct XPDL
|
|
|
| WorkflowPackage pkg = new WorkflowPackage(name, "0", "BasicPD1_"
|
| + name);
|
| // Activity 0
|
| Activity a0 = pkg.addActivity("0", "0_cm");
|
| // Activity Data Fields.
|
|
|
| DataField df = WorkflowPackage.createDataField("numStmts",/* 0, */
|
| false, false, 10 + "");
|
| WorkflowPackage.addDataFieldToActivity(a0, df);
|
| ExtendedAttributes eas = WorkflowPackage.createExternalAttributes(
|
| "ModelManagerRemote", "workflow/ModelManager/remote",
|
| "ModelManagerRemote", "getModelAsString", "result0");
|
| a0.setExtendedAttributes(eas);
|
| Loop loop = WorkflowPackage.createStandardLoop(LOOP_WAIT_TIME,
|
| MAX_ITERATIONS, INITIAL_ITERATION_VALUE, WHEN_TO_TEST);
|
| a0.setLoop(loop);
|
|
|
| // Activity 1
|
| Activity a1 = pkg.addActivity("07777", "0_pass");
|
| // Activity Data Fields.
|
| DataField df2 = WorkflowPackage
|
| .createDataField("result0" /* , 0 */);
|
| WorkflowPackage.addDataFieldToActivity(a1, df2);
|
| eas = WorkflowPackage.createExternalAttributes(
|
| "ModelManagerRemote", "workflow/ModelManager/remote",
|
| "ModelManagerRemote", "passModel", "result07777");
|
| a1.setExtendedAttributes(eas);
|
|
|
| // Transition
|
| Transition t = new Transition();
|
| t.setName("0_cm_to_0_pass");
|
| t.setId("09999");
|
| t.setTo("07777");
|
| t.setFrom("0");
|
| pkg.addTransition(t); // Loop
|
|
|
| String xpdl = pkg.generateXPDL();
|
|
|
| id = mgr.persistProcessDefinition(xpdl);
|
| long pid = mgr.start(id);
|
|
|
| // give a chance for all actions to complete.
|
| ExecutionSummary executionSummary = mgr
|
| .retrieveProcessInstanceStatus(pid);
|
| int ctr = 0;
|
| boolean foundCount1 = false;
|
| boolean foundCount2 = false;
|
|
|
| while (executionSummary.getWhenCompleted() == null && ctr++ < 10) {
|
| Thread.sleep(POLL_TIME);
|
| executionSummary = mgr.retrieveProcessInstanceStatus(pid);
|
| }
|
|
|
| assertNotNull(executionSummary.getWhenCompleted());
|
| if (executionSummary.getWhenCompleted() != null) {
|
| List<ExecutionDetail> edList = executionSummary
|
| .getExecutionDetails();
|
| for (ExecutionDetail ed : edList) {
|
| if (ed.getResultingParams().containsKey("result0")) {
|
| foundCount1 = true;
|
| }
|
| if (ed.getResultingParams().containsKey("result07777")) {
|
| foundCount2 = true;
|
| }
|
| }
|
| }
|
|
|
| assertTrue(foundCount1);
|
| assertTrue(foundCount2);
|
|
|
| } finally {
|
| mgr.removeProcessDefinition(id);
|
| }
|
| }
|
|
|
| /**
|
| * @see TestCase#setUp()
|
| */
|
| @Override
|
| protected void setUp() throws Exception {
|
| super.setUp();
|
|
|
| InputStream in = getClass()
|
| .getResourceAsStream("/bootstrap.properties");
|
| if (in == null) {
|
| throw new FileNotFoundException(
|
| "Can't find file in classpath: bootstrap.properties");
|
| }
|
| Properties props = new Properties();
|
| props.load(in);
|
|
|
| InitialContext ic = new InitialContext(props);
|
|
|
| mgr = (WorkflowManagerRemote) ic
|
| .lookup("workflow/WorkflowManager/remote");
|
|
|
| }
|
|
|
| /**
|
| * @see TestCase#tearDown()
|
| */
|
| @Override
|
| protected void tearDown() throws Exception {
|
| super.tearDown();
|
| }
|
|
|
| }
|
|
Here is the code for WorkflowManager which, I believe, correctly calls for container-managed transactions, and specifies a REQUIRESNEW transaction attribute for the method called.
| package workflow.ejb.server;
|
| import java.io.Serializable;
| import java.util.ArrayList;
| import java.util.Date;
| import java.util.List;
|
| import javax.annotation.security.RolesAllowed;
| import javax.ejb.EJBContext;
| import javax.ejb.Stateless;
| import javax.ejb.TransactionAttribute;
| import javax.ejb.TransactionAttributeType;
| import javax.ejb.TransactionManagement;
| import javax.ejb.TransactionManagementType;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
| import javax.persistence.EntityExistsException;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
| import javax.persistence.Query;
|
| import org.apache.commons.lang.StringUtils;
| import org.apache.commons.logging.Log;
| import org.apache.commons.logging.LogFactory;
| import org.jboss.ejb3.annotation.RemoteBinding;
| import org.jboss.wsf.spi.annotation.WebContext;
|
| import security.authorization.AuthorizationPluginException;
| import security.authorization.BlackbookAuthorizationManager;
| import security.ejb.client.User;
| import workflow.ejb.client.ExecutionDetail;
| import workflow.ejb.client.ExecutionSummary;
| import workflow.ejb.client.ProcessDefinition;
| import workflow.ejb.client.ProcessDefinitionDigester;
| import workflow.ejb.client.StepDefinition;
| import workflow.ejb.client.TransitionReference;
| import workflow.ejb.client.WorkflowManagerRemote;
| import workflow.ejb.util.ParamUtil;
|
| /**
| * Implementation for the workflow management API.
| */
| @Stateless
| @WebService(endpointInterface = "workflow.ejb.client.WorkflowManagerEndpoint")
| @SOAPBinding(style = SOAPBinding.Style.RPC)
| @RolesAllowed( { "UNCLASSIFIED" })
| @RemoteBinding(jndiBinding = "workflow/WorkflowManager/remote")
| @TransactionManagement(value = TransactionManagementType.CONTAINER)
| @WebContext(contextRoot = "/workflowws", authMethod = "CLIENT-CERT", transportGuarantee = "CONFIDENTIAL", secureWSDLAccess = false)
| public class WorkflowManager implements Serializable, WorkflowManagerRemote {
| /**
| * The message queue
| */
| public static String queueName = "queue/WorkflowQ";
|
| /**
| * The class logger
| */
| private static Log logger = LogFactory.getLog(WorkflowManager.class);
|
| /**
| * The entity manager
| */
| @PersistenceContext(unitName = "workflow")
| protected EntityManager em;
|
| /** EJB context */
| @javax.annotation.Resource
| EJBContext ctx;
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#copyProcessDefinition(long)
| */
| public long copyProcessDefinition(long id) {
| return copyProcessDefinitionImplementation(getUser(), id);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#copyProcessDefinitionProxy(java.lang.String,
| * long)
| */
| @RolesAllowed( { "PROXY_USER" })
| public long copyProcessDefinitionProxy(String publicKey, long id) {
| return copyProcessDefinitionImplementation(getUser(publicKey), id);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#persistExecutionSummary(workflow.ejb.client.ExecutionSummary)
| */
| @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
| public ExecutionSummary persistExecutionSummary(
| ExecutionSummary executionSummaryCopy) {
| return persistExecutionSummaryImplementation(getUser(),
| executionSummaryCopy);
| }
|
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#persistExecutionSummaryProxy(java.lang.String,
| * workflow.ejb.client.ExecutionSummary)
| */
| @RolesAllowed( { "PROXY_USER" })
| @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
| public ExecutionSummary persistExecutionSummaryProxy(String publicKey,
| ExecutionSummary executionSummaryCopy) {
| return persistExecutionSummaryImplementation(getUser(publicKey),
| executionSummaryCopy);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#persistProcessDefinition(java.lang.String)
| */
| public long persistProcessDefinition(String definition) {
| return persistProcessDefinitionImplementation(getUser(), definition);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#persistProcessDefinitionProxy(java.lang.String,
| * java.lang.String)
| */
| @RolesAllowed( { "PROXY_USER" })
| public long persistProcessDefinitionProxy(String publicKey,
| String definition) {
| return persistProcessDefinitionImplementation(getUser(publicKey),
| definition);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#removeExecution(long)
| */
| public void removeExecution(long id) {
| removeExecutionImplementation(getUser(), id);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#removeExecutionProxy(java.lang.String,
| * long)
| */
| @RolesAllowed( { "PROXY_USER" })
| public void removeExecutionProxy(String publicKey, long id) {
| removeExecutionImplementation(getUser(publicKey), id);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#removeProcessDefinition(long)
| */
| public void removeProcessDefinition(long id) {
| removeProcessDefinitionImplementation(getUser(), id);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#removeProcessDefinitionProxy(java.lang.String,
| * long)
| */
| @RolesAllowed( { "PROXY_USER" })
| public void removeProcessDefinitionProxy(String publicKey, long id) {
| removeProcessDefinitionImplementation(getUser(publicKey), id);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#retrieveProcessDefinition(long)
| */
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public String retrieveProcessDefinition(long id) {
| return retrieveProcessDefinitionImplementation(getUser(), id);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#retrieveProcessDefinitionProxy(java.lang.String,
| * long)
| */
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| @RolesAllowed( { "PROXY_USER" })
| public String retrieveProcessDefinitionProxy(String publicKey, long id) {
| return retrieveProcessDefinitionImplementation(getUser(publicKey), id);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#retrieveMostRecentProcessInstanceID(long)
| */
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public long retrieveMostRecentProcessInstanceID(long pdId) {
| return retrieveMostRecentProcessInstanceIDImplementation(getUser(),
| pdId);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#retrieveMostRecentProcessInstanceIDProxy(java.lang.String,
| * long)
| */
| @RolesAllowed( { "PROXY_USER" })
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public long retrieveMostRecentProcessInstanceIDProxy(String publicKey,
| long pdId) {
| return retrieveMostRecentProcessInstanceIDImplementation(
| getUser(publicKey), pdId);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#retrieveProcessInstanceIDs(long)
| */
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public long[] retrieveProcessInstanceIDs(long pdId) {
| return retrieveProcessInstanceIDsImplementation(getUser(), pdId);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#retrieveProcessInstanceIDsProxy(java.lang.String,
| * long)
| */
| @RolesAllowed( { "PROXY_USER" })
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public long[] retrieveProcessInstanceIDsProxy(String publicKey, long pdId) {
| return retrieveProcessInstanceIDsImplementation(getUser(publicKey),
| pdId);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#retrieveProcessInstanceStatus(long)
| */
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public ExecutionSummary retrieveProcessInstanceStatus(long id) {
| return retrieveProcessInstanceStatusImplementation(getUser(), id);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#retrieveProcessInstanceStatusProxy(java.lang.String,
| * long)
| */
| @RolesAllowed( { "PROXY_USER" })
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public ExecutionSummary retrieveProcessInstanceStatusProxy(
| String publicKey, long id) {
| return retrieveProcessInstanceStatusImplementation(getUser(publicKey),
| id);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#retrieveProcessInstanceStatusNoResults(long)
| */
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public ExecutionSummary retrieveProcessInstanceStatusNoResults(long id) {
| return retrieveProcessInstanceStatusNoResultsImplementation(getUser(),
| id);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#retrieveProcessInstanceStatusNoResultsProxy(java.lang.String,
| * long)
| */
| @RolesAllowed( { "PROXY_USER" })
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public ExecutionSummary retrieveProcessInstanceStatusNoResultsProxy(
| String publicKey, long id) {
| return retrieveProcessInstanceStatusNoResultsImplementation(
| getUser(publicKey), id);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#start(long)
| */
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public long start(long id) {
| return startImplementation(getUser(), id);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#startProxy(java.lang.String,
| * long)
| */
| @RolesAllowed( { "PROXY_USER" })
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public long startProxy(String publicKey, long id) {
| return startImplementation(getUser(publicKey), id);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#updateProcessDefinition(long,
| * java.lang.String)
| */
| public long updateProcessDefinition(long id, String definition) {
| return updateProcessDefinitionImplementation(getUser(), id, definition);
| }
|
| /**
| * @see workflow.ejb.client.WorkflowManagerEndpoint#updateProcessDefinitionProxy(java.lang.String,
| * long, java.lang.String)
| */
| @RolesAllowed( { "PROXY_USER" })
| public long updateProcessDefinitionProxy(String publicKey, long id,
| String definition) {
| return updateProcessDefinitionImplementation(getUser(publicKey), id,
| definition);
| }
|
| /**
| * Implementation of copy.
| *
| * @param user
| * the user information
| * @param id
| * the ID of the process definition to copy
| * @return the ID of the new process definition
| */
| private long copyProcessDefinitionImplementation(User user, long id) {
| try {
| ProcessDefinition pd = em.find(ProcessDefinition.class, id);
| return persistProcessDefinitionImplementation(user, pd
| .getDefinition());
| } catch (EntityExistsException e) {
| logger.error("Error copying ProcessDefinition", e);
| throw e;
| } catch (Exception e) {
| logger.error("An error occurred while copying ProcessDefinition.",
| e);
| throw new RuntimeException(
| "An error occurred while copying ProcessDefinition.");
| }
| }
|
| /**
| * @param exId
| * @return String
| */
| private String getResultingParams(long exId) {
| Query query = em.createQuery(
| "SELECT rp.resultingParamsAsXML FROM ResultingParams rp "
| + " WHERE rp.exDetailId =:first ").setHint(
| "org.hibernate.readOnly", Boolean.TRUE);
|
| // get execution detail of previous step.
| query.setParameter("first", exId);
|
| List<?> resultList = query.getResultList();
| String results = "";
| if (resultList != null && resultList.size() != 0) {
| results = (String) resultList.get(0);
| }
| return results;
| }
|
| /**
| * @return the user information from the EJB context
| */
| private User getUser() {
| User user = new User(ctx);
| return user;
| }
|
| /**
| * @param publicKey
| * the public key for the user
| * @return the user information from the authorization system
| */
| private User getUser(String publicKey) {
| if (StringUtils.isBlank(publicKey)) {
| throw new RuntimeException("'publicKey' cannot be null or blank.");
| }
|
| User user = null;
| try {
| user = new User(BlackbookAuthorizationManager
| .getBlackbookPrincipal(publicKey));
| } catch (AuthorizationPluginException e) {
| logger.error("Error retrieving user information.", e);
| throw new RuntimeException("Error retrieving user information.");
| }
| return user;
| }
|
| /**
| * Implementation for persist execution summary.
| *
| * @param user
| * the user information
| * @param executionSummaryCopy
| * the new execution summary
| * @return the newly persisted execution summary
| */
| private ExecutionSummary persistExecutionSummaryImplementation(User user,
| ExecutionSummary executionSummaryCopy) {
| ExecutionSummary executionSummary = new ExecutionSummary();
| executionSummary.setProcessDefinitionId(executionSummaryCopy
| .getProcessDefinitionId());
| executionSummary.setLogin(executionSummaryCopy.getLogin());
| executionSummary.setWhenStarted(executionSummaryCopy.getWhenStarted());
| em.persist(executionSummary);
|
| return executionSummary;
| }
|
| /**
| * Implementation for persist process definition.
| *
| * @param user
| * the user information
| * @param definition
| * the process definition XPDL
| * @return the id of the persisted process definition
| */
| private long persistProcessDefinitionImplementation(User user,
| String definition) {
| ProcessDefinition pd = new ProcessDefinition();
|
| logger.debug("process def is: " + definition);
|
| try {
| pd = ProcessDefinitionDigester.digestPD(definition);
| logger.debug("pd is " + pd);
| List<TransitionReference> trList = pd.getTransitionReferences();
| pd.setTransitionReferences(null);
| StepDefinition startingStepDefinition = pd
| .getStartingStepDefinition();
| pd.setLogin(user.getLogin());
| pd.setStartingStepDefinition(null);
| em.persist(pd);
| pd.setTransitionReferences(trList);
| pd.setStartingStepDefinition(startingStepDefinition);
| em.persist(pd);
| } catch (EntityExistsException e) {
| logger.error("Cannot persist ProcessDefinition, entity exists", e);
| throw e;
| } catch (Exception e) {
| logger.error("An error occurred persisting ProcessDefinition", e);
| throw new RuntimeException(
| "An error occurred persisting ProcessDefinition");
| }
|
| return new Long(pd.getId());
| }
|
| /**
| * Implementation for remove execution.
| *
| * @param user
| * the user information
| * @param id
| * the ID of the exeuction to remove
| */
| private void removeExecutionImplementation(User user, long id) {
| try {
| Query deleteQuery = em
| .createNativeQuery("DELETE FROM RESULTING_PARAMS "
| + " WHERE EX_SUMMARY_ID IN "
| + " (SELECT S.ID FROM EXECUTION_SUMMARY S WHERE S.PD_ID = :first)");
| deleteQuery.setParameter("first", id);
| deleteQuery.executeUpdate();
|
| Query query = em
| .createNativeQuery("DELETE FROM EXECUTION_DETAIL "
| + "WHERE EX_SUMMARY_ID IN (SELECT ID FROM EXECUTION_SUMMARY WHERE PD_ID = :first)");
| query.setParameter("first", id);
| query.executeUpdate();
|
| query = em
| .createNativeQuery("DELETE FROM EXECUTION_SUMMARY WHERE PD_ID = :first ");
| query.setParameter("first", id);
| query.executeUpdate();
|
| } catch (Exception e) {
| logger.error("An error occurred while removing a running process.",
| e);
| throw new RuntimeException(
| "An error occurred while removing a running process.");
| }
| }
|
| /**
| * Implementation for remove process definition.
| *
| * @param user
| * the user information
| * @param id
| * the ID of the process definition to remove
| */
| private void removeProcessDefinitionImplementation(User user, long id) {
| try {
| logger.debug(" removing process definition for " + id);
|
| Query deleteQuery = em
| .createNativeQuery("DELETE FROM RESULTING_PARAMS "
| + " WHERE EX_SUMMARY_ID IN "
| + " (SELECT S.ID FROM EXECUTION_SUMMARY S WHERE S.PD_ID = :first)");
| deleteQuery.setParameter("first", id);
| deleteQuery.executeUpdate();
|
| Query query = em
| .createNativeQuery("DELETE FROM EXECUTION_DETAIL WHERE EX_SUMMARY_ID IN (SELECT ID FROM EXECUTION_SUMMARY WHERE PD_ID = :first)");
| query.setParameter("first", id);
| query.executeUpdate();
|
| query = em
| .createNativeQuery("DELETE FROM EXECUTION_SUMMARY WHERE PD_ID = :first ");
| query.setParameter("first", id);
| query.executeUpdate();
|
| query = em
| .createNativeQuery("DELETE FROM TRANSITION_DEFINITION WHERE TRANSITION_REFERENCE_ID IN (SELECT ID FROM TRANSITION_REFERENCE WHERE PD_ID = :first) ");
| query.setParameter("first", id);
| query.executeUpdate();
|
| query = em
| .createNativeQuery("DELETE FROM TRANSITION_REFERENCE WHERE PD_ID =:first ");
| query.setParameter("first", id);
| query.executeUpdate();
|
| query = em
| .createNativeQuery(" DELETE FROM STATE_DEFINITION WHERE ID IN (SELECT ID FROM STEP_DEFINITION WHERE PD_ID = :first)");
| query.setParameter("first", id);
| query.executeUpdate();
|
| query = em
| .createNativeQuery(" UPDATE PROCESS_DEFINITION set START_STEP_ID = NULL WHERE ID = :first");
| query.setParameter("first", id);
| query.executeUpdate();
|
| query = em
| .createNativeQuery(" DELETE FROM STEP_DEFINITION WHERE PD_ID = :first");
| query.setParameter("first", id);
| query.executeUpdate();
|
| query = em
| .createNativeQuery("DELETE FROM PROCESS_DEFINITION WHERE ID = :first ");
| query.setParameter("first", id);
| query.executeUpdate();
|
| logger.debug(" finishing remove");
|
| } catch (Exception e) {
| logger.error("An error occurred while removing ProcessDefinition.",
| e);
| throw new RuntimeException(
| "An error occurred while removing ProcessDefinition.");
| }
| }
|
| /**
| * Implementation for retrieve process definition.
| *
| * @param user
| * the user information
| * @param id
| * the ID of the process definition being retrieve
| * @return the process definition
| */
| private String retrieveProcessDefinitionImplementation(User user, long id) {
| ProcessDefinition pd = em.find(ProcessDefinition.class, id);
| if (pd == null) {
| return null;
| }
| return pd.getDefinition();
| }
|
| /**
| * Implementation for retrieve most recent process instance ID.
| *
| * @param user
| * the user information
| * @param pdId
| * process definition ID
| * @return ID for the most recently completed process instance ID
| */
| private long retrieveMostRecentProcessInstanceIDImplementation(User user,
| long pdId) {
| Query query = em.createQuery(
| "SELECT e.id from ExecutionSummary e "
| + "WHERE e.processDefinitionId = :pdId "
| + "AND e.whenCompleted is not null "
| + "ORDER BY e.whenCompleted DESC").setHint(
| "org.hibernate.readOnly", Boolean.TRUE);
| query.setParameter("pdId", pdId);
|
| List resultList = query.getResultList();
|
| long id = -1;
| if(resultList != null && resultList.size() > 0)
| {
| id = (Long) resultList.get(0);
| }
|
| return id;
| }
|
| /**
| * Implementation for retrieve process instance IDs.
| *
| * @param user
| * the user information
| * @param pdId
| * the process definition ID
| * @return IDs of all of the process instances related to the specified
| * process definition
| */
| private long[] retrieveProcessInstanceIDsImplementation(User user, long pdId) {
| Query query = em.createQuery(
| "SELECT e.id from ExecutionSummary e "
| + "WHERE e.processDefinitionId = :pdId").setHint(
| "org.hibernate.readOnly", Boolean.TRUE);
| query.setParameter("pdId", pdId);
|
| long[] ids = new long[query.getResultList().size()];
| int i = 0;
| for (Object resultObject : query.getResultList()) {
| long id = (Long) resultObject;
| ids[i++] = id;
| }
|
| return ids;
| }
|
| /**
| * Implementation for retrieve process instance status.
| *
| * @param user
| * the user information
| * @param id
| * the process instance ID
| * @return the execution summary
| */
| private ExecutionSummary retrieveProcessInstanceStatusImplementation(
| User user, long id) {
| logger.debug(" retrieving process instances with id = " + id);
|
| Query queryES = em.createQuery(
| "from ExecutionSummary e WHERE e.id = :first ").setHint(
| "org.hibernate.readOnly", Boolean.TRUE);
| queryES.setParameter("first", id);
|
| ExecutionSummary executionSummary = (ExecutionSummary) queryES
| .getSingleResult();
|
| Query query = em.createQuery(
| "SELECT e.id, s.id from ExecutionDetail e, StateDefinition s "
| + "WHERE e.executionSummaryId = :first "
| + "AND s.id = e.associatedStepId "
| + "AND s.actionMethod is not empty "
| + "AND s.actionMethod is not null "
| + "AND s.actionClass is not empty "
| + "AND e.completed = 1").setHint(
| "org.hibernate.readOnly", Boolean.TRUE);
| query.setParameter("first", id);
|
| List<ExecutionDetail> edList = new ArrayList<ExecutionDetail>();
| for (Object resultList : query.getResultList()) {
| Object[] result = ((Object[]) resultList);
| ExecutionDetail executionDetail = new ExecutionDetail();
| executionDetail.setId((Long) result[0]);
|
| String results = getResultingParams(executionDetail.getId());
| executionDetail.setResultingParams(ParamUtil.paramsAsXML(results,
| true));
| edList.add(executionDetail);
| }
| executionSummary.setExecutionDetails(edList);
| return executionSummary;
| }
|
| /**
| * Implementation for retrieve process instance status without step results.
| *
| * @param user
| * the user information
| * @param id
| * the process instance ID
| * @return the execution summary
| */
| private ExecutionSummary retrieveProcessInstanceStatusNoResultsImplementation(
| User user, long id) {
| logger.debug(" retrieving process instances with id = " + id);
|
| Query queryES = em.createQuery(
| "from ExecutionSummary e WHERE e.id = :first ").setHint(
| "org.hibernate.readOnly", Boolean.TRUE);
| queryES.setParameter("first", id);
|
| ExecutionSummary executionSummary = (ExecutionSummary) queryES
| .getSingleResult();
|
| Query query = em.createQuery(
| "SELECT e.id, s.id from ExecutionDetail e, StateDefinition s "
| + "WHERE e.executionSummaryId = :first "
| + "AND s.id = e.associatedStepId "
| + "AND s.actionMethod is not empty "
| + "AND s.actionMethod is not null "
| + "AND s.actionClass is not empty "
| + "AND e.completed = 1").setHint(
| "org.hibernate.readOnly", Boolean.TRUE);
| query.setParameter("first", id);
|
| List<ExecutionDetail> edList = new ArrayList<ExecutionDetail>();
| for (Object resultList : query.getResultList()) {
| Object[] result = ((Object[]) resultList);
| ExecutionDetail executionDetail = new ExecutionDetail();
| executionDetail.setId((Long) result[0]);
| edList.add(executionDetail);
| }
| executionSummary.setExecutionDetails(edList);
| return executionSummary;
| }
|
| /**
| * Implementation of start.
| *
| * @param user
| * the user information
| * @param id
| * the id of the process definition to start
| * @return the id of the execution summary of the started process
| */
| private long startImplementation(User user, long id) {
| ProcessDefinition pd = em.find(ProcessDefinition.class, id);
| StepDefinition startStep = pd.getStartingStepDefinition();
| if (startStep != null) {
| ExecutionSummary executionSummary = new ExecutionSummary();
| executionSummary.setProcessDefinitionId(pd.getId());
| executionSummary.setLogin(user.getLogin());
| executionSummary.setWhenStarted(new Date());
| executionSummary =
| persistExecutionSummary(executionSummary);
| logger.debug(" start state id is " + startStep.getId());
| WorkflowUtil.sendMessage(queueName, startStep.getId(), getUser(),
| executionSummary.getId());
| return executionSummary.getId();
| }
|
| return -1;
| }
|
| /**
| * Implementation for update process definition.
| *
| * @param user
| * the user information
| * @param id
| * the ID of the process definition
| * @param definition
| * the new process definition XPDL
| * @return the new process definition ID
| */
| private long updateProcessDefinitionImplementation(User user, long id,
| String definition) {
| try {
| removeProcessDefinition(id);
| long newId = persistProcessDefinitionImplementation(user,
| definition);
| return newId;
|
| } catch (EntityExistsException e) {
| logger.error("Error updating ProcessDefinition", e);
| throw e;
| } catch (Exception e) {
| logger.error("Error updating ProcessDefinition.", e);
| throw new RuntimeException("Error updating ProcessDefinition.");
| }
| }
| }
|
|
In addition, the server log *seems* to indicate that it is indeed joining a transaction and making the ejb calls (see log around line 36796 -as before, I have posted a zip of the server.log file at
http://rabasrv.jhuapl.edu/server.log.zip )
What am I missing here? Thanks again for your help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4204358#4204358
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4204358
17 years, 3 months
[Management, JMX/JBoss] - Re: JBoss Logging
by div_gcet1
Here i have some changes to Jboss-service.xml.
<!-- ==================================================================== -->
| <!-- Log4j Initialization -->
| <!-- ==================================================================== -->
|
|
|
| <mbean code="org.jboss.logging.Log4jService"
| name="jboss.system:type=Log4jService,service=Logging"
| xmbean-dd="resource:xmdesc/Log4jService-xmbean.xml">
| <attribute name="ConfigurationURL">resource:d1jboss-log4j.xml</attribute>
| <!-- Set the org.apache.log4j.helpers.LogLog.setQuiteMode. As of log4j1.2.8
| this needs to be set to avoid a possible deadlock on exception at the
| appender level. See bug#696819.
| -->
| <attribute name="Log4jQuietMode">true</attribute>
| <!-- How frequently in seconds the ConfigurationURL is checked for changes -->
| <attribute name="RefreshPeriod">60</attribute>
| <depends>jboss:service=DataSourceBinding</depends>
| </mbean>
|
And on the console error is DataSourceBinding Serveice is
anonymous wrote : YETNOTINSTALLED
while this service is going already.
Where i m lacking
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4204352#4204352
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4204352
17 years, 3 months
[Persistence, JBoss/CMP, Hibernate, Database] - ClassCastException with Oracle 10g
by midvale
Hello:
I need to configure jBoss to use Oracle but I don't want to tie my code to JBoss.
I am getting the following stack trace at this line:
ArrayDescriptor codeNameValueObjectDescriptor = ArrayDescriptor.createDescriptor("NAME_VALUE_OBJ_TAB", conn);
Stack Trace:
java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.WrappedConnection
09:16:44,361 ERROR [STDERR] at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:103)
09:16:44,361 ERROR [STDERR] at survey.db.SurveyDB.callGet_codeRef(SurveyDB.java:1189)
09:16:44,361 ERROR [STDERR] at util.LoadDropdownListener.loadAllCodes(LoadDropdownListener.java:136)
09:16:44,361 ERROR [STDERR] at util.LoadDropdownListener.contextInitialized(LoadDropdownListener.java:78)
09:16:44,361 ERROR [STDERR] at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
09:16:44,361 ERROR [STDERR] at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
09:16:44,361 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
09:16:44,361 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
09:16:44,361 ERROR [STDERR] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
09:16:44,361 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:16:44,361 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
09:16:44,361 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
09:16:44,361 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
09:16:44,361 ERROR [STDERR] at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
09:16:44,361 ERROR [STDERR] at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052)
09:16:44,361 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:16:44,361 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
09:16:44,361 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
09:16:44,361 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
09:16:44,361 ERROR [STDERR] at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
09:16:44,361 ERROR [STDERR] at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297)
09:16:44,361 ERROR [STDERR] at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103)
09:16:44,361 ERROR [STDERR] at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371)
09:16:44,361 ERROR [STDERR] at org.jboss.web.WebModule.startModule(WebModule.java:83)
09:16:44,361 ERROR [STDERR] at org.jboss.web.WebModule.startService(WebModule.java:61)
09:16:44,361 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
09:16:44,361 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
09:16:44,361 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
09:16:44,361 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
09:16:44,361 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
09:16:44,361 ERROR [STDERR] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
09:16:44,361 ERROR [STDERR] at $Proxy0.start(Unknown Source)
09:16:44,361 ERROR [STDERR] at org.jboss.system.ServiceController.start(ServiceController.java:417)
09:16:44,361 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
09:16:44,361 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
09:16:44,361 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
09:16:44,361 ERROR [STDERR] at $Proxy38.start(Unknown Source)
09:16:44,361 ERROR [STDERR] at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
09:16:44,361 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:16:44,361 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
09:16:44,361 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
09:16:44,361 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
09:16:44,361 ERROR [STDERR] at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
09:16:44,361 ERROR [STDERR] at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
09:16:44,361 ERROR [STDERR] at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
09:16:44,361 ERROR [STDERR] at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
09:16:44,361 ERROR [STDERR] at $Proxy39.start(Unknown Source)
09:16:44,361 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
09:16:44,361 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
09:16:44,361 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
09:16:44,361 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
09:16:44,361 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
09:16:44,361 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
09:16:44,361 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
09:16:44,361 ERROR [STDERR] at $Proxy8.deploy(Unknown Source)
09:16:44,361 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
09:16:44,361 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
09:16:44,361 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
09:16:44,377 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
09:16:44,377 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
09:16:44,377 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
09:16:44,377 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:16:44,377 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
09:16:44,377 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
09:16:44,377 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
09:16:44,377 ERROR [STDERR] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
09:16:44,377 ERROR [STDERR] at $Proxy0.start(Unknown Source)
09:16:44,377 ERROR [STDERR] at org.jboss.system.ServiceController.start(ServiceController.java:417)
09:16:44,377 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
09:16:44,377 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
09:16:44,377 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
09:16:44,377 ERROR [STDERR] at $Proxy4.start(Unknown Source)
09:16:44,377 ERROR [STDERR] at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
09:16:44,377 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
09:16:44,377 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
09:16:44,377 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
09:16:44,377 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
09:16:44,377 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:16:44,377 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
09:16:44,377 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
09:16:44,377 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
09:16:44,377 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
09:16:44,377 ERROR [STDERR] at $Proxy5.deploy(Unknown Source)
09:16:44,377 ERROR [STDERR] at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
09:16:44,377 ERROR [STDERR] at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
09:16:44,377 ERROR [STDERR] at org.jboss.Main.boot(Main.java:200)
09:16:44,377 ERROR [STDERR] at org.jboss.Main$1.run(Main.java:490)
09:16:44,377 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
I am trying to run jBoss 4.0.5 for the first time with Oracle 10g. I seem to get the Connection alright:
Context context = new InitialContext();
DataSource pds = null;
pds = (DataSource)context.lookup(name);
context.close();
return pds.getConnection();
I am using ojdbc14dms.jar and dms.jar. Here is my oracle-ds.xml:
<local-tx-datasource>
<jndi-name>GFDataSource</jndi-name>
<connection-url>jdbc:oracle:thin:@someserver:9999:DB</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>username</user-name>
password
<min-pool-size>2</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
</local-tx-datasource>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4204340#4204340
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4204340
17 years, 3 months
[JBoss Messaging] - Re: Messaging gets stuck
by hguser
With the following code messages are sent to a queue (using an Apache connection pool for JMS connections):
| private void sendMessage(MASMessage message, String destinationNameQueue) throws JMSException{
|
| if (connectionFactory != null) {
| QueueSession queueSession = null;
| QueueConnection queueConnection = null;
| try{
| queueConnection = (QueueConnection)queueConnectionPool.borrowObject();
| queueSession = queueConnection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
| QueueSender sender = queueSession.createSender((Queue)getDestination(destinationNameQueue));
| ObjectMessage objectMessage = queueSession.createObjectMessage(message);
|
| sender.send(objectMessage, DeliveryMode.PERSISTENT, 4, 0);
| Log.debug("Message sent of type: " + message.getClass().getName() + " to queue " + destinationNameQueue, JmsUtil.class);
| queueConnection.start();
| queueSession.commit();
| } catch (Exception jmsexc){
| // exception handling
| } finally {
| // ...
| }
| } else {
| // ...
| }
| }
|
A message driven bean acts as listener and receives these messages:
| @MessageDriven(
| name="MCSAccountingMessageBean",
| activationConfig = {
| @ActivationConfigProperty(
| propertyName="destinationType",
| propertyValue="javax.jms.Queue"
| ),
| @ActivationConfigProperty(
| propertyName="sessionTransacted",
| propertyValue="true"
| ),
| @ActivationConfigProperty(
| propertyName="providerAdapterJNDI",
| propertyValue="java:/JMSSecureProvider"
| )
| /* see additional dynamic properties in deployment descriptor */
| }
| )
| public class MCSAccountingMessageBean implements MessageListener {
|
| public void onMessage(Message message) {
| Log.debug("Received message of type: " + message.getClass().getName() + " at " + new Date(), MCSAccountingMessageBean.class);
| if (message instanceof ObjectMessage) {
| ObjectMessage om = (ObjectMessage) message;
| if (om != null) {
| try {
| if (om.getObject() instanceof MASWalletTransactionMessage) {
| MASWalletTransactionMessage transactionMessage = (MASWalletTransactionMessage) om.getObject();
| // dispatch message now
| }else{
| Log.error("Cannot process object message with object of unexpected type: " + om.getObject().getClass().getName(), MCSAccountingMessageBean.class);
| }
| } catch (JMSException e) {
| Log.error("Cannot receive JMS message: \n" + e.toString(), MCSAccountingMessageBean.class);
| throw new RuntimeException("Unable to receive or process wallet transaction message!");
| }
| }
| } else {
| Log.error("Cannot process message of unexpected type: " + message.getClass().getName(), MCSAccountingMessageBean.class);
| }
| Log.debug("Finished processing message at " + new Date(), MCSAccountingMessageBean.class);
| }
| }
|
After starting both application servers sending and receiving messages works fine for a while. After several hours of service the MDB stops receiving messages. We can see the messages in the messaging tables JBM_MSG and JBM_MSG_REF of the database (hence sending works), but the MDB shows no reaction. No error messages in the log files on both sides. We must stop and restart the MDB using JMX console. Sometimes we must restart the queue in order to get messaging working.
Hope to be more clearly now.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4204336#4204336
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4204336
17 years, 3 months