Skip to Content
0

Imported Archive

Mar 13, 2017 at 03:40 PM

346

avatar image

Hi SDNites,

I have an imported archive which is used for JAVA mapping. This imported archive comprises of,

1. .Class

2. .Classpath

3. .project

In the past whenever I have created Java mapping it contains .JAVA and .CLASS which are created as I have imported .JAR files in PI system. Can you please help me with below 2 queries,

1. How are the above 3 files created when imported in SAP PI and does not have .JAVA files.

2. Where can I find source code in the above as it lies in .JAVA. I have see inside .Classpath and there are quite a few paths present but not sure ifI am looking into the right place to get .JAVA source code.

Regards,

Abhi

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

4 Answers

Best Answer
avatar image
Former Member Mar 14, 2017 at 04:54 PM
0

Hi Abhishek,

You can decompile your '.class' file.

Decompile Java Mapping

JD-GUI is a standalone graphical utility that displays Java source codes of “.class” files. You can browse the reconstructed source code with the JD-GUI for instant access to methods and fields.

JD-GUI

Regards,

Nabendu.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Mar 13, 2017 at 04:14 PM
0

Please select 'Export Java source files and resources' checkbox when Exporting your Project in NWDS.

/wp-content/uploads/2014/04/17_441900.png

Reference: Change existing JAVA mapping using NWDS in SAP PI

Regards,

Nabendu.

Share
10 |10000 characters needed characters left characters exceeded
Abhishek Gupta Mar 14, 2017 at 03:54 PM
0

Hi Nabendu,

Thanks for the helpful response.

I have an existing mapping in which I can see only .class, .classpath and .project. I have to mke modifications in the mapping. I am trying to find the source code of it but not able to find its JAVA class. Can you please help me with that.

Regards,

Abhi

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

Hi Abhi,

Could you check that your jar file contains any java files or not? You can change its extension from "jar" to "zip" (if it's necessary) and use any archive application (like WinZip, WinRar, etc).

If you wouldn't be able to find java files, then you would have two options:

1. you can try to find them somewhere else (a company source repository, developers, etc),

2. you can try to decompile your class files.

Regards,

Andrzej

0
Abhishek Gupta Mar 16, 2017 at 10:09 AM
0

Hi Nabendu,

Thanks for the helpful response.

I am now able to decompile the .class files. Only difference that I have seen is that the comments of the code will be lost when you decompile using this approach. Please confirm.

Also I noticed that the JAVA mapping works absolutely fine even without .JAVA files in Imported Archive. My understanding here is that we import both .JAVA and .CLASS file for easier maintenance of code. We can even live with .CLASS files in imported Archive without any issues.

Regards,

Abhishek

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

Hi Abhishek,

Yes, when you decompile your class file, you will get a source file but without any comments.

Of cource, you don't need to import a java file to your PI cos only class file is required at runtime. But I always put java and class files into my jar file to help other developers.

Regards,

Andrzej

0

Thanks Andrzej for confirming my understanding.

I believe this should be part of coding standards :) which will help in better maintenance of the code.

Regards,

Abhishek

0