cancel
Showing results for 
Search instead for 
Did you mean: 

Java Back End - NoClassDefFoundError|java.lang.NoClassDefFoundError

Former Member
0 Kudos

Hello All ,

I have developed Custom SAP Backend application , and according to me i have configure correctly .

but i am getting below error :

Exception: 11:21:47 12/05/2013 : 20 (Agentry3), BackEndInitError (Java Back End - NoClassDefFoundError|java.lang.NoClassDefFoundError: /com/syclo/sap/sflight/server/

), Caused by: java.lang.ClassNotFoundException: .ZFlightBooking.src.com.syclo.sap.sflight.server.

11:21:47 12/05/2013: Failed to init Java Back End (Java v6.0.22.0 (JVM version 1.6.0_34, AJAPI version  build )) from ag3javabe.dll

Tags edited by: Michael Appleby

Accepted Solutions (0)

Answers (2)

Answers (2)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

This error indicates that your Agentry server can't find the java classes you created necessary for the server to start the java backend.  Did you export your .jar file (pg 107 step 5) and update the Agentry.ini (pg 114) to include it on the classpath?

Hopefully this will help get you further.

--Bill

Former Member
0 Kudos

Thanks Bill , I got my solution.

Former Member
0 Kudos

Hello Kunal,

I am new to this Agentry and trying to develop the flight application, facing couple of problems:

1. I changed the Agengrty.ini files as

classPath=.\ZflightBooking.jar;.\ini4j.jar;.\sapjco.jar;.\SAPCommon121161.jar;.\JavaBE.ini;.\librfc32.dll;.\sapjcorfc.dll;.\Java\Agentry-v5.jar;

serverClass=com/syclo/sap/sflight/server/Server

but the error comes up as

NoClassDefFounderror:com/syclo/sap/server

When i change the serverClass to com/syclo/sap/server the server got started but problem 2 occurs

2. Test environment ask for id and password: I supplied the one used to login thr ERP, but it says invalid password for the user, I use the same to login into sap wiht same id/pwd.

Please suggest and provide me some suggestions.

Thanks in advance

Pooja

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Pooja,

This should probably be a new thread but here goes.

It sounds like you have a similar problem in that the server cannot find the base class (part of the SAPCommon jar).  Your classpath and serverClass entries in the Agentry.ini should be similar to the following.

classPath=.\Java\Agentry-v5.jar;ini4j.jar;sapjco.jar;.\Java\SAPCommon-122971.jar;.\Java\ZFlightBooking.jar

serverClass=com/syclo/sap/sflight/server/Server

This assumes the ini4j, sapjco (and required dlls) are in the ServerDev directory and that the SAPCommon-122971 and your ZFlightBooking jar files are in the ServerDev\Java directory.

You need the make sure the serverClass is pointing to the above so that it calls your application code.  If you point it to the generic server class it will not know how to authenticate the user and what to do.  This will lead to the second problem you listed.

Try changing it back and making sure the classpath is correct and ensure your jars are in the right locations and try again.

--Bill

Former Member
0 Kudos

Hello Pooja ,

First make sure when you export your java code that time only select class files not java and class files.and copy complete path

Ex is below

C:\SAP WM\DevServer\Java\Agentry-V5.jar like all files .

Regards,

Kunal Varaiya


Former Member
0 Kudos

Thanks Bill/Kunal,

here are the steps I follwed after your suggestions,

1. all the dlls and jar files are copied into java folder except the ZflightBooking.jar

2. updated the agentry.ini files as below

classPath=C:\Agentry\ServerDev\Java\Agentry-v5.jar;C:\Agentry\ServerDev\Java\ini4j.jar;C:\Agentry\ServerDev\Java\sapjcorfc.dll;C:\Agentry\ServerDev\Java\sapjco.jar;C:\Agentry\ServerDev\Java\SAPCommon-121161.jar;C:\Agentry\ServerDev\ZflightBooking.jar

serverClass=com/syclo/sap/sflight/server/Server

now the error is

JavaBackendError(Java Exception caught: Java.lang.ExceptionInIntializationError: JCO.classInitialize(): could not load middlewear layer 'com.sap.mw.jco.rfc.Middlewearrfc'), JCO.nativeInit(); not initialized.

I thing this is only related to the Agnetry.ini file. Please suggest.

Thanks

Pooja

Former Member
0 Kudos

Hello Pooja ,

This error is related to java backend ,

so you have to change your JAVABE.ini files like below :

server=(your SAP Server IP Address)

[SERVICE_LOGON]

ENABLED=true

UID=your SAP User Name

UPASSWORD=your SAP Password

UPASSWORDENCODED=false

SERVERSERIALNUM=your Serial key for software

Regards,

Kunal Varaiya

Former Member
0 Kudos

Kunal,

I hv updated the javabe.ini  file as per the above guideleines, and i hv aready included the the the jdk and jre in the path variable:

C:\Program Files\Java\jdk1.6.0_45\bin;C:\Program Files\Java\jdk1.6.0_45\jre\bin\server;C:\Program Files\Java\jdk1.6.0_45\jre\lib;

I m using a 32 bit machine.

thanks

Pooja

Former Member
0 Kudos

Hello Pooja ,

make sure while developing front end application you use AJAPI V5 System Connection.

Regards,

Kunal Varaiya

Former Member
0 Kudos

Yes kunal the API version is AJAPIV5, for last 15days Im just trying to make the agentry server up but not possible:(,

Please help, unitl server is up and running i couldnot move ahead.

thanks

Pooja

Former Member
0 Kudos

Ya Pooja , I am not sure where your sap server is working . its in same system or vmware and other things. i need your complete information . Regards, Kunal

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Pooja,

The class path only needs to reference the jar files and should not include the .dlls.  Agentry also deals very will with relative references where dot (.) equates to the ServerDev or ServerProd directory.

I suspect your error may be due to missing the one dll required for the JCo.

I would put and keep the Jco files (sapjco.jar, sapjcorfc.dll and librfc32.dll) in the ServerDev directory and reference them using just by including sapjco.jar in the classpath (see my example from my previous post). 

Your ini4j.jar can also just go in ServerDev and reference as ini4j in the classpath

I would put your SapCommon121161.jar and your ZFlightbooking.jar in the Java folder and reference each with .\Java\ prefixes in the classpath.  Same for your Agentry-v5.jar.

Try that and see if that solves the problem.  If not let us know and we can continue troubleshooting.

--Bill

Former Member
0 Kudos

Hello Kunal/Bill,

Thanks a lot for your valuable inputs, I tried whatever suggested above but could not succeeded,

Opened a new thread for this, as here I could not award points to you as well, please provide your suggestions.

Thanks

Pooja

Former Member
0 Kudos

Hello Pooja ,

Lets go with step by step

1) you have given correct path for ini4j.jar , sapjco.jar , Agentry-v5 , SAPCommon-122971.jar, and your application class files . No any dll files path you need to give in agentry.ini

2) you have given correct IP or server name for SAP

3) SAP Username and password

4) make sure there is no error in agentry front end and java class files

5) and also make sure you dont have any error in ABAP and you have taken correct code from PDF files.

Regards,

  Kunal

Former Member
0 Kudos

Yes kunal I have verified again

1) you have given correct path for ini4j.jar , sapjco.jar , Agentry-v5 , SAPCommon-122971.jar, and your application class files . No any dll files path you need to give in agentry.ini --Done

2) you have given correct IP or server name for SAP -Done

3) SAP Username and password -Done

4) make sure there is no error in agentry front end and java class files-DoneNo errors/warnings

5) and also make sure you dont have any error in ABAP and you have taken correct code from PDF files.-Yes but what do u mwan by error in ABAP?...there is no abap code only the configuration that is

mentionedin doc, that I have verified.

Please respond to above newly created thread so that I can also assign points to your inputs.

Thanks

Pooja

Former Member
0 Kudos

Hello Pooja ,

i could not see you newly created thread .

Can you send link to me ?

Regards,

Kunal

Former Member
0 Kudos

Former Member
0 Kudos

Hi Pooja

Kindly follow the below link.

It would solve your problem.

Regards

A Reshma

Former Member
0 Kudos

Kunal,

The Agentry Server is failing when it is looking for the class called "ZflightBooking.src.com.syclo.sap.sflight.server".  This to me looks like the class that is being called is is no a complied class, and also still in the workspace.

Did you compile the class files into a Jar file?

Do you have the Jar file (or folder with the com folder below it) with the complied classes in the classPath key of the Agentry.ini in the [Java-n] section?

How does the ServerClass key look in the Agentry.ini file?

Stephen

Former Member
0 Kudos

Thanks Steve , Through your ans i got my solution .