cancel
Showing results for 
Search instead for 
Did you mean: 

Encountering- Unable to find resource JXL- while testing java mapping in IR

Former Member
0 Kudos

Hi ,

I am working on JXL API IN XI ForCreating EXCEL ATTACHMENT Using JAVA MAPPING.

I had imported the java program using imported archives in IR. when I tested the mapping program in xi . I am facing the following error .

" UNABLE TO FIND RESOURCE jxl/write/WritableWorkbook.class in the following software component version."

Also please let me know the procedure for deploying external jars like jxl api into j2ee engine with out using NWDS.

I am using XI 3.0 with sp 20.

Advance Thanks

Best Regards

Ram

Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

in case you are using java mapping, no ear files needs to be deployed. But make sure in your java mapping project, you have included the jxl api and its jars and the same is part of the .jar or .zip file you have imported into PI/XI

Former Member
0 Kudos

Hi Sabharish,

Thanks for your quick response.

I have imported the java mapping program via ImportedArchive in IR.My Imported Archive now has the following :

<MessageAttachment.java>

<MessageAttachment.class>

<jxl.jar>

respectively.Also i ensured that all the required objects are in same namespace.

When i try testing the java mapping, iam getting the error mentioned above.

Iam struck at this point.Pls let me know whether there is any need to deploy the jxl.jar at the server-level i.e, j2ee engine?

I also tested the program in Eclipse, its running sucessfully.

Best Regards,

Ram.

former_member187339
Active Contributor
0 Kudos

Hi Ram,

>>jxl/write/WritableWorkbook.class

It is failing because WritableWoorkbook classwas not found in you archive.

1. create a project in nwds

2. import the jar files which you are using in it

3. al then write you code

4. later collectively make a jar file (it should have class file for your code, jar files all necessary files)

5. import this jar in XI, it will work

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

Appreciate your kind reply.

But, i do not have NWDS.

Any work around please !

Regards,

Ram.

former_member187339
Active Contributor
0 Kudos

Hi Ram,

Do you have any other ide? Like eclipse

IF you dont have anything. Put all the needed files (jar etc) along with the code in a folder and complie.

Then you will have the class file for all. Jar it and import it in XI

Regards

suraj

Former Member
0 Kudos

Hi Suraj,

I tested java mapping program in eclipse successfully.

As you mentioned i already compiled my java mapping program in eclipse and wrapped all the required files( .java, .class, jxl.jar ) as a jar and able to import in xi using imported archive.

When iam testing my java mapping program in IR, iam getting the error i mentioned at the beginning.

Regards,

Ram.

former_member187339
Active Contributor
0 Kudos

Hi Ram,

>>jxl.jar

Does this have all the jar files which you are referring? Generally this error happens because of the missing class files (there might be java code, which editors like eclipse compile and use, but XI cannot)

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

Do i need to do any settings in my PC ? Iam not sure what to give in MYCOMPUTER>PROPERTIES>ADVANCED--->ENVIRONMENTAL VARIABLES. ??

I have checked "C:\Program Files\Java\jre1.5.0_05" folder it has "bin" & "lib" folders respectively.

FYI...in my PC, i couldn't find any JDK folder in the path C:\Program Files\Java\....( Am i missing something here ! )

Do i need to download the aii.map.api.jar file and place it in bin folder??

The jar file aii.map.api.jar resides in the XI server.Do i need to again download and place in particular path in my PC?? i have no idea !!

Your kind inputs please....

Regards,

Ram.

former_member187339
Active Contributor
0 Kudos

Hi Ram,

>>Do i need to do any settings in my PC ? Iam not sure what to give in MYCOMPUTER>PROPERTIES>ADVANCED--->ENVIRONMENTAL VARIABLES. ??

For creating the jar file you need to do this settings. But if you use eclipse all this can be done in the IDE itself

>>FYI...in my PC, i couldn't find any JDK folder in the path C:\Program Files\Java\....( Am i missing something here ! )

if you do not have jdk how was you able to make the .class file? Recheck the jar (which is imported in PI) and see whether there it is haviing class or java file in it

>>Do i need to download the aii.map.api.jar file and place it in bin folder??

This depends on your code, to be in a safe side include it in the project folder of eclipse and together make a jar file

>>The jar file aii.map.api.jar resides in the XI server.Do i need to again download and place in particular path in my PC?? i have no idea !!

yes

Regards

Suraj

Former Member
0 Kudos

Hi Vijay,

We deployed JXL jar along with the mapping program in the imported archive(IR).Now my requirement is to make my java program read the incoming values fronm RFC(sender) and populate the standard excel template in the particular place holders of the excel sheet. this excel sheet was placed in the jar file but the pgm is not able to read from that location. So I tried placing in the applications server of XI . But not able to read from that location too.

.

the error i am gettiing is "no such file/directory"

if the program reads from the location ( FTP/NFS/XISERVER) the generated EXCel should go as an attachment to the receiver using mailreceiver adapter.

my question is how to read excel template from the above mentioned locations using java mapping program?

I have given the code as follows in my mapping( i referred to ur blog for excel creation using jxl API)

WritableWorkbook workbook2 = Workbook.createWorkbook(out, Workbook.getWorkbook(new File("file://geleshare//XT2//test//outbound//XXYYZZ.xls")));

WritableWorkbook workbook2=this.getWorksheet(out);

Pls suggest how i can populate the .xls template , any code samples to achieve this.....waiting for your kind reply

Regards,

Ram.

Former Member
0 Kudos

Hi Suraj,

Thanks for your valuable replies....i could solve the mapping error in IR

Cheers,

Ram.

former_member187339
Active Contributor
0 Kudos

Hi Ram,

Glad I was able to help your in IR

Now I can see that you are planning to read the template file

You can put the template in the same jar file (which imported in IR ) and can access it using relative path like new File (outbound/XXYYZZ.xls)

or are you trying to read the template from some FTP directory

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

I am doing both reading the excel cells in the template and then populating witth RFC(sender) data in to place holders of the excel template.

I tried placing the excel template in the jar itself....but mapping program is unable to read the excel from that jar.

How to make my java program read this excel template placed in jar? or if you know any other workaround it is highly appreciable.

Best Regards,

Ram

former_member187339
Active Contributor
0 Kudos

Hi Ram,

I guess this is the first problem which you have

>>How to make my java program read this excel template placed in jar?

Actually when you say new File (filename) and ur filename is XYZ.xls then the system thinks this to be part of the same folder. if it is mentioned as \folderA\XYZ.xls, then it will first search for FolderA inside the current folder and then the file XYZ

Now the current folder is the folder where the java class file exists. have you followed any folder structure for your class file then place the xls in the same folder and refer new File (XYZ.xls)

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

As you told i already tested ---I placed the .xls file and my MessageAttachment.class file in the same folder....but my java program is unable to locate this .xls !

thanks for your quick response ,

Regards,

Ram.

former_member187339
Active Contributor
0 Kudos

Hi Ram,

>>I placed the .xls file and my MessageAttachment.class file in the same folder

Hope you have re-compiled and re-imported the archive.

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

Yes i did....but no luck.

Best Regards,

Ram.

Former Member
0 Kudos

Hi Suraj,

Many thanks for your help.As i was completely immersed in my work due to tight time-lines.I couldn't reply.As you mentioned when i re-import and re-did all the important tasks..it worked...strange experience though!

Full points to you

Now iam embarkig on XSLT mappings and JAVA code in XSLT mapping .... u can catch me again here !!

till then...bye

cheers,

Ram.

Answers (2)

Answers (2)

Former Member
0 Kudos

assaign jxl.jar to your class as

Project--> Properties --->Java Build Path -> Libraries--->Add External Jars to assign the libraries to your project.

also debug your class in NWDS before loading in PI

refer /people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio

shweta_walaskar2
Contributor
0 Kudos

Hello Ram,

As mentioned by Shabarish,please create an imported archive of jxl.jar in the same namespace.

The code should work then.

Thanks.

Regards,

Shweta