简体   繁体   中英

How to use @EJB,@Inject and @ Local in weblogic 12.1.3.0?

My EJB3 application which was built on java1.7 was deployed in weblogic 12.1.2.0 server perfectly.However, after migrating to weblogic 12.1.3.0 with java1.8 built EAR, it throws various kinds of errors such as dependency injection issues. Do I need to change annotations in the current code such as @EJB,@Inject and @Local?

I wouldn't go so far. I think a jar is truely missing on the new application server.

If you moved from 12.1.2.0 to 12.1.3.0 your application, is it possible that a lib folder of weblogic 12.1.2.0 contains commons jar (for all applications) that you did not take into the new application server ?

Don't copy the jars that already exist with a newer version, but search for something custom you once added for your applications to work. What kind of classes are told missing ?

It can also be a trick if Weblogic can use an unified classloader (I don't know) that was set on version 12.1.2.0 and made classes being red from lib server folder and ear contents togheter, and now in 12.1.3.0 this customization is not set and classes are taken only from the ear.

Probably you have bundle jar's with implementation for those specs, such as, @EJB, @Inject (etc).

If you check differences between both versions, they are completely the same (at least) for those specs:

https://docs.oracle.com/middleware/1212/wls/NOTES/whatsnew.htm#BGGGHCJD

https://docs.oracle.com/middleware/1213/wls/NOTES/whatsnew.htm#BGGGHCJD

  • Contexts and Dependency Injection for Java EE 1.0
  • DependencyInjection for Java EE 1.0
  • Java EE EJB 3.1, 3.0, 2.1, 2.0, and 1.1

Maybe if you post the stacktrace, we can identify the issue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM