cancel
Showing results for 
Search instead for 
Did you mean: 

WAS unable to locate the SAPJCO jar

Former Member
0 Kudos

Hi

I was trying to create a J2EE application on NETWEAVER.

I have created the ear file and deployed it on the server .

I have created a simple application using a JSP and Servlet.

While running the application i am getting a runtime error <b>NoClassDefFoundError</b> in the servlet on the line where i have called the JCO.createClient() function.

I have checked the CLASSPATH variables and even the .classpath files , all have the required entries to locate the jar file.

It seems to me that i am missing some reference variable setting on the server.

Can anyone of you pleas help me with this issue.

Please if possible do let me know the administrator password for the WAS installed on a local system.

Thanks a lot in advance

Nikhil Mahajan

ph- 91-22-55557342

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi

I have a similar problem and I wonder if some one could give me some light. I am using WebSphere WAS 5.0 on AIX and using Java within my application (Ariba).

When I try to call the sapjco, I get the following error:

"java.lang.NoClassDefFoundError: com/sap/mw/jco/JCO

at config.java.custom.sap.JCoConnectionPool.<init>(JCoConnectionPool.java(Compiled Code))

at config.java.custom.sap.JCoConnectionPool.initializePool(JCoConnectionPool.java(Compiled Code))"

Eventhough I have the classpath is set in WebSphere, still doesn't work.

Thanks,

Juan P

Former Member
0 Kudos

hi,

i'm trying to connect to SAP through a jsp page. i'm getting a NoClassDefFoundError as well with JCO$BasicRepository.

as i have java classes packed as jars handling the jco codes, i believe that it is the same problem. but i am not using netweaver. i am using Sun's Application Server 8. frmo what i read, i would likely have to insert the previously posted xml line in some xml file as well.

so the question is, which file is this that i will have to edit? thx.

Former Member
0 Kudos

If you are using SAP J2EE Server please go c:\SAP J2EE Server\cluster\server\managers\

find library.txt and reference.txt files

open and add below line in library.txt

library jco sapjco.jar

open and add below line in reference.txt

reference sample library:jco

here "sample" is your ear application name, which you have mentioned in the application.xml file when you are deploying ear file.

You can keep your sapjco.jar file in your application WEB-INF\lib folder.

Once you update this, please restart your SAP j2EE server and deploy the same application again. I hope this will work.

Former Member
0 Kudos

hi

One more questionn

in the tag

<reference-target

provider-name="sap.com"

target-type="library">com.sap.mw.jco</reference-target>

Do i need to mention the full path where the jar is located

Thanks

Nikhil

Former Member
0 Kudos

Hi Nikhil,

no, you don't need to.

Regards

Stefan

Former Member
0 Kudos

Hi Stefan

i think this is going to look for the file once the application is stsrted on the server.

Can you please let me know from where will it pick the jar file .

Or should we provide the path where this jar is present on the local machine

as i have the server running on the local machine only.

Thanks

Nikhil

Former Member
0 Kudos

Hi Nikhil,

sorry, if my last answer was a little bit to short The point is, that the library you are going to reference is already present (deployed as a library) in the server. So there's no need for you to take care about jar paths. There's no difference if the server runs locally or remote.

Hope that helps.

Regards

Stefan

Former Member
0 Kudos

Hi Stefan

I did try to run the application after placing the above code in the application- j2ee-engine.xml.

it still gives me the same error.

ERROR IS AS BELOW

java.lang.NoClassDefFoundError

at Salesorder.doPost(Salesorder.java:62)

at Salesorder.doGet(Salesorder.java:53)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)......

on the line 62 of the servlet the code mentioned is

JCO.createClient(....

Can you please advise on this issue.

Thanks

Nikhil

Former Member
0 Kudos

Hi Nikhil,

there's nothing more we can do about that for now! Please have a look at your "How to login to the SAP-J2EE server

" thread, where i described how you can check, if your server app really has the reference required.

Hope that helps (so far).

Regards

Stefan

Former Member
0 Kudos

Hi Stefan

Thanks a lot for all the help

will surely let you know once i try it out

Thanks

Nikhil

Former Member
0 Kudos

Thanks a lot for the help

I will try it out right away.

Thanks and regards

Nikhil

Former Member
0 Kudos

Hi,

You have to set a reference to the JCO(not sure what would be the correct name of the JCO library) library in the application-j2ee-engine.xml file of your ear.

Regards,

Prasad

Former Member
0 Kudos

Hello,

did you add the reference to your application-engine.xml:

<reference reference-type="hard">

<reference-target

provider-name="sap.com"

target-type="library">com.sap.mw.jco</reference-target>

</reference>

That should link your application to the jco-jar

Best Regards, astrid