cancel
Showing results for 
Search instead for 
Did you mean: 

How are Library Components referenced?

Former Member
0 Kudos

I followed the Java EE 5 instructions on creating a Lbrary Component. I created an Enterprise Application Project 5 using the Developer Studio wizard. I then added external jars to the project and published it to server successfully, using a project name of MySharedLibrary.

I subsequently created a normal EAR project using the Enterprise Application Project 5 wizard. Before publishing the project, I modifed application-j2ee-engine.xml by adding the following entry.

<reference reference-type="weak">

<reference-target provider-name="sap.com" target-type="library">MySharedLibrary</reference-target>

</reference>

At runtime, I can see that the application can;t locate the libraries in the library component. I've also noted the following message in the log.

"The application sap.com/MyApp has explicit or implitic reference to [library:MySharedLibrary], but there are no loaders with such names and they will be ignored."

Any suggestions on what I need to do to use library components?

Thanks,

Jerry

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear Jerry,

Try to change

<b>target-type="library" </b>

to

<b> target-type="application" </b>

Since you have published your library as an Enterprise Application Project 5 , the reference target type should be 'application'. I believe that your library component will be located during runtime this way. In the previous versions, NetWeaver Developer Studio supported separate Library Projects and to reference them you needed to use target-type="library". In Java EE 5 Edition there are no such library projects anymore.

Here is another hint that might help you - except runtime dependency you can also set Design time dependancy for your library. To do it, just right click on a project (from where you want to put a reference to your library) and chose the option 'set AdditionaLibraries'

Greetings,

Bobby

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Jerry,

In the Java EE 5 release we have better option for packing shared libraries.

Please check my post describing it : /people/community.user/blog/2006/10/24/applications-and-shared-libraries

Best Regards,

Georgi

Former Member
0 Kudos

Thanks for the replies. Using "application" instead of "library" did eliminate the error message and I'm no longer getting a ClassNotFound error for a class in the shared library.

Unfortunately I'm now getting a ClassNotFound error for a class that's contained in my application so I suspect that use of the shared library has affected classloading in my application. I need to investigate further.

Former Member
0 Kudos

Hi Jerry,

could you please modify the target-type attribute of the reference definition n application-j2ee-engine.xml to <i>application</i> (rather than <i>library</i>).

<reference reference-type="weak">

<reference-target provider-name="sap.com" target-type="<b>application</b>">MySharedLibrary</reference-target>

</reference>

This should work.

Regards,

Ivo