Java – why do we have to declare dependencies on the JBoss 8 (wildfly) manifest?

The following ear is given:

> my-app. ear

> my-ejb. jar > my-webapp. war > lib

> my-lib. jar

My EJB needs Oracle library and Oracle space to work together to construct geometry and store data JBoss 8 (wildfly) correctly loads the Oracle module

When I started the application, I received classnotfoundexception oracle sql. STRUCT.

OK, I'm at my EJB meta inf / manifest The Oracle driver ojdbc6.0 is added to MF Jar dependencies

Class-Path: ojdbc6.jar
Dependencies: oracle.sql

When I started the application, I received classnotfoundexception oracle sql. StructDescriptor. I know that when I read data from the result set, the object in the result set is Oracle sql. Instance of struct class, but oracle sql. The structdescriptor is in the same package

OK, I'm at my lib meta inf / manifest The Oracle driver ojdbc6.0 is added to MF Jar

How it works!

My question is

>What is the role of JBoss 8? > Why don't I need to be in manifest.com on Oracle Weblogic Add these dependencies to MF?

Solution

Answer your question:

>What is the role of JBoss 8?

The manifest is automatically created whenever a jar archive is created There are no specific roles associated with JBoss 8, but its general purpose In special cases, if jar says file1 Jar depends on files belonging to some other jar, such as File2. Jar Jar file, you should load file1 These jars are loaded when the jar The trick now is that whenever a jar file is loaded by the classloader, manifest is the way to tell the classloader to load other jars required for the jar (check this link) when ojdbc6 is missing from the list Jar, which is why the code doesn't work

>Why don't I need to be in manifest.com on Oracle Weblogic Add these dependencies to MF?

Well, this is because in Oracle Weblogic, ojdbc6 Jar is bundled with the WebLogic Server and loaded when the server starts Note that even if you bundle ojdbc6.0 with your application Jar and won't use it This is relevant documentation

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>