cancel
Showing results for 
Search instead for 
Did you mean: 

Java mapping - Unable to find resource

Former Member
0 Kudos

Hi all,

I have written a java mapping in NWDS on my local machine using external libraries

(e.g XMLStreamReader from stax-api-1.0.1.jar). Locally the program is working OK. But when I use it in XI mapping I got this error :

Unable to find resource javax/xml/stream/XMLStreamReader.class .. What might be the problem and how to fix it ?

So I think that the stax-api-1.0.1.jar is missing on XI server. Where and how the missing jar should be put on XI? Or it is something else ?

Thanks for helping.

BR, Janos

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Solved. Only need to import the external lib as mapping archive in the same namespace.

Former Member
0 Kudos

Hi all

From your answers so far I understood that the external libraries must be deployed on XI J2EE engine. I managed to deploy all external libs that I call in java mapping using the NWDS and DCs... Now I see them listed in VA.

But the mapping still doesnu2019t work. Thus my next question isu2026 how to include the external libraries in java mapping ( I did java mapping archive - Export jar file from an java project in NWDS)

Also please explain if the package name in java mapping is somehow important?

Thanks Janos

rajasekhar_reddy14
Active Contributor
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Ray,

I am trying to export jar file with all requred files, but somehow tha mapping on XI is still not working. Can you provide me with instruction how you do it.

Thanks Janos.

former_member732072
Active Participant
0 Kudos

This message was moderated.

stefan_grube
Active Contributor
0 Kudos

stax is part of Java 1.6, but PI 7.1 runs with Java 1.5.

You cannot use stax inside PI.

Regards

Stefan

Former Member
0 Kudos

Hi,

Thanks for the answer. I have PI 7.0 with j2sdk 1.4. 2. So you are saying that it is not possible to import any external libraries into XI?

Am I asking this because I can compile the same program with Ant and run it standalone on XI server (I have just put all external jars on XI server in directory where I compile with Ant.)

My scenario requires that the payload is encoded before sending to the external system.

This is the code that was supplied as a template.. So I am asking which other functions can be used on XI, instead of these, to achieve the same?

XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(in))

StAXOMBuilder builder = new StAXOMBuilder(parser);

OMElement documentElement = builder.getDocumentElement();

//encode

HexBinary payloadXML = new HexBinary(documentElement.toString().getBytes("UTF-8"));

u2026

BR, Janos

agasthuri_doss
Active Contributor
0 Kudos

Hey,

>I have PI 7.0 with j2sdk 1.4. 2. So you are saying that it is not possible to import any external libraries into XI?

No, It is possible

>Unable to find resource javax/xml/stream/XMLStreamReader.class

Check whether the appropriate package is included & try to handle the exception with Class XMLStreamException .

When ever you use - XMLStreamReader you need to handle the excpetion with respective Javax.xml.stream.XMLStreamException

Cheers

Agasthuri

stefan_grube
Active Contributor
0 Kudos

I know from a colleague that he tested STAX on PI 7.1

So there should be a possibility to add the STAX library to PI as external definition.

Unfortunately I do not know any details of this.