on 04-08-2008 12:26 PM
Dear Friends,
Actually i am adding an external Jar file in my EJB Module in NWDS.I am using this jar file for converting XML to flat file and i am calling this module from Receiver ommunication channel.For this process, i am importing dom4j.jar file in the EJB Module.I have created a jar file for that module,
Now i have created an external Library project for the cause that i have used the external jar file, and i have made following code in the provider.xml file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE provider-descriptor SYSTEM "library.provider.dtd">
<provider-descriptor>
<display-name>
XML2EDI_Library
</display-name>
<component-name>
XML2EDI_Library
</component-name>
<major-version>6</major-version>
<minor-version>40</minor-version>
<micro-version>0</micro-version>
<provider-name>
dom4j.org
</provider-name>
<references>
<reference
provider-name="dom4j.org"
strength="weak"
type="library">org.dom4j.Document</reference>
<reference
provider-name="dom4j.org"
strength="weak"
type="library">org.dom4j.DocumentException</reference>
<reference
provider-name="dom4j.org"
strength="weak"
type="library">org.dom4j.Element</reference>
<reference
provider-name="dom4j.org"
strength="weak"
type="library">org.dom4j.io.SAXReader</reference>
</references>
<jars>
<jar-name>EDI_Module.jar</jar-name>
</jars>
</provider-descriptor>
I have included 4 references because i have imported following in my ejb module.
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
I am not sure of wht to include in reference target and provider name, I am getting the following exceptions in Message monitoring:
1. AO: Document Exception: org.dom4j.DocumentException: E:\usr\sap\BWS\DVEBMGS00\j2ee\cluster\server0\
2. Nested exception: E:\usr\sap\BWS\DVEBMGS00\j2ee\cluster\server0\
Help me in this issue..
Thanks in advance
N.Jayanth Kumar
Hi Jayanth,
You need to have your EJB name and JNDI name in your .jar file, then you need create an EAR file. For your Refference
regards,
sri.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should not reference each class individually, but the JNDI name of your library project, where the classes are included.
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Stefan,
We give the JNDI Name in the ejb-j2ee-engine.xml right?? I have the problem in my provider.xml in my Library project apart from my EAR and EJB Module.
Should i reference my JNDI name which is given in the ejb-j2ee-engine.xml in my provider.xml in my Library Project??
Thanks in Advance,
N.Jayanth Kumar
Hi Jayanth,
We give the JNDI Name in the ejb-j2ee-engine.xml right? - Yes
Should i reference my JNDI name which is given in the ejb-j2ee-engine.xml in my provider.xml in my Library Project? - In your ejb-j2ee-engine.xml give JNDI name the same name as your EJB module class name.
Regards,
Rajeev Gupta
> Should i reference my JNDI name which is given in the ejb-j2ee-engine.xml in my provider.xml in my Library Project??
You have to choose the JNDI name of the libary, where the classes
org.dom4j.Document
org.dom4j.DocumentException
org.dom4j.Element
org.dom4j.io.SAXReader
are included. Unfortunately I do no know the JNDI name and cannot help you here.
Stefan
Dear Stefan,
I will explain my problem here..in brief
1. I have created an EJB Module and adding an external jar dom4j.jar
2. I have the my jndi name as XmltoText
3. In my application-j2ee-engine.xml in my EAR file...i have included :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application-j2ee-engine SYSTEM "application-j2ee-engine.dtd">
<application-j2ee-engine>
<reference
reference-type="weak">
<reference-target
provider-name="dom4j.org"
target-type="application">TEST_LIBRARY
</reference- target>
</reference>
<fail-over-enable mode="disable"/>
</application-j2ee-engine>
TEXT_LIBRARY is name of my Library Project.Please tell me corrections in the above code...i have doubt regarding provider name.
4. As i have added external jar file in my ejb module..._i have created a Library project and in that project in provider.xml_ file i have included the following code...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE provider-descriptor SYSTEM "library.provider.dtd">
<provider-descriptor>
<display-name>TEXT_LIBRARY</display-name>
<component-name>TEXT_LIBRARY</component-name>
<major-version>6</major-version>
<minor-version>40</minor-version>
<micro-version>0</micro-version>
<provider-name>****</provider-name>
<references>
<reference
provider-name="****"
strength="weak"
type="library">****</reference>
</references>
<jars>
<jar-name>EJBModule.jar</jar-name> (This is my EJB Module jar file)
</jars>
</provider-descriptor>
Now what should i include in the places of **** in the references above??
Thanks and Regards,
N.Jayanth Kumar
I see. The dom4j.jar is part of the library.
In that case you need not a reference in the provider.xml.
Just add the dom4j.jar in the jars section.
I do not understand, what EJBModule.jar is. Is this the EJB which uses the library? In that case it does not make sense to include this jar here.
Regards
Stefan
Dear Stefan,
EJBModule.jar is the one i got when i did Build EJB Archive.....Should i include my dom4j.jar file as
<jars>
<jar-name>dom4j.jar</jar-name>
</jars>
Is the creation of Library Project necessary if i use external jar file here? in this context?? Did i do any mistake in creating the Library project?? Give me a brief description about the steps if i use an external jar file in my EJB Module...Please help me out in this issue....
Thanks,
N.Jayanth Kumar
Yes, if you use an external jar, you need a library project.
But if it is just one, you can also store this in the aii_af_jmsproviderlib.sda.
The reference in that case would be com.sap.aii.af.jmsproviderlib
On the other side you might use use functionality from sapxmltoolkit.jar instead of dom4j.jar.
Regards
Stefan
Edited by: Stefan Grube on Apr 9, 2008 11:15 AM
Dear Stefan,
As mentioned in the weblog, as per the comments mentioned in it..
"with lower versions 04 & 04s it is also possible.
Create a new Project (I'm using NW DS 2.0.xx). In the upcomming Dialog select "J2EE Server Component" and then "Library". Add you jars to the provider.xml.
In the J2EE Perspective you can build the sda and deploy it to the server. Applications using the library have to set a library refernce in their application-j2ee-engine.xml. "
I have created a Library Project....and which JAR File i have to add to provider.xml(Is it the external jar) and the what are the references that i have to create??
Thanks and regards,
N.Jayanth Kumar
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.