cancel
Showing results for 
Search instead for 
Did you mean: 

Using JAVA Proxys in a Java Mapping - ExceptionInInitializerError

helmut_skolaut3
Active Participant
0 Kudos

Hi all,

I have created a Java Mapping where I am consuming a webservice where I have generated out of the WSDL a Java proxy:

I know, there is also another API for the valuemapping, but this is only working if you already are knowing the keys, not to give me all maintained keys.

When I am testing the Javamapping in NWDS, it is working as it supposed to be without any problems:

But when I am putting the JAR to ESR while testing it in the test tool, it fails in the codeline highlighted with the red star above with the exception

java.lang.ExceptionInInitializerError

I have temporairly removed the classes for the JAVA proxy that has lead into "Class not found" exception, so technically it can reach the classes. When I am catching the exception  ExceptionInInitializerError there is absolutely nothing that can be retrieved by method getCause().

I have also checked that all libraries used for the compilation are downloaded directly from the PI Server to avoid a version miss-match. The compiler settings are to use Java 5 and I am on a 7.11 PI system.

  • Could it be, that the Java mapping cannot use all resources needed to execute the WS Proxy?

  • Is there a way to use JAVA proxy in combination with the lookup api? I am sure I can access the Web Service using the lookup API, but I don't want to render the request message / access the response message using the DOM model, as it's much easier to handle it with the proxy.

Regards

   Helmut

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

You cannot call a web service directly from Java mapping. You need to use lookup service from Java Mapping API for this purpose. As Java Mapping is running inside an EJB, you are restricted in access to other resources. It might be interesting if it would be possible to call the Java Proxy EJBs directly without web service. I have never tried.

Answers (1)

Answers (1)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Helmut,

                  First you need to catch the exact error message of the exception being thrown.

can you please try this code

try{

           all lines of program code;

}

catch(Exception e)

{

          ByteArrayOutputStream baos = new ByteArrayOutputStream();

          PrintStream ps = new PrintStream(baos);

          e.printStackTrace(ps);

          ps.close();         

          StringBuffer errorString=new StringBuffer("Cause: "+baos.toString());

          getTrace().addInfo(errorString.toString());

          throw new StreamTransformationException(errorString.toString());

}

Regards

Anupam