cancel
Showing results for 
Search instead for 
Did you mean: 

Java Mapping - Not able to compile .Java file

Former Member
0 Kudos

Hi Experts,

I am working with a sample scenario which involves Java Mapping. For this I created MappingClass.java file, After compiling the .Java file .Jar file would be used for Java Mapping by using Imported Archives.

After compiling the MappingClass.java file, I am getting the errors as below.

--> Java errors after compilation

C:\j2sdk1.4.2_13\bin>javac MappingClass.java

MappingClass.java:4: package com.sap.aii.mapping.api does not exist

import com.sap.aii.mapping.api.AbstractTrace;

^

MappingClass.java:5: package com.sap.aii.mapping.api does not exist

import com.sap.aii.mapping.api.StreamTransformationConstants;

--> End of java errors

In the MappingClass.java file, I had given followed imports.

import java.util.*;

import com.sap.aii.mapping.api.AbstractTrace;

import com.sap.aii.mapping.api.StreamTransformationConstants;

Could some one please guide me to resolve this issue.

Thanks in advance.

..Sree

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi.

Are u sure that the following library is in the build path?

aii_map_api.jar

You can find this jar into the directory

/usr/sap/GXD/DV<SystemNumber>/j2ee/cluster/server0/apps/sap.com/com.sap.xi.services

of your xi box

Hope this help

Francesco

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sree,

I guess you are compiling the file using the standard libraries provided by J2sdk...thts why it is giving such error..

Use either of the IDE

1. NWDS (NetWeaver Development Studio)

2. Eclipse.

for developing and compiling the java code....

It would be much easier.

<b>And you need to add a jar file (for com.sap.aii related packages) to the existing set of libraries.....this functionality is provided in both of the IDEs</b>

Hope this helps..

Regards,

<b>Sushil Hadge</b>

Former Member
0 Kudos

Hi Sushil,

Thank you so much, for your reply.

I had worked with J2SDK and compiling the .java file. As you said, I will try with NWDS or Eclipse IDE.

Regards,

Sree

Former Member
0 Kudos

Yes, it would be easy with NWDS but you should be able to do with J2SDK also. Only thing you need to make sure is, put all the required class/jar files in the classpath.

Before you compile run and run the java program, check with

ECHO Classpath from command prompt to see all the required jar files are in classpath.

--Archana

Former Member
0 Kudos

Archana,

Can I use the .jar file which would be generated in some other system (which is having NWDS/Eclipse IDE environment). I mean, I will copy that .jar file and copy in Java Class Path in my system. Is that Ok ?

Or

do I need to have some IDE in my system to use the .jar for Java Mapping ?

Thanks.

..Sree

Former Member
0 Kudos

no, you dont need to have an IDE for using jar file. For your java mapping program to compile just put this jar file in classpath.

--Archana

agasthuri_doss
Active Contributor
0 Kudos

Hi,

Can I use the .jar file which would be generated in some other system (which is having NWDS/Eclipse IDE environment). I mean, I will copy that .jar file and copy in Java Class Path in my system. Is that Ok ?

-


> It will do

Regards

Agasthuri Doss

moorthy
Active Contributor
0 Kudos

Hi,

Are u planning to run the java mapping program independently as an java application? Then you can do this.

<i>do I need to have some IDE in my system to use the .jar for Java Mapping ?</i>

>>If you import .jar file in the Integration Repository-->Imported Archives directly, then no need of an any IDE for that

Rgds,

Moorthy

Former Member
0 Kudos

Thank you. I will try with .Jar file by putting jar file in the Class path.

..Sree

Former Member
0 Kudos

Moorthy,

Thank you. I will import the Jar file using 'Imported Archives' option and try.

..Sree

Former Member
0 Kudos

Hi

I had copied " aii_map_api.jar " file in my Java Class path folder.. i.e " C:\j2sdk1.4.2_08\bin " AND " C:\j2sdk1.4.2_08\lib " folders too.. and even in C:\ i.e Root Drive also.

After trying to Compile my java file (ex : MappingClass.java), still I am getting the errors.

Errors shown as below.

--> Errors

C:\mytest>javac MappingClass.java

MappingClass.java:2: package com.sap.aii.mapping.api does not exist

import com.sap.aii.mapping.api.AbstractTrace;

^

MappingClass.java:3: package com.sap.aii.mapping.api does not exist

import com.sap.aii.mapping.api.StreamTransformationConstants;

^

MappingClass.java:6: cannot resolve symbol

symbol : class AbstractTrace

location: class MappingClass

private static AbstractTrace trace = null;

^

MappingClass.java:12: cannot resolve symbol

symbol : class AbstractTrace

location: class MappingClass

trace = (AbstractTrace)inputparam.get(

^

MappingClass.java:13: cannot resolve symbol

symbol : variable StreamTransformationConstants

location: class MappingClass

StreamTransformationConstants.MAPPING_TRACE );

^

5 errors

--> End of Errors

Could some one please guide me to resolve this issue.

Thanks in advance.

..Sree

Former Member
0 Kudos

Hi Sree,

try to follow this document:

<a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/classpath.html">Setting the class path</a>

I think that the correct steps are:

put your jar file into a particular folder; i suggest c:\java_libraries or something like that;

use the command:

javac -classpath C:\java_libraries MappingClass.java

Anyway i suggest you to install <a href="http://www.eclipse.com">Eclipse</a> that really simplify all the java development, and i can also suggest you to install the eclipse plugin from: <a href="http://sourceforge.net/projects/classlocator">classlocator</a>

It's really helpful to look for the correct library and add it in the application classpath.

Hope this help

Francesco

Former Member
0 Kudos

Hi Francesco,

I had set my Java Class path correctly and tried by copying the "aii_map_api.jar" file in the folder location my java file was there. Also I had tried with different options like copying aii_map_api.jar file in "C:\j2sdk1.4.2_13\bin" , "C:\j2sdk1.4.2_13\lib".

Still I am getting the same 5 errors, after compiling the MappingClass.java file.

-->

C:\mytest>javac MappingClass.java

MappingClass.java:4: package com.sap.aii.mapping.api does not exist

import com.sap.aii.mapping.api.AbstractTrace;

^

MappingClass.java:5: package com.sap.aii.mapping.api does not exist

import com.sap.aii.mapping.api.StreamTransformationConstants;

^

MappingClass.java:7: cannot resolve symbol

symbol : class AbstractTrace

location: class MappingClass

private static AbstractTrace trace = null;

^

MappingClass.java:13: cannot resolve symbol

symbol : class AbstractTrace

location: class MappingClass

trace = (AbstractTrace)inputparam.get(

^

MappingClass.java:14: cannot resolve symbol

symbol : variable StreamTransformationConstants

location: class MappingClass

StreamTransformationConstants.MAPPING_TRACE );

^

5 errors

-->

Can you please suggest, how to resolve this issue.

Thanks in advance.

..Sree

agasthuri_doss
Active Contributor
0 Kudos

Hi Sree,

1) Check whether you have right class file

2)Check whethere right folder (Java Home ) you have used it ( C:\j2sdk1.4.2_13\bin )

3) For the Package -

1)import com.sap.aii.mapping.api.AbstractTrace;

2)import com.sap.aii.mapping.api.StreamTransformationConstants;

Might not have included the lib file or might not available in the right path.

Regards

Agasthuri Doss