0

My app was using com.ibm.ws.Transaction.TransactionManagerFactory in websphere runtime 6.1 (com.ibm.ws.runtime_6.1.0.jar).

Now it needs to be migrated to websphere 8.5. But in the runtime 8.5 (com.ibm.ws.runtime.jar), TransactionManagerFactory is defined in two packages: com.ibm.tx.jta.TransactionManagerFactory and com.ibm.ws.Transaction.TransactionManagerFactory.

When the app is compiled, the compiler always seems to use the one in com.ibm.tx.jta, and shows the error:

cannot access com.ibm.tx.jta.TransactionManagerFactory [javac] class file for com.ibm.tx.jta.TransactionManagerFactory not found [javac] com.ibm.ws.Transaction.WebSphereTransactionManager tm = com.ibm.ws.Transaction.TransactionManagerFactory.getTransactionManager();

How can I make the compiler to use the right class? Does anyone have ideas on how to solve the problem?

Thanks in advance

2
  • Cleanup/check your classpath, cleanup/check your import statements. Please show the code which you cannot compile.
    – Beryllium
    Aug 29, 2013 at 21:04
  • Relevant sections of the make file would be good too.
    – Csaba Toth
    Aug 29, 2013 at 21:12

2 Answers 2

0

If this is a compile time error then you just need to fully qualify the class type, and spell out the type in full length. This way the compiler will no which one you want to use, and you won't have to guess either. You may need to adjust project dependencies too, hopefully that will yield a correct classpath and you won't have to poke around manually. Furthermore, use the one what your project depends on. I guess it's not Maven if it's a really old project.

0

com.ibm.ws.Transaction is not API, so you shouldn't be using it in the first place. WAS_HOME/dev/was_public.jar contains the public APIs for the product. Perhaps UOWManagerFactory or UOWSynchronizationRegistry would be better?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.