Skip to Content
0

NWDI - NWDS Java file version not matched

Nov 21, 2017 at 04:40 PM

218

avatar image
Former Member

Hi All,

I am using NWDS (eclipse) for PO 7.4 and using JDK 1.5 to develop adapter module.

The code is working fine in PO 7.4.

When I try to activate the code for NWDI, I get following error in NWDI -

   [javac] ERROR: /usr/sap/SM2/DVEBMGS00/j2ee/cluster/server0/temp/CBS/7/.B/78/DCs/nwdi/customdev/_comp/ejbModule/xx/co/comp/po/modules/dummy.java:10: cannot access javax.ejb.EJBException
     [javac] ERROR: bad class file: /usr/sap/SM2/DVEBMGS00/j2ee/cluster/server0/temp/CBS/7/.B/78/DCs/sap.com/engine.jee5.facade/_comp/gen/default/public/api/lib/java/engine.jee5.facade.jar(javax/ejb/EJBException.class)
     [javac] ERROR: class file has wrong version 49.0, should be 48.0
     [javac] ERROR: Please remove or make sure it appears in the correct subdirectory of the classpath.
     [javac] ERROR: import javax.ejb.EJBException;
     [javac] ERROR:

We are using jdk 1.5 in our track in nwdi.

com.sap.jdk.hom_path_key is pointing to default which is for JDK 1.5.

Now the question is if we are using JDK 1.5 for both - NWDS and NWDI, why do we get following error -

class file has wrong version 49.0, should be 48.0

Any pointer will be appreciated.

Thanks,

Ravi.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Milen Dontcheff
Nov 22, 2017 at 06:49 AM
2

Hello Ravi,

1.

"I am using NWDS (eclipse) for PO 7.4 and using JDK 1.5 to develop adapter module."

If indeed this "PO 7.4" is not typo and the P.O. is 7.4, then this scenario is not correct. JDK 1.5 might not be used for building SCAs that will be deployed (eventually) on NW AS Java 7.40

JDK 1.5 might be used for building application that will run on NW AS Java 7.1x

Here is the list of the NW AS Java and the JDK that must be used for building applications.

7.5 = JDK 1.8.X = 52.0

7.4 = JDK 1.6.X = 50.0

7.3X = JDK 1.6.X = 50.0

7.2 = JDK 1.6.X = 50.0

7.1X = JDK 1.5.X = 49.0

7.0X = JDK 1.4.X = 48.0

The last column is the IBM's JDK numeration. Please note one should not use JDK from IBM, if they would like to deploy the application to the NW AS Java. The IBM JDK is not supported by SAP, since JDK 1.4! The only supported JDKs are ORACLE's JDK and SAPJVM.

I would like to repeat it once again, when one is building applications which will run on NW AS 7.4, they must do it with JDK 1.6

2.

[javac] ERROR:/usr/sap/SM2/DVEBMGS00/j2ee/cluster/server0/temp/CBS/7/.B/78/DCs/nwdi/customdev/_comp/ejbModule/uk/co/smithsnews/po/modules/HandlingPaymentsValidator.java:10: cannot access javax.ejb.EJBException

[javac] ERROR: bad classfile:/usr/sap/SM2/DVEBMGS00/j2ee/cluster/server0/temp/CBS/7/.B/78/DCs/sap.com/engine.jee5.facade/_comp/gen/default/public/api/lib/java/engine.jee5.facade.jar(javax/ejb/EJBException.class)

[javac] ERROR:classfile has wrong version49.0, should be 48.0

[javac] ERROR: Please remove or make sure it appears in the correct subdirectory of the classpath.

This error message is because the CBS is building with JDK of different version than is needed for the compilation of this custom code.

In particular the custom code

(ejbModule/uk/co/smithsnews/po/modules/HandlingPaymentsValidator.java)

* either refers to EJB which is either not provided with the present version of JDK 1.5,

* or this very same EJB engine.jee5.facade.jar is located in other path in the JDK 1.4!

I am writing that the CBS is recognizing the necessary JDK (for the compilation of this custom code) to be JDK 1.4, on base of this:

classfile has wrong version49.0, should be 48.0

In other words, this custom java class of the custom EJB module,

(ejbModule/uk/co/smithsnews/po/modules/HandlingPaymentsValidator.java)

is not migrated correctly in the NWDS, at the first place.

So, firstly it should be used NWDS 7.31. I would recommend the latest SPS, but if the SPS is different from the latest it should be with 5 numbers higher than the SPS of the NW AS Java R.T.S. (or as you have quoted the P.O. 7.4)

718949 - Web Dynpro Application Compatibility WebAS SPx - SPx+n

1791485 - NWDS 7.3 EHP1 as development environment for SAP NetWeaver 7.4

Secondly, the JDK used by the NWDS 7.31 must be JDK 1.6 (not JDK 1.5, neither JDK 1.4)!.

Thirdly, in the NWDS, the public parts of the DC (which contains this custom EJB module) must be changed, so to refer to the correct path of this necessary EJB engine.jee5.facade.jar . There might be other necessary changes of this custom EJB module with regards the uk/co/smithsnews/po/modules to be compiled and to run with JDK1.6 . The developers of this custom code should have better understanding about this.

3.

The last necessary change in your system landscape is on the server where is running the NWDI (I do mean the CBS in particular, in case you do use distributed NWDI). So the AS Java where the CBS runs, must have installed JDK 1.6 .

In the track you need to change the build variant to point to this JDK 1.6.

On the NWA you need to change:

BUILD_TOOL_JDK_HOME

JDK_HOME_PATHS

variables.

More details, about this necessary configuration in this very nicely written blog:

Configuring JDK settings with NWDI

4.

When you have:

4.1. installed JDK 1.6 on both the AS Java (where the CBS is) and the PC (where the NWDS 7.31 is)

4.2. and configured your NWA & NWDI settings correctly (with regards to the above mentioned blog),

you need to

4.3. re-import the SCAs in the CMS - Transport Studio - tab Development

(this will import the correct building libraries in the NWDI CBS buildspace, which later will be copied by the NWDS),

4.4. re-import the development configuration track in the NWDS 7.31

Then the developers need to:

4.5. synchronize again this custom DC (which will retrieve the source code again from the DTR server to the local NWDS dtr workspace)

4.6. make the necessary changes (with regards to refer to this EJB, of JEE engine, for JDK 1.6. So, it might be different than engine.jee5.facade.jar)

4.7. release the activity from the NWDS.

Steps 4.4 - 4.7 are explained in detail in this guide:

Migrating Local Developments to a Centralized NWDI Environment (Developer's Viewpoint)

Then you need to

4.8. activate the activity from the CBS (if this is not set to be done automatically)

This will rebuild (and compile again) the custom EJB module ejbModule/uk/co/smithsnews/po/modules/HandlingPaymentsValidator.java .

Regards,

Show 6 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Milen,

Thanks for detailed answer. I will check.

0
Former Member
Former Member

Hi Milen,

Regarding your comment -

So, firstly it should be used NWDS 7.31. I would recommend the latest SPS, but if the SPS is different from the latest it should be with 5 numbers higher than the SPS of the NW AS Java R.T.S. (or as you have quoted the P.O. 7.4)

I would like to clarify that I am using NWDS 7.30 SP 16 and I am able to deploy the code into SAP PO 7.4 and the code is working. The problem is more of NWDI where I am not able to activate the code (CBS JDK issue mismatch definitely ). I will get the JDK 1.6 installed on NWDI and will check.

Thanks,

Ravi.

0

Hi Ravi,

1.

You might be able to deploy it and the code might run or at least the end users do not face issues... at the moment.

However, the NW AS Java is 7.40 while the custom code is compiled with the libraries of the NWDS 7.30.

In other words, the development IDE environment, where the custom code is created, is different from the environment where it will be executed (the RTS).

This is neither recommended nor supported - no matter whether the users will ever face any issues or not.

In the end it is up to you decision. Yet, in case you would ask for help from SAP, this will be the 1st been checked and confirmed - what is the version of the dev. IDE and what is the version of RTS.

2.

The problem is not in the NWDI, but in the JDK with which the CBS is "forced" to build this custom code. I have explained previously the root cause and the proper actions to resolve this impediment.

Regards,

0
Former Member

Hi Milen,

Thanks. I understand what you say. I will get the right JDK deployed and check it.

0

Hello Ravi,

Also please make certain the custom EJB module (and any other custom code) is migrated to run on NW AS Java 7.40.

Otherwise, even if you succeed to compile it, once it is deployed (without the necessary migration changes) there might have been unexpected results.

Regards,

0
Former Member

Sure Milen. Thanks for reminding :)

0
Richard Zhao
Nov 22, 2017 at 06:01 AM
0

Hello, Ravi. You can refer to below link to get more version information about NWDI and NWDS. Hopefully, it will help you to solve your issue.

https://blogs.sap.com/2014/03/26/nwdi-vs-nwdi-content/

Show 3 Share
10 |10000 characters needed characters left characters exceeded

SAP JVM Version compatibility in AS Java

SAP JVM 4.1 (JDK 1.4)

The following versions of the NetWeaver Application Server Java are compatible with the SAP JVM 4.1:

  • SAP Web AS 640
  • Netweaver 04
  • Netweaver 7.0 EHP1
  • Netweaver 7.0 EHP2
  • Netweaver 7.0 EHP3

SAP JVM 5.1 (JDK 1.5)

The following versions of the NetWeaver Application Server Java are compatible with the SAP JVM 5.1:

  • Netweaver 7.1
  • Netweaver 7.2

SAP JVM 6.1 (JDK 1.6)

The following versions of the NetWeaver Application Server Java are compatible with the SAP JVM 6.1:

  • Netweaver 7.30
  • Netweaver 7.31
  • Netweaver 7.40

SAP JVM 8.1 (JDK 1.8)

  • Netweaver 7.50
0
Former Member
Richard Zhao

Thanks Richard, I will check it. However, Milen has already pointed out a correction.

0

Dear Mr. Zhao,

Please correct your post. Netweaver 7.2 is NOT "compatible" with SAP JVM 5.1! SAP NetWeaver 7.2 requires SAP JVM 6!

Having posted the official P.A.M., I need to confirm in the past I have installed and run SAP NW AS Java 7.2 with ORACLE JDK 1.6 . I did not bump in any problem related to JDK/JVM .

Regards,

pam-nwas72ce.png (142.6 kB)
0