cancel
Showing results for 
Search instead for 
Did you mean: 

SAP J2EE Servlet and JCO WAS 6.30

Former Member
0 Kudos

Hi,

I execute a servlet on the SAP J2EE 6.30 engine and I want to connect to SAP using JCO. However, I am running into the following error:

java.lang.NoClassDefFoundError: com/sap/mw/jco/JCO$Exception

sapjco.jar is not included in the WEB-INF\lib directory and I use the following import statement:

import com.sap.mw.jco.*;

Is there any other configuration required in order to be able to call JCO from a servlet on a WAS 6.30 platform?

The servlet I am testing runs fine on a IIS/JRun platform.

Thanks,

Sorin Stancu

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

i don't understand wat's your problem, because i write an application (a connector between sap and cti) and never had this problem. You just have to put in your classpath, of your application(what kind of application do you have, an rfc server, a java stanalone application) a reference to sapjco.jar.

Best regards,

Florin

Former Member
0 Kudos

nu este de ajuns doar sa scrii o referinta la sapjco.jar

trebuie sa copii si 2 *.dll-uri(sapjco.dll,librfc32.dll)

eu ti-as sugera sa folosesti eclipsul e super tare, are niste plugin-uri pentru foarte multe tipuri de aplicatii de la SAP(webdynpro, iviewuri)

Former Member
0 Kudos

Salut Florin,

Poate in viitor o sa folosesc eclipse - ideea e ca netweaver developer studio e construit pe eclipse deci ar trebui sa-l folosesc. Oricum, nu l-am folosit pt. ca deocamdata e plin de probleme si e numai in faza de ramp-up.

Multumesc pentru sfat, Sorin

-


I'm not using NetWeaver dev studio because at this stage is only available as a ramp-up - SAP provides the deploy tool --> which is supposed to deploy applications that follow the J2EE standard.

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Sorin,

what you need to do is to declare the library in the descriptors of web.xml. It may be also enough to declare the libs in your web project in the netweaver studio.

Regards,

Benny

Former Member
0 Kudos

Hi Benny,

Thanks for your fast answer but I am not using netweaver studio for developing servlets (I use Forte) - would you happen to have an example of web.xml entry to point to the jco library ?

Because I don;t use netweaver studio, my web.xml doesn;t contain any entry for sapjco.jar and I'd have to make the entries manually, I assume is the <resource-ref> tag but I would need to know the <res-ref-name>, <res-type>, <res-auth> and <res-sharing-scope>.

Thanks again, Sorin

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Sorin,

so how do you deploy the stuff?

However, I went after this and found that usually not the web.xml is the place where such references are needed but application-j2ee-engine.xml keeps such references.

SAP specific descriptors can be found in the manual at: http://help.sap.com/webas_j2ee630/helpdata/en/3f/40bd71ae1a9b45a0f3eb6ff0a27aae/frameset.htm

the descriptor you're looking for is "reference".

Regards,

Benny

Former Member
0 Kudos

Hi Benny,

I deploy the applications using the SAP deploy tool. It works pretty well when not using sapjco library. It takes a web application file structure and it deploys it on the server. All fine except when you're using sapjco. Usually, external libraries should be included in the the WEB-INF/lib directory but as per OSS 542175 this is not supported in SAP J2EE and the fix provided in this note is valid only for WAS 620 and not WAS 630.

Thanks for the link, Sorin

Former Member
0 Kudos

Hi Benny!

> what you need to do is to declare the library in the

> descriptors of web.xml. It may be also enough to

> declare the libs in your web project in the netweaver

> studio.

On WAS 6.20 you put all libraries to be used by several applications (like sapjco.jar) in ...j2ee\cluster\server\additional-lib and referenced them from your application.

...j2ee\cluster\server\managers\library.txt:

library jco sapjco.jar

...j2ee\cluster\server\managers\reference.txt:

reference myApplication library:jco

Is this different with WAS 6.30 now?

Regards, Tanja

Former Member
0 Kudos

Hi,

The directory structure has been changed in WAS 630: there is no library.txt or reference.txt file under the

j2ee\cluster\server\managers directory (in fact there is no managers directory ).

But the solution to making references to libraries in WAS 630 is -as provided by SAP- : from the deploy tool --> deployer -> select ear -> descriptor -> extra info -> reference tab -> write name of the library and provider name. (obtain name/provider name from admin tool -> server -> libraries). For the jco library it would be:

target: com.sap.mw.jco

provider: sap.com

Sorin

Former Member
0 Kudos

Hi,

I have similar problem when trying to connect jco from java code in ear file.

How should I add the refference?