ClassNotFoundException on utility class in JTA Transaction

When using user defined transactions, I am finding I get odd
          ClassNotFoundExceptions. I've tested this primarily on NT/2000, but did
          also confirm it on Solaris. Can anyone explain it?
          The exception only seems to occur if it becomes necessary to throw an
          exception from the EJB. If I am not inside a user defined transaction,
          there are no problems. (Even if the method is marked as Transacation
          Required). Similarly, if no exception is thrown, there is also no problem
          (even though I use plenty of other utility classes)
          The classes (including the utility class) are all in my deployed jar file
          (which is deployed as part of an ear file).
          The error message is below:
          java.lang.ClassNotFoundException:
          com.iknowledge.inext.exception.STInvalidNameException
          at
          weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.
          java:178)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:195)
          at
          weblogic.j2ee.ApplicationManager.loadFromNetwork(ApplicationManager.java:248
          at
          weblogic.j2ee.ApplicationManager.loadClass(ApplicationManager.java:175)
          at
          weblogic.rjvm.MsgAbbrevInputStream.readClassDescriptor(MsgAbbrevInputStream.
          java:211)
          at
          weblogic.common.internal.ChunkedObjectInputStream$NestedObjectInputStream.re
          adClassDescriptor(ChunkedObjectInputStream.java:290)
          at
          java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:906)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
          at
          java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1186)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
          at
          java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2263)
          at
          java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:519)
          at
          java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1412)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
          at
          weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectIn
          putStream.java:107)
          at
          weblogic.transaction.internal.PropagationContext.readExternal(PropagationCon
          text.java:304)
          at
          weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectIn
          putStream.java:97)
          at
          weblogic.common.internal.ChunkedObjectInputStream.readObjectWL(ChunkedObject
          InputStream.java:123)
          at
          weblogic.rjvm.MsgAbbrevInputStream.readTxContext(MsgAbbrevInputStream.java:1
          66)
          at
          weblogic.rjvm.MsgAbbrevInputStream.readMessageContext(MsgAbbrevInputStream.j
          ava:156)
          at
          weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:581)
          at
          weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:454)
          at
          weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:638)
          at
          weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
          at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
          at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
          

You closed your Main class with a bracket, so your getConnection() method isn't in a class
public class Main {
    /** Creates a new instance of Main */
    public Main() {
    public static void main(String[] args) {
        Connection con = getConnection();
        System.out.println("The connection is: " +con );
}That is your entire Main class. Anything below it isn't in the class.

Similar Messages

  • Can I create a JTA EntityManagerFactory in a utility class in a .jar file?

    I have utility classes in a .jar file inside of a .war file deployed in Glassfish 3.1. One of these utility classes, CredentialsUtil, needs to access a database. I can't inject an EntityManager into CredentialsUtil since it is not an EJB. (For security reasons I don't want to make CredentialsUtil an EJB. I want it to be a POJO.)
    In CredentialsUtil I need an EntityManagerFactory that is connected to a datasource defined in Glassfish. Here is the line from CredentialsUtil.java and from the persistence.xml both of which will be in the util.jar file:
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("Credpu");
    <persistence-unit name="Credpu" transaction-type="JTA">
    I can't use RESOURCE_LOCAL since any changes to the datasource configuration must be done in Glassfish rather than changing persistence.xml.
    (The transaction context is not important in CredentialsUtil. It will be called by a WS-Security handler which may not have a transaction context.)
    Can I put the persistence.xml and the CredentialsUtil class that creates the EntityManagerFactory from it inside of the util.jar file (which will be in a .war), or do I have to move the class and a copy of the persistence.xml file out to the .war file? (I'll have to leave persistence.xml in the .jar file too since there are some @Entity in the .jar file. I don't know why but there are @Entity pojos in the .jar file.)
    I'd like to use the existing persistence.xml, but if I can't is there is a way to create an EntityManagerFactory (or EntityManager) that gets its datasource directly from Glassfish, ignoring persistence.xml?
    Thanks.

    Styles in Pages are saved in the documents (or templates). There is no easy method for adding a style to a built-in template (and it is strongly recommended that you do not tamper with them). You can open a built- in template, add your style and save it as a user template so that your new style will be standard in documents created from that template.

  • Error handling via CatchAll and JTA transaction error.

    Hi
    soa 10.1.3.5.0
    I have created a test BPEL process where i am updating already completed Human task. I know it's wrong and i am doing it purposely to test error handling mechanism.
    In the same BPEL I added a Catch all handler hoping that this will catch the error and will let me complete the process.
    However BPEL is failing in the Catch All scope with lovely error: JTA transaction is not present or the transaction is not in active state.
    Does anybody know how and why humantask update activity suddenly changes jta transaction state? Any thoughts of how i can catch the error in the situation i described and process it gracefully?
    Thanks for your help!
    piece from domain.log starting from the place where task service failing to update already completed human task.
    <2013-10-10 17:01:00,520> <ERROR> <services.collaxa.cube.services> <*::*> Invalid action on workflow task.
    <2013-10-10 17:01:00,520> <ERROR> <services.collaxa.cube.services> <*::*> Action OUTCOME_UPDATE on task 11d1def534ea1be0:65540537:141a4173a84:-7fa1 is not valid because of .
    <2013-10-10 17:01:00,520> <ERROR> <services.collaxa.cube.services> <*::*> Contact oracle support if error is not fixable.
    <2013-10-10 17:01:00,520> <ERROR> <services.collaxa.cube.services> <*::*>
    <2013-10-10 17:01:00,520> <ERROR> <services.collaxa.cube.services> <*::*>     at oracle.bpel.services.workflow.task.impl.TaskService.performPreActionValidation(TaskService.java:3600)
    <2013-10-10 17:01:00,520> <ERROR> <services.collaxa.cube.services> <*::*>     at oracle.bpel.services.workflow.task.impl.TaskService.performPreActionValidation(TaskService.java:3557)
    <2013-10-10 17:01:00,521> <ERROR> <services.collaxa.cube.services> <*::*>     at oracle.bpel.services.workflow.task.impl.TaskService.updateTaskOutcomeAndEvaluateRoutingSlip(TaskService.java:1139)
    <2013-10-10 17:01:00,521> <ERROR> <services.collaxa.cube.services> <*::*>     at oracle.bpel.services.workflow.task.impl.TaskService.updateTaskOutcome(TaskService.java:1006)
    <2013-10-10 17:01:00,521> <ERROR> <services.collaxa.cube.services> <*::*>     at oracle.bpel.services.workflow.task.impl.TaskService.updateTaskOutcome(TaskService.java:985)
    <2013-10-10 17:01:00,521> <ERROR> <services.collaxa.cube.services> <*::*>     at oracle.bpel.services.workflow.task.ejb.TaskServiceBean.updateTaskOutcome(TaskServiceBean.java:409)
    <2013-10-10 17:01:00,521> <ERROR> <services.collaxa.cube.services> <*::*>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    <2013-10-10 17:01:00,521> <ERROR> <services.collaxa.cube.services> <*::*>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    <2013-10-10 17:01:00,521> <ERROR> <services.collaxa.cube.services> <*::*>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    <2013-10-10 17:01:00,521> <ERROR> <services.collaxa.cube.services> <*::*>     at java.lang.reflect.Method.invoke(Method.java:597)
    <2013-10-10 17:01:00,521> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
    <2013-10-10 17:01:00,521> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    <2013-10-10 17:01:00,521> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    <2013-10-10 17:01:00,521> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    <2013-10-10 17:01:00,522> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
    <2013-10-10 17:01:00,522> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ThreadState.runAs(ThreadState.java:705)
    <2013-10-10 17:01:00,522> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
    <2013-10-10 17:01:00,522> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    <2013-10-10 17:01:00,522> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
    <2013-10-10 17:01:00,522> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    <2013-10-10 17:01:00,522> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    <2013-10-10 17:01:00,522> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    <2013-10-10 17:01:00,522> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
    <2013-10-10 17:01:00,522> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
    <2013-10-10 17:01:00,523> <ERROR> <services.collaxa.cube.services> <*::*>     at TaskServiceBean_LocalProxy_68d4144.updateTaskOutcome(Unknown Source)
    <2013-10-10 17:01:00,523> <ERROR> <services.collaxa.cube.services> <*::*>     at oracle.bpel.services.workflow.task.client.TaskServiceLocalClient.updateTaskOutcome(TaskServiceLocalClient.java:678)
    <2013-10-10 17:01:00,523> <ERROR> <services.collaxa.cube.services> <*::*>     at oracle.bpel.services.workflow.task.impl.TaskServiceWSIF.updateTaskOutcome(TaskServiceWSIF.java:580)
    <2013-10-10 17:01:00,523> <ERROR> <services.collaxa.cube.services> <*::*>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    <2013-10-10 17:01:00,523> <ERROR> <services.collaxa.cube.services> <*::*>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    <2013-10-10 17:01:00,523> <ERROR> <services.collaxa.cube.services> <*::*>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    <2013-10-10 17:01:00,523> <ERROR> <services.collaxa.cube.services> <*::*>     at java.lang.reflect.Method.invoke(Method.java:597)
    <2013-10-10 17:01:00,523> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.ws.wsif.providers.java.WSIFOperation_Java.executeRequestResponseOperation(WSIFOperation_Java.java:1019)
    <2013-10-10 17:01:00,523> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.ws.WSIFInvocationHandler.invoke(WSIFInvocationHandler.java:480)
    <2013-10-10 17:01:00,523> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.ws.WSInvocationManager.invoke2(WSInvocationManager.java:538)
    <2013-10-10 17:01:00,523> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.ws.WSInvocationManager.invoke(WSInvocationManager.java:286)
    <2013-10-10 17:01:00,523> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.engine.ext.wmp.BPELInvokeWMP.__invoke(BPELInvokeWMP.java:832)
    <2013-10-10 17:01:00,523> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.engine.ext.wmp.BPELInvokeWMP.__executeStatements(BPELInvokeWMP.java:413)
    <2013-10-10 17:01:00,523> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:200)
    <2013-10-10 17:01:00,524> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:4326)
    <2013-10-10 17:01:00,524> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1839)
    <2013-10-10 17:01:00,524> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:77)
    <2013-10-10 17:01:00,524> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:240)
    <2013-10-10 17:01:00,524> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:345)
    <2013-10-10 17:01:00,524> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:6460)
    <2013-10-10 17:01:00,524> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.engine.CubeEngine.expireActivity(CubeEngine.java:2267)
    <2013-10-10 17:01:00,524> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.ejb.impl.ActivityManagerBean.expireActivity(ActivityManagerBean.java:185)
    <2013-10-10 17:01:00,524> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.ejb.impl.ActivityManagerBean.expireActivity(ActivityManagerBean.java:156)
    <2013-10-10 17:01:00,524> <ERROR> <services.collaxa.cube.services> <*::*>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    <2013-10-10 17:01:00,524> <ERROR> <services.collaxa.cube.services> <*::*>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    <2013-10-10 17:01:00,525> <ERROR> <services.collaxa.cube.services> <*::*>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    <2013-10-10 17:01:00,525> <ERROR> <services.collaxa.cube.services> <*::*>     at java.lang.reflect.Method.invoke(Method.java:597)
    <2013-10-10 17:01:00,525> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
    <2013-10-10 17:01:00,525> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    <2013-10-10 17:01:00,525> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    <2013-10-10 17:01:00,525> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    <2013-10-10 17:01:00,525> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
    <2013-10-10 17:01:00,525> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ThreadState.runAs(ThreadState.java:705)
    <2013-10-10 17:01:00,525> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
    <2013-10-10 17:01:00,525> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    <2013-10-10 17:01:00,525> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
    <2013-10-10 17:01:00,525> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    <2013-10-10 17:01:00,525> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    <2013-10-10 17:01:00,525> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    <2013-10-10 17:01:00,526> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
    <2013-10-10 17:01:00,526> <ERROR> <services.collaxa.cube.services> <*::*>     at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
    <2013-10-10 17:01:00,526> <ERROR> <services.collaxa.cube.services> <*::*>     at ActivityManagerBean_LocalProxy_4bin6i8.expireActivity(Unknown Source)
    <2013-10-10 17:01:00,526> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.engine.dispatch.message.instance.ExpirationMessageHandler.handle(ExpirationMessageHandler.java:43)
    <2013-10-10 17:01:00,526> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:150)
    <2013-10-10 17:01:00,526> <ERROR> <services.collaxa.cube.services> <*::*>     at com.collaxa.cube.engine.dispatch.BaseDispatchTask.run(BaseDispatchTask.java:58)
    <2013-10-10 17:01:00,526> <ERROR> <services.collaxa.cube.services> <*::*>     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    <2013-10-10 17:01:00,526> <ERROR> <services.collaxa.cube.services> <*::*>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    <2013-10-10 17:01:00,526> <ERROR> <services.collaxa.cube.services> <*::*>     at java.lang.Thread.run(Thread.java:662)
    <2013-10-10 17:01:00,526> <ERROR> <services.collaxa.cube.services> <*::*> Caused by: ORABPEL-30036
    <2013-10-10 17:01:00,526> <ERROR> <services.collaxa.cube.services> <*::*>
    <2013-10-10 17:01:00,526> <ERROR> <services.collaxa.cube.services> <*::*> Invalid action on workflow task.
    <2013-10-10 17:01:00,526> <ERROR> <services.collaxa.cube.services> <*::*> Action OUTCOME_UPDATE on task 11d1def534ea1be0:65540537:141a4173a84:-7fa1 is not valid because of The task has been completed..
    <2013-10-10 17:01:00,527> <ERROR> <services.collaxa.cube.services> <*::*> Contact oracle support if error is not fixable.
    <2013-10-10 17:01:00,527> <ERROR> <services.collaxa.cube.services> <*::*>
    <2013-10-10 17:01:00,527> <ERROR> <services.collaxa.cube.services> <*::*>     at oracle.bpel.services.workflow.task.impl.TaskService.performPreActionValidation(TaskService.java:3592)
    <2013-10-10 17:01:00,527> <ERROR> <services.collaxa.cube.services> <*::*>     ... 71 more
    <2013-10-10 17:01:00,562> <ERROR> <services.collaxa.cube.engine> The execution of this instance "390003" for process "MY_BPEL_PROCESS" is supposed to be in a jta transaction, but the transaction is not present or in active state, please turn on the application server transaction debug logs to get more information.
    <2013-10-10 17:01:00,571> <WARN> <services.collaxa.cube> <BaseCubeSessionBean::logError> Error while invoking bean "activity manager": Failed due to unhandled bpel fault.
    <2013-10-10 17:01:00,584> <ERROR> <services.collaxa.cube.engine.dispatch> <DispatchHelper::handleMessage> failed to handle message
    ORABPEL-02182
    JTA transaction is not present or the transaction is not in active state.
    The current JTA transaction is not present or it is not in active state when processing activity or instance "390,003". The reason is The execution of this instance "390003" for process "MY_BPEL_PROCESS" is supposed to be in a jta transaction, but the transaction is not present or in active state, please turn on the application server transaction debug logs to get more information..
    Please consult your administrator regarding this error.
        at com.collaxa.cube.engine.CubeEngine.store(CubeEngine.java:6176)
        at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:6482)
        at com.collaxa.cube.engine.CubeEngine.expireActivity(CubeEngine.java:2267)
        at com.collaxa.cube.ejb.impl.ActivityManagerBean.expireActivity(ActivityManagerBean.java:185)
        at com.collaxa.cube.ejb.impl.ActivityManagerBean.expireActivity(ActivityManagerBean.java:156)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
        at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
        at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
        at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
        at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
        at com.evermind.server.ThreadState.runAs(ThreadState.java:705)
        at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
        at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
        at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
        at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
        at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
        at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
        at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
        at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
        at ActivityManagerBean_LocalProxy_4bin6i8.expireActivity(Unknown Source)
        at com.collaxa.cube.engine.dispatch.message.instance.ExpirationMessageHandler.handle(ExpirationMessageHandler.java:43)
        at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:150)
        at com.collaxa.cube.engine.dispatch.BaseDispatchTask.run(BaseDispatchTask.java:58)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
    <2013-10-10 17:01:00,585> <ERROR> <services.collaxa.cube.engine.dispatch> <DispatchHelper::handleMessage> Not fatal connection error ... not retrying: class com.collaxa.cube.engine.UnhandledFaultException: Failed due to unhandled bpel fault.
    <2013-10-10 17:01:00,593> <ERROR> <services.collaxa.cube.engine.dispatch> <BaseDispatchTask::run> Failed to handle dispatch message ... exception ORABPEL-05002
    Message handle error.
    An exception occurred while attempting to process the message "com.collaxa.cube.engine.dispatch.message.instance.ExpirationMessage"; the exception is: JTA transaction is not present or the transaction is not in active state.
    The current JTA transaction is not present or it is not in active state when processing activity or instance "390,003". The reason is The execution of this instance "390003" for process "MY_BPEL_PROCESS" is supposed to be in a jta transaction, but the transaction is not present or in active state, please turn on the application server transaction debug logs to get more information..
    Please consult your administrator regarding this error.
    ORABPEL-05002
    Message handle error.
    An exception occurred while attempting to process the message "com.collaxa.cube.engine.dispatch.message.instance.ExpirationMessage"; the exception is: JTA transaction is not present or the transaction is not in active state.
    The current JTA transaction is not present or it is not in active state when processing activity or instance "390,003". The reason is The execution of this instance "390003" for process "MY_BPEL_PROCESS" is supposed to be in a jta transaction, but the transaction is not present or in active state, please turn on the application server transaction debug logs to get more information..
    Please consult your administrator regarding this error.
        at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:226)
        at com.collaxa.cube.engine.dispatch.BaseDispatchTask.run(BaseDispatchTask.java:58)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

    If you look at the error, it suggests that the action you are performing is invalid.That is you cannot update human task which has been already completed. Thats why you are getting that "JTA transaction not active error". Since your human task has already been completed, it is not able to update it again.
    <2013-10-10 17:01:00,526> <ERROR> <services.collaxa.cube.services> <*::*> Caused by: ORABPEL-30036
    <2013-10-10 17:01:00,526> <ERROR> <services.collaxa.cube.services> <*::*>
    <2013-10-10 17:01:00,526> <ERROR> <services.collaxa.cube.services> <*::*> Invalid action on workflow task.
    <2013-10-10 17:01:00,526> <ERROR> <services.collaxa.cube.services> <*::*> Action OUTCOME_UPDATE on task 11d1def534ea1be0:65540537:141a4173a84:-7fa1 is not valid because of The task has been completed..
    <2013-10-10 17:01:00,527> <ERROR> <services.collaxa.cube.services> <*::*> Contact oracle support if error is not fixable.
    <2013-10-10 17:01:00,527> <ERROR> <services.collaxa.cube.services> <*::*>
    May be you can try some other usecase ? Also could you let me know whether you are getting this error in logs only or in your composite instance as well. I mean whether the instance gets successfully terminated or completed ??
    Regards,
    Karan

  • This resource participates in a JTA transaction

    Hi ,everybody,please help me  solve the following  question:
    com.sap.engine.services.dbpool.exceptions.BaseSQLException: Cannot commit JDBC transaction from this connection of "mysqlds" DataSource. This resource participates in a JTA transaction.
    Thank you!

    Hi,Isaias Cristian Barroso.Thank you for your answer,These are my codes in the EJB in the follow.Please help me,Thank you!
    public class DBConnection {
         private static final String DATABASE_JNDI_PROVIDER = "com.sap.engine.services.jndi.InitialContextFactoryImpl";
         public static Connection getConnection() throws Exception {
              try {
                   Connection conn = null;
                   java.util.Properties properties = null;
                   properties = new java.util.Properties();
                   properties.put(Context.INITIAL_CONTEXT_FACTORY,
                             DATABASE_JNDI_PROVIDER);
                   InitialContext jndiCntx = new InitialContext(properties);
                   DataSource ds = (DataSource) jndiCntx.lookup("jdbc/mysqlAS");
                   conn = ds.getConnection();
                   return conn;
              } catch (Exception e) {
                   e.printStackTrace();
    Session Bean implementation class PersonManager
    @WebService(endpointInterface="com.thitech.personmanager.PersonManagerRemote", portName="PersonManagerPort", serviceName="PersonManagerService",
    targetNamespace="http://thitech.com/personmanager/")
    @Stateless
    public class PersonManager implements PersonManagerRemote, PersonManagerLocal {
    Default constructor.
         public PersonManager() {
              // TODO Auto-generated constructor stub
            @Override
         public String insertPerson(int personId, String name, String ***, int age,
                   String email, String address) {
              PersonInfo pi = new PersonInfo();
              ArrayList list = new ArrayList();
              PreparedStatement pstm = null;
              Connection conn =null;
              String returnType=null;
              try {
                   conn = DBConnection.getConnection();
                   conn.setAutoCommit(false);
                   String sql = "insert into personinfo values(?,?,?,?,?,?)";
                   pstm=conn.prepareStatement(sql);
                   pstm.setInt(1, personId);
                   pstm.setString(2, name);
                   pstm.setString(3, ***);
                   pstm.setInt(4, age);
                   pstm.setString(5, email);
                   pstm.setString(6, address);
                   pstm.executeUpdate();
                   conn.commit();
                            returnType="success";
              } catch (Exception e) {
                   e.printStackTrace();
              } finally {
                   if (pstm != null) {
                        try {
                             pstm.close();
                        } catch (SQLException e) {
                             e.printStackTrace();
                        DBConnection.closeConnection(conn);
              return returnType;
    Best regards

  • Doubts on nonxa oracle datasources in Weblogic JTA transaction

    I am doing some studying on XA transaction handling in weblogic 10.3.6. I read a lot materials on web saying that can't enlist more than 1 non xa datasources inside one single XA transaction, so I am doing a simple test: trying to update one record in one oracle database, and inserting one record in another.
    The test code is below:
    @Stateless(mappedName = "nativeQueryTest")
    @TransactionManagement(TransactionManagementType.CONTAINER)
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public class DaoEjb implements .... {
         @PersistenceContext(unitName="nonxa.unit")
         private EntityManager nonXAPC;
         @PersistenceContext(unitName="another.nonxa.unit")
         private EntityManager anotherNonXAPC;
         @Override
         public void doUpdateWithNonXaDss() {
              Employee l_entity = nonXAPC.find(Employee.class, "tom");
              l_entity.setAge(new Random().nextInt());
              Department l_dep = new Department();
              l_dep.setName("dept" + new Random().nextInt());
              l_dep.setEmployeeNum(new Random().nextInt());
              anotherNonXAPC.persist(l_dep);
    The persistence unit definitions are:
         <persistence-unit name="nonxa.unit" transaction-type="JTA">
              <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
              <jta-data-source>nonxa.ds</jta-data-source>
              <class>entity.Employee</class>
              <exclude-unlisted-classes>true</exclude-unlisted-classes>
              <properties>
                   <property name="eclipselink.target-database" value="Oracle" />
    <property name="eclipselink.jdbc.batch-writing" value="Oracle-JDBC" />
    <property name="eclipselink.target-server" value="WebLogic_10" />
                   <property name="eclipselink.logging.parameters" value="true" />
                   <property name="eclipselink.logging.logger" value="ServerLogger" />
              </properties>
         </persistence-unit>
         <persistence-unit name="another.nonxa.unit" transaction-type="JTA">
              <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
              <jta-data-source>another.nonxa.ds</jta-data-source>
              <class>entity.Department</class>
              <exclude-unlisted-classes>true</exclude-unlisted-classes>
              <properties>
                   <property name="eclipselink.target-database" value="Oracle" />
                   <property name="eclipselink.jdbc.batch-writing" value="Oracle-JDBC" />
                   <property name="eclipselink.target-server" value="WebLogic_10" />
                   <property name="eclipselink.logging.parameters" value="true" />
                   <property name="eclipselink.logging.logger" value="ServerLogger" />
              </properties>
         </persistence-unit>
    For the two data sources, they are pointed to two different oracle databases on two different physical servers. I use "oracle.jdbc.OracleDriver" as the drivers, and also make sure that "Support Global Transaction" options un-selected.
    I used a simple client to invoke the EJB, and saw the method completes without any error: the first record is updated and second record is inserted! Therefore I am really confused:
    1) is the JTA transaction XA or not in my small EJB?
    2) if it's XA, why can I use two non-XA datasources inside this XA transaction?

    Why do you think this should fail? Looks to me like you have two isolated transactions going on that have no relation to each other.

  • How to have the JTA transaction in ServiceEndpoint interface java method

    Hi,
    I have query how to have the JTA transaction in SEI(Service endpoint interface) generated by WSDL.
    I have a MDMListener (using MDM API) which looks for a recordchange in MDM repository which needs to be send to PI7.1 via soap request.
    1) I had imported the WSDL from ESR(PI) and generated outside-in proxy.
    2) Created ejb3.0 stateless session bean using NWDS
    3) Created web service client application by generating the WSDL again (by Generate client)
    4)Added a method callPI()with Service and i set the context with endpointaddress property as the soap location of the sender agreement configured in PI7.1.
    The damean thread listener(EventDispatcher) looks for MDM record change and it calls the method callPI() from ejbsession bean by lookup to transfer the record to PI7.1 system via webservices(web method). I hit the below error.
    Exception com.sap.engine.services.ts.exceptions.BaseIllegalStateException: Status of ( SAP J2EE Engine JTA Transaction : 06223ffffffa20048fffffffe ) should be active, but it is STATUS_COMMITTED = 3.
    at com.sap.engine.services.ts.jta.impl.TransactionImpl.registerSynchronizationWithoutStatusChecks(TransactionImpl.java:672)
    at com.sap.engine.services.ts.jta.impl.TransactionImpl.registerSynchronization(TransactionImpl.java:641)
    at com.sap.engine.services.ts.transaction.TxLevelSynchronizations.addSynchronization(TxLevelSynchronizations.java:118)
    at com.sap.engine.services.ts.transaction.TxManagerImpl.registerSynchronization(TxManagerImpl.java:829)
    at com.sap.transaction.TxManager.registerSynchronization(TxManager.java:303)
    at com.sap.engine.messaging.runtime.j2ee.sapengine.SAPTransactionManager.registerSynchronization(SAPTransactionManager.java:126)
    at com.sap.engine.messaging.impl.util.tx.TxController.<init>(TxController.java:83)
    //Method in the ejb stateless session bean
    @WebServiceRef (name="DistributeMasterDataService") DistributeMasterDataService service;
    @RelMessagingNW05DTOperation(enableWSRM=true)
    public void callPi(DistributeMasterDataRequestType req) {
    port.distributeMasterDataOutA(req);// the distributeMasterDataOutA is the method available in SEI..Here is the issue on JTA
    For the first time the message(req object)transmits to the PI successfully,but for the second call i hit this JTA Transaction :status should be active, but it is STATUS_COMMITTED = 3.
    I tried chanding the transactionmanagement from container to bean.
    @TransactionManagement(value=TransactionManagementType.BEAN)
    @TransactionAttribute(value=TransactionAttributeType.REQUIRES_NEW)
    I wanted to know how can i have the JTA transaction status in SEI(service enpoint interface)java method distributeMasterDataOutA.Since it is an interface i dont know what annotation can be used.
    If its possible i can try this UserTransaction,
    http://help.sap.com/saphelp_nw04/helpdata/de/f6/7a8df922db4ab79342b46c48dac7d0/content.htm
    ut.begin() & ut.commit(),so that everytime this method is called it will treat as a new transaction..
    Let me know if you need more details??,Any idea provided would be great.
    Thanks
    Sabarinathan

    Hello everybody,
    The issue resolved,we need to have the bean management transaction type and not the container.
    and the transactionattribute value as Requires New
    rgds
    Sabarinathan
    Edited by: Sabarinathan Selvaraj on May 12, 2009 2:17 PM

  • Classnotfoundexception eventhough the class is inside jar

    Hi guys,
    I encountered weird problem where sometimes it throws classnotfoundexception eventhough the class is inside jar. I terminate the program and start it again then it works fine. I compiled the jar using ant
         <target name="compile" depends="clean" description="">
               <echo message="using java version    : ${java.version}"/>
               <echo message="using ant.java.version: ${ant.java.version}" />          
                 <javac srcdir="${src.dir}"
                        destdir="${build.dir}"
                        debug="on"
                        source="1.5"
                              excludes="com/csg/cs/mud/junit/*"
                 />
                <jar destfile="${mmd.jar}"
                     basedir="${build.dir}"
                     excludes="org/css/cs/mmd/juni*,org/css/cs/mmd/utility/MDDClient.class"
                />          
         </target> it shows :
    *[echo] using java version : 1.5.0_04*
    *[echo] using ant.java.version: 1.5*
    and I deployed this jar to sun solaris (SunOS sg123-456 5.8 Generic_117350-44 sun4u sparc SUNW,Ultra-80) and sun solaris box is using jre1.5.0_06.
    Appreciate any advice please. thanks in advance!
    Cheers,
    Mark
    Edited by: kmthien on Aug 2, 2010 3:05 AM

    Is it public?
    Is it spelt correctly, and the same, in the jar file and the code?
    Is it in its correct package in the jar file?
    Why are you excluding a class from the jar file?

  • Referencing utility classes from a war file

    How do you reference a utility class from a war file? I tried adding the class to the deployment plan descriptor, however I still get a ClassNotFoundException.
    Thanks,
    Will

    To use the utility classes from a war you have to place them under the web-inf/classes directory.
    webApplication(WAR directory)--->WEB-INF--> classes (put your utility classes in this directory)

  • JTA Transaction :status should be active, but it is STATUS_COMMITTED = 3

    Hi,
    I have query how to have the JTA transaction in SEI(Service endpoint interface) generated by WSDL.
    I have a MDMListener (using MDM API) which looks for a recordchange in MDM repository which needs to be send to PI7.1 via soap request.
    1) I had imported the WSDL from ESR(PI) and generated outside-in proxy.
    2) Created ejb3.0 stateless session bean using NWDS
    3) Created web service client application by generating the WSDL again (by Generate client)
    4)Added a method callPI()with Service and i set the context with endpointaddress property as the soap location of the sender agreement configured in PI7.1.
    The damean thread listener(EventDispatcher) looks for MDM record change and it calls the method callPI() from ejbsession bean by lookup to transfer the record to PI7.1 system via webservices(web method). I hit the below error.
    Exception com.sap.engine.services.ts.exceptions.BaseIllegalStateException: Status of ( SAP J2EE Engine JTA Transaction : 06223ffffffa20048fffffffe ) should be active, but it is STATUS_COMMITTED = 3.
    at com.sap.engine.services.ts.jta.impl.TransactionImpl.registerSynchronizationWithoutStatusChecks(TransactionImpl.java:672)
    at com.sap.engine.services.ts.jta.impl.TransactionImpl.registerSynchronization(TransactionImpl.java:641)
    at com.sap.engine.services.ts.transaction.TxLevelSynchronizations.addSynchronization(TxLevelSynchronizations.java:118)
    at com.sap.engine.services.ts.transaction.TxManagerImpl.registerSynchronization(TxManagerImpl.java:829)
    at com.sap.transaction.TxManager.registerSynchronization(TxManager.java:303)
    at com.sap.engine.messaging.runtime.j2ee.sapengine.SAPTransactionManager.registerSynchronization(SAPTransactionManager.java:126)
    at com.sap.engine.messaging.impl.util.tx.TxController.<init>(TxController.java:83)
    //Method in the ejb stateless session bean
    @WebServiceRef (name="DistributeMasterDataService") DistributeMasterDataService service;
    @RelMessagingNW05DTOperation(enableWSRM=true)
    public void callPi(DistributeMasterDataRequestType req) {
    port.distributeMasterDataOutA(req);// the distributeMasterDataOutA is the method available in SEI..Here is the issue on JTA
    For the first time the message(req object)transmits to the PI successfully,but for the second call i hit this JTA Transaction :status should be active, but it is STATUS_COMMITTED = 3.
    I tried chanding the transactionmanagement from container to bean.
    @TransactionManagement(value=TransactionManagementType.BEAN)
    @TransactionAttribute(value=TransactionAttributeType.REQUIRES_NEW)
    I wanted to know how can i have the JTA transaction status in SEI(service enpoint interface)java method distributeMasterDataOutA.Since it is an interface i dont know what annotation can be used.
    If its possible i can try this UserTransaction,
    http://help.sap.com/saphelp_nw04/helpdata/de/f6/7a8df922db4ab79342b46c48dac7d0/content.htm
    ut.begin() & ut.commit(),so that everytime this method is called it will treat as a new transaction..
    Let me know if you need more details??,Any idea provided would be great.
    Thanks
    Sabarinathan
    Edited by: Sabarinathan Selvaraj on May 7, 2009 12:31 PM
    Edited by: Sabarinathan Selvaraj on May 7, 2009 12:32 PM

    Hi,
    May be i have not mention the issue clearly.Let me know mention the issue with details.
    I have a MDMListener (using MDMPI) which looks for a  recordchange in MDM repository which needs to be send to PI7.1 via soap request.
    1) I had imported the WSDL from ESR(PI) and generated outside-in proxy.
    2) Created ejb3.0 stateless session bean using NWDS
    3) Created web service client application by generating the WSDL again (by Generate client)
    4)Added a method callPI()with Service and  i set the context with endpointaddress property as the soap location of the sender agreement configured in PI7.1.
    @WebServiceRef (name="DistributeMasterDataService") DistributeMasterDataService service;
         @RelMessagingNW05DTOperation(enableWSRM=true)     
         public void callPi(DistributeMasterDataRequestType req) {
    port.distributeMasterDataOutA(req);// the distributeMasterDataOutA is a method available in SEI
    For the first time the message(req object)transmits to the PI successfully,but for the second call i hit this JTA Transaction :status should be active, but it is STATUS_COMMITTED = 3.
    I tried chanding the transactionmanagement from container to bean.
    @TransactionManagement(value=TransactionManagementType.BEAN)
    @TransactionAttribute(value=TransactionAttributeType.REQUIRES_NEW)
    I wanted to know how can i have the JTA transaction status in SEI(service enpoint interface)java method  distributeMasterDataOutA.Since it is an interface i dont know what annotation can be used.
    If its possible i can try this UserTransaction,  ut.begin() &   ut.commit(),so that everytime this method is called it will treat as a new transaction..
    Let me know if you need more details??,Any idea provided would be great.
    Thanks
    Sabarinathan

  • JTA Transaction log circular collision

    Greetings:
              Just thought I'd share some knowledge concerning a recent JTA-related
              issue within WebLogic Server 6.1.2.0:
              On our Production cluster, we recently ran into the following critical
              level problem:
              <Jan 10, 2003 6:00:14 PM EST> <Critical> <JTA> <Transaction log
              circular collision, file number 176>
              After numerous discussions with BEA Support, it appears to be a (rare)
              race condition within the tlog file. It was also noted by BEA during
              their testing of WebLogic 7.0.
              Some additional research lead to an MBean attribute under *WebLogic
              Server 7.0* entitled, "CheckpointIntervalSeconds". The documentation
              states:
              ~~~~
              Interval at which the transaction manager creates a new transaction
              log file and checks all old transaction log files to see if they are
              ready to be deleted. Default is 300 seconds (5 minutes); minimum is 10
              seconds; maximum is 1800 seconds (30 minutes).
              Default value = 300
              Minimum = 10
              Maximum = 1800
              Configurable = Yes
              Dynamic = Yes
              MBean class = weblogic.management.configuration.JTAMBean
              MBean attribute = CheckpointIntervalSeconds
              ~~~~
              After searching for a equivalent setting under WebLogic Server
              6.1.2.0, nothing was found and a custom (unsupported) patch was
              created to change this hardcoded setting under 6.1:
              from
              ... CHECKPOINT_THRESHOLD_MILLIS = 5 * 60 * 1000;
              to
              ... CHECKPOINT_THRESHOLD_MILLIS = 10 * 60 * 1000;
              within com.bea.weblogic.transaction.internal.ServerTransactionManagerImpl.
              If you'd like additional details, feel free to contact me via e-mail
              <[email protected]> or by phone +1.404.327.7238. Hope this
              helps!
              Brian J. Mitchell
              BEA Systems Administrator
              TRX
              6 West Druid Hills Drive
              Atlanta, GA 30329 USA
              

    Hi 783703,
    As Sridhar suggested for your problem you have to set transaction-time out in j2ee/home/config/transaction-manager.xml.
    If you use Idempotent as false for your partnerlinks, BPEL PM will store the status till that invoke(Proof that this invoke gets executed).
    So better to go for increasing the time instead of going for idempotent as it has some side effects.
    And coming to dehydration ....Ideally performance will be more if there are no much dehydration poitns in our process. But for some scenarios it is better to have dehydration(ex: we can know the status of the process...etc)
    Dehydration store will not get cleared after completion of the process. Here dehydration means ....it will store these dtails in tables(like Cube_instance,cube_scope...etc).
    Regards
    PavanKumar.M

  • JTA transaction propagation

              Can I just confirm that if a method in an EJB has a JTA transactional context specified
              by container-managed transaction demarcation, then the transaction context will be
              propagated to any method that it calls in any other Java class. I just wanted to
              be sure because we have all our SQL handling in separate Data Access classes whose
              methods are called from the EJBs.
              Thanks
              

    Yes. Make sure that you are using a Transactional DataSource or the WebLogic JTS Driver to
              access the connection pool...
              Dave wrote:
              > Can I just confirm that if a method in an EJB has a JTA transactional context specified
              > by container-managed transaction demarcation, then the transaction context will be
              > propagated to any method that it calls in any other Java class. I just wanted to
              > be sure because we have all our SQL handling in separate Data Access classes whose
              > methods are called from the EJBs.
              > Thanks
              

  • SFSB and BMT JTA Transaction Scope confusion

    Hi,
    I'm a bit confused with the scope of a UserTransaction.
    * Classic SFSB with BMT
    @Stateful
    @TransactionManagement(TransactionManagementType.BEAN)
    public class SFSBean implements SFS {
         private @Resource UserTransaction tx;
         private @PersistenceUnit(unitName="my-db") EntityManagerFactory emf;
         private EntityManager em;
         public void start() {
              try {
                   tx.begin();
              } catch (NotSupportedException e) {
                   throw new RuntimeException(e);
              } catch (SystemException e) {
                   throw new RuntimeException(e);
              em = emf.createEntityManager();
         public void doJob1() {
         public void doJob2() {
         @Remove
         public void commit() {
              try {
                   tx.commit();
              } catch (SecurityException e) {
                   throw new RuntimeException(e);
              } catch (IllegalStateException e) {
                   throw new RuntimeException(e);
              } catch (RollbackException e) {
                   throw new RuntimeException(e);
              } catch (HeuristicMixedException e) {
                   throw new RuntimeException(e);
              } catch (HeuristicRollbackException e) {
                   throw new RuntimeException(e);
              } catch (SystemException e) {
                   throw new RuntimeException(e);
         @Remove
         public void rollback() {
              try {
                   tx.rollback();
              } catch (IllegalStateException e) {
                   e.printStackTrace();
              } catch (SecurityException e) {
                   e.printStackTrace();
              } catch (SystemException e) {
                   e.printStackTrace();
    }When I request this SB the container inject a JTA transaction inside my variable tx and this transaction will be bound to the life of my SB.
    But : if a handler for this SB is associated to a SessionScoped or ConversationScoped bean (CDI contexts) or simply to a HttpSession attribute, then calls to SB methods may occurs in different thread (successives requests).
    Is this pattern supported? As JTA rely on ThreadLocal but a transaction can also be injected inside a SFSB: I'm a bit confused...
    HttpRequest1[Thread-1] : ejbHandler.start(); // conversation start
    HttpRequest2[Thread-2] : ejbHandler.doJob1(); // long running transaction
    HttpRequest3[Thread-1] : ejbHandler.doJob2(); // long running transaction
    HttpRequest4[Thread-3] : ejbHandler.commit(); // conversation end
    I tried a small use case and it seems to work (maybe all my requests was part of the same thread, lucky me) with JBoss but if an error occurs the transaction manager seems completely confused.
    If this pattern is legal (I know it is a very bad pattern...), I'll try to fix my code, if it isn't I'll have to drop JTA from this part of the code...
    Thank you.

    Yes, this is part of the required transactional behavior for a stateful session bean. A stateful session bean is the only session bean type whose bean instances can retain their association with a transaction after the business method returns. It's then the container's job to set up the correct transaction context for each successive invocation of the stateful session bean instance, until the transaction is committed or rolled back. If a system exception is thrown from the stateful session bean method the instance will be destroyed.

  • JavaCard - methods in Util Class

    Hi,
    I found that all of array functions in Util class arrayCopyNonAtomic(...), arrayFillNonAtomic(...), arrayCompare(...)
    .. invoke equivalent native method. There is no other computation at Java Layer. (if you see from decompile of API code)
    So why array function should do this way? I can have an example, for the arrayCompare, we can iterate over all elements and do normal comparison. The same with arrayFillNonAtomic(...). The only function that requires native is related to atomic transaction.
    Do you have any reasons for using native beside the speed?
    thanks,
    Hoang Long

    Native code can access the CPU instructions for this directly. Java byte code would be interpreted by the JCVM to eventually call the native instructions. The native code is more efficient and faster. You could do this in Java but it is also trivial in C/assembly.
    Cheers,
    Shane

  • ClassNotFoundException for Spring class

    Hi,
    We are migrating application from WebSphere to SAP NetWeaver. Our Web module uses JAAS for authentication.
    In the custom login module we are using Spring framework. We are creating BeanFactory using:
    [code]BeanFactory beanFactory = new ClassPathXmlApplicationContext ("conf/service-client/client-prop.xml");[/code]
    Content of client-prop.xml is :
    [code]<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
         <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" >
              <property name="location">
                   <value>conf/service-client/client.properties</value>
              </property>
         </bean>
         <bean id="ClientProperty" class="com.mypkg.common.service.bootstrap.types.ServiceClientProperty">
              <property name="url">
                   <value>$://$:$/$/services</value>
              </property>
              <property name="namespacePrefix">
                   <value>$</value>
              </property>
         </bean>
    </beans>[/code]
    Now we are getting the exception:
    [code]1.5#000FFE10ED0E0043000000030000090C000417A932F6D6B4#1151915378772#com.sap.engine.services.security#sap.com/MyWeb#com.sap.engine.services.security#Guest#2####11191b600a6e11dbca17000ffe10ed0e#SAPEngine_Application_Thread[impl:3]_35##0#0#Error##Java###Exception #1#com.sap.engine.services.security.exceptions.BaseLoginException: Error in some of the login modules.
         at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:146)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.services.security.login.FastLoginContext.login(FastLoginContext.java:152)
         at com.sap.engine.system.SystemLoginModule.login(SystemLoginModule.java:90)
         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:324)
         at javax.security.auth.login.LoginContext.invoke(LoginContext.java:675)
         at javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
         at javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:607)
         at javax.security.auth.login.LoginContext.login(LoginContext.java:534)
         at com.mypkg.client.security.actions.LoginAction.executeLogic(LoginAction.java:43)
         at com.mypkg.client.framework.action.Action.execute(Action.java:67)
         at com.mypkg.client.framework.action.Action.execute(Action.java:41)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
         at com.mypkg.client.framework.action.RequestProcessor.processActionPerform(RequestProcessor.java:53)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:340)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:318)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:821)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:239)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
    Caused by: java.lang.ExceptionInInitializerError
         at com.mypkg.common.service.client.ServiceClientFactory.getProxy(ServiceClientFactory.java:131)
         at com.mypkg.common.service.client.ServiceClientFactory.getService(ServiceClientFactory.java:56)
         at com.mypkg.client.security.auth.UPServiceLoginModule.login(UPServiceLoginModule.java:101)
         at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:68)
         ... 37 more
    Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'propertyConfigurer' defined in class path resource [conf/service-client/client-prop.xml]: Bean class [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer] not found; nested exception is com.sap.engine.frame.core.load.SAPClassNotFoundException: org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
         at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:428)
         at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:335)
         at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitions(DefaultXmlBeanDefinitionParser.java:266)
         at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:186)
         at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:238)
         at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:155)
         at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:124)
         at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:140)
         at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:103)
         at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:71)
         at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:87)
         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:267)
         at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:80)
         at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:65)
         at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:56)
         at com.mypkg.common.service.bootstrap.BootstrapServiceClient.getClientProperty(BootstrapServiceClient.java:119)
         at com.mypkg.common.service.bootstrap.BootstrapServiceClient.<init>(BootstrapServiceClient.java:48)
         at com.mypkg.common.service.bootstrap.BootstrapServiceClient.<clinit>(BootstrapServiceClient.java:39)
         ... 41 more
    Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
    Loader Info -
    ClassLoader name: [common:library:com.sap.security.api.sda;library:com.sap.security.core.sda;library:security.class;library:webservices_lib;service:com.sap.security.core.ume.service;service:connector;service:dbpool;service:keystore;service:security;service:userstore]
    Parent loader name: [Frame ClassLoader]
    References:
       library:com.sap.ip.basecomps
       library:core_lib
       common:library:IAIKSecurity;library:activation;library:mail;library:tcsecssl
       library:servlet
       library:sapxmltoolkit
       library:com.sap.mw.jco
       library:com.sap.util.monitor.jarm
       library:j2eeca
       library:opensql
       interface:security
       interface:log
       interface:shell
       interface:keystore_api
       library:ejb20
       interface:webservices
       library:com.sap.guid
       interface:appcontext
       interface:endpoint_api
       interface:resourceset_api
       interface:resourcecontext_api
       common:service:iiop;service:naming;service:p4;service:ts
       interface:ejbcomponent
       interface:container
       interface:visual_administration
       interface:transactionext
       interface:dsr_ejbcontext_api
       service:timeout
       service:memory
       service:deploy
       library:antlr
       library:jdbdictionary
       library:opensqlextensions
       service:adminadapter
       interface:cross
    Resources:
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    com.sap.security.api.sda
    com.sap.security.api.perm.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    services
    keystore
    keystore.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    security.class
    tc_sec_saml_service_api.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    webservices_lib
    jaxm-api.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    services
    connector
    connectorimpl.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    com.sap.security.api.sda
    com.sap.security.api.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    services
    com.sap.security.core.ume.service
    com.sap.security.core.ume.service.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    com.sap.security.core.sda
    com.sap.security.core.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    security.class
    tc_sec_jaas_test.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    security.class
    tc_sec_saml_jaas.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    webservices_lib
    webservices_lib.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    services
    userstore
    userstore.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    com.sap.security.core.sda
    com.sap.security.core.tpd.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    security.class
    tc_sec_https.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    security.class
    tc_sec_saml_xmlbind.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    services
    dbpool
    sqljimpl.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    services
    security
    security.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    security.class
    tc_sec_ssf.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    services
    dbpool
    opensqllib.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    security.class
    tc_sec_jaas.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    services
    dbpool
    dbpool.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    security.class
    tc_sec_compat.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    security.class
    tc_sec_saml_toolkit_api.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    webservices_lib
    jaxrpc-api.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    security.class
    tc_sec_saml_toolkit_core.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    security.class
    tc_sec_userstore_lib.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    webservices_lib
    saaj-api.jar
       E:
    usr
    sap
    J2E
    JC00
    j2ee
    cluster
    server0
    bin
    ext
    security.class
    tc_sec_saml_util.jar
    Loading model: {parent,local,references}
         at com.sap.engine.frame.core.load.ReferencedLoader.loadClass(ReferencedLoader.java:314)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:219)
         at org.springframework.util.ClassUtils.forName(ClassUtils.java:87)
         at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.createBeanDefinition(BeanDefinitionReaderUtils.java:64)
         at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:369)
         ... 58 more[/code]
    ClassNotFoundException exception is coming for the class: org.springframework.beans.factory.config.PropertyPlaceholderConfigurer but the correponding jar file (spring-beans.jar) exists in the WEB-INF/lib.
    Any kind of help will be greatly appreciated.
    Regards,
    Sagar

    Apparently, this question was repeated 3 times in different forums and is answered in the link below:
    ClassNotFoundException for Spring class
    Regards.

  • Design Advice Request - Using JDBC in a utility class

    I have a utility class that I would like to use from any client code, regardless of whether that code is executing in a transaction or not.
              This seems to greatly complicate the JDBC access from within the utility class. I appreciate any advice.
              The utility class may both read from and write to the database. It currently attempts to detect whether it is in a transaction (it tests whether TransactionHelper.getTransactionHelper().getTransaction() is null to do this -- please point out if there is a better way.)
              If in a transaction, the utility uses a data source which is linked to an XA connection pool, since it must assume other database activity may be occurring on the tx. If not in a transaction, however, it uses a data source linked to a non-XA connection pool, since the XA connection pool will not work outside of a transaction.
              It seems like there should be an easier way -- are we overlooking some simpler solution?
              The database is Oracle 9i and we are using the Oracle thin drivers.
              Thanks in advance,
              Ken Clark

    Ken Clark wrote:
              > I am not sure what you mean by this:
              >
              > "do all your JDBC work in the
              > scope of a top-level method (or methods)
              > with *all* jdbc variables method-level
              > variables,"
              I saw the code you sent me, and that is what it does, so no worries here.
              >
              > I originally built this with a non-XA DataSource, but found that when the utility was called from within a transaction, I would get errors that there was already a connection in use and that I therefore needed to use an XA connection.
              >
              > Switching to XA DataSource fixed that problem, but then in other cases when not in a transaction, I would get errors saying that an XA Connection could not be used outside a transaction.
              >
              > Since my utility has no control over the callers state, I came up with the solution stated previously, where I determine if in a Tx and then use the corresponding DataSource.
              >
              > Is there just a matter of configuration such that I can use a non-XA DS in all cases?
              I am saying a non transactional DataSource, not a non XA data source. Ie, a datasource that
              is unaware of whether there is a UserTransaction underway. A transactional data source can
              be either XA or not. In the former case, multiple XA connections can and will be entrained
              in any ongoing transactino, and non-XA (but transactional) datasources can and will be
              used in a tx, but only one per tx because they have no 2-phase commit capability.
              Ie; In the config file, you will see TxDataSource for a transactional datasource
              to a pool (whether XA or not), and you will see DataSource for a non-transactional
              data source.
              Joe

Maybe you are looking for