2016-09-14 62 views
0

我希望得到一些性质了我的计划,我有JNDI做到这一点(有些属性是由我在那里设置好的),使用WAS Liberty。但是,当我使用这些标签:式“图书馆” ID为“一些-ID”的元素找不到

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

server.xmlEclipse表明我说一个警告:

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

我得到这些类(some-classanother-class)与pom.xml一个dependency

我去这些类里面,但我没有找到类似name-of-lib

还有另一种方式,以找出是否name-of-lib真的是这些类里面?

回答

2

您需要在server.xml中配置一个<library>元素,为其指定一个ID,并将您的<library>的ID作为libraryRef的值。

假设你有图书馆foo.jar位于/temp/myLibs/foo.jar你的文件系统上,你可以在你的server.xml这样的配置此库:

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

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

或替代使用libraryRef的指向的ID您<library>你可以窝在<library>下你的<jndiObjectFactory>这样的:

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

这里是IBM Doc for shared library configuration

+0

谢谢!后来,我发现这些链接(http://www.ibm.com/support/knowledgecenter/en/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/twlp_classloader_3p_apis.html)和(http:// www .ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/twlp_dep_jndi_refentry.html),这也帮助我解决了这个问题。 – mhery