cancel
Showing results for 
Search instead for 
Did you mean: 

PI x Java Mapping.

Former Member
0 Kudos

Hi all!

I'm developing a PI service wich uses a Java class to do a message mapping.

This java class uses some libs (imported .jars) to run the business rules.

When I run Junit test locally it works fine.

But when I upload the class by Imported Archives and I try do transformation at integration builder design returns a error telling me that my imported jars weren't found.

Note: my libs were uploaded with in .jar package and I can see it in imported archives at Integration builder.

What I'm doing wrong? Is there any configuration missing?

Can anyone help me?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

anupam_ghosh2
Active Contributor
0 Kudos

Hi,

I think you have followed all processes for uploading the jar files correctly. There is no other process to do so.

Now since this is not working here is another approach to solve your problem. Extract the class file from the jar file.

How to do this ? follow this link

http://download.oracle.com/javase/tutorial/deployment/jar/unpack.html

once you have extracted the class file, place it in the sub folder under the folder of your java mapping file . The name of the subfolder should be the package name of the jar file. Import this class into your mapping program. Now run the program of mapping once in your local machine. Then create another jar file for exporting the mapping program along with the extracted class file.

Put this jar file in PI server.

Hope this might solve your problem.

one more thing I would like to add here. Once you extract the class file from jar file, you need to import this file into your mapping program using import statement. Please follow normal steps of import. This blog might help

http://www.coderanch.com/t/410149/java/java/Howto-Import-Class

regards

Anupam

Edited by: anupamsap on Jun 8, 2011 8:28 AM

Edited by: anupamsap on Jun 8, 2011 8:49 AM

Former Member
0 Kudos

Thanks Anupam!

When I did this, I saw there was a class that didn't suport my jdk version.

Solved my problem.

Answers (1)

Answers (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>When I run Junit test locally it works fine.

The required jars are available locally in your system classpath . So you are not having issues. When you package your java classes along with jars as an archive file, you miss something. So check your local classpath and see how those import classes are set in the path. Try to test locallly jtest with your jar alone in the classpath and see how that works. Also make sure that jdk version same in both your local and pi server.

Hope that helps.