mhery
mhery

Reputation: 2248

An element of type 'library' with ID 'some-id' could not be found

I want to get some properties out of my program, and I have to do it with JNDI (some attributes were setted there by me), using WAS Liberty. But when I use these tags:

<jndiObjectFactory id="id-factory" className="some-class" objectClassName="another-class" libraryRef="name-of-lib" />

on server.xml, Eclipse shows me a warning that says:

An element of type 'library' with ID 'name-of-lib' could not be found

I get these classes (some-class and another-class) with a dependency on pom.xml.

I went inside these classes, but I didn't find something like name-of-lib

There is another way to find out if name-of-lib is really inside these classes?

Upvotes: 0

Views: 107

Answers (1)

Andy Guibert
Andy Guibert

Reputation: 42936

You need to configure a <library> element in your server.xml, give it an ID, and make the ID of your <library> the value of the libraryRef.

Suppose you have the library foo.jar located at /temp/myLibs/foo.jar on your file system, you could configure this library in your server.xml like this:

<jndiObjectFactory ... libraryRef="MyLib"/>

<library id="MyLib">
  <fileset dir="/temp/myLibs" includes="*.jar"/>
</library>

Or instead of using a libraryRef to point to the ID of your <library> you could nest the <library> under your <jndiObjectFactory> like this:

<jndiObjectFactory ...>
  <library>
    <fileset dir="/temp/myLibs" includes="*.jar"/>
  </library>
</jndiObjectFactory>

Here is the IBM Doc for shared library configuration.

Upvotes: 2

Related Questions