cancel
Showing results for 
Search instead for 
Did you mean: 

Error in ExcelTransform Bean

apu_das2
Active Contributor
0 Kudos

Hi Eng,


I am trying to implement excel to xml conversion from your below blog -

ExcelTransformBean Part 1: Convert various Excel ...


But After deploying it in my java stack I am getting below error and its deployed with warning as well -


Error while obtaining business methods info for bean sap.com/Excel2XMLTransformerEAR*xml|Excel2XMLTransformerEJB.jar*xml|Excel2XMLTransformer. Most probable reason: application sap.com/Excel2XMLTransformerEAR cannot be started. See logs available for this application.


These are the steps I have followed. I think I have done something wrong. Can you please help me -


1. Created EJB 3.0 project with name Excel2XMLTransformerEJB and added to EAR - Excel2XMLTransformerEAR

2.  Added all required jars in ejb project build path.

3. In EJB project created one session bean (EJB 3.x) with name Excel2XMLTransformer.


Created normal class with below names -


AbstractModuleConverter

AuditLogHelper

DynamicConfigurationHelper

ParameterHelper

4.  Build the EJB project

5. My ejb-j2ee-engine.xml value -

6. My ejb-jar.xml value -

7. Export as SAP EJB JAR File

8. In EAR application-j2ee-engine.xml value -

9.  Build and export as SAP EAR File.

10. Finally Run on server. its deployed with warning.

Can you please help me with the correct and exact steps. Its very urgent .Sorry I can send you direct message because of no direct connection.

Thanks in advance for you help.

Regards,

Apu

Accepted Solutions (0)

Answers (2)

Answers (2)

engswee
Active Contributor
0 Kudos

Hi Apu

First of all, please confirm that you are using the correct NWDS version for your system

Secondly, Excel2XMLTransformer is no longer a standalone module and needs to be executed via . I see that FormatConversionBean.java and it's related dependencies are not included in your project.

Lastly, if you still cannot resolve the issue, I'd suggest that you follow the steps on the following post to setup the project correctly. This ensures everything is in place.

Regards

Eng Swee

apu_das2
Active Contributor
0 Kudos

Hi Eng,

Now I have implemented FormtTransformBean like below and now I am not getting any error in NWA application Modules and the deployment in the server was successful without any warning. But when I am using this in my sender CC I am getting below error -

Steps followed to build the project -

1. Created EJB 3.0 project with name FormatConversionBeanEJB and added to EAR FormatConversionBeanEAR

2.  Added all required jars in ejb project build path.

3. In EJB project created one session bean (EJB 3.x) with name FormatConversionBean.

    Created normal class with below names and below package -

4. ejb-j2ee-engine.xml -

5. ejb-jar.xml -

6. In EAR application-j2ee-engine.xml -

Please suggest.

Thanks,

Apu

former_member182412
Active Contributor
0 Kudos

Did you include Apache POI jar to the build path?

engswee
Active Contributor
0 Kudos

Yup, as Praveen mentioned, looks like the Apache POI files are missing from the EAR bundle.

Can you provide screenshot of the Build Path > Libraries?

apu_das2
Active Contributor
0 Kudos

Hi Eng,

if Apache POI was missing in my project then I think it shoyld give me error at the time of build the EJB. But, In my case its build successfully and deployed in Java stack without any warning.

Please find the screen shot of my project -

Thanks,

former_member182412
Active Contributor
0 Kudos

Hi Apu,

You created the variable and add these jars to the variable, if you add it to variable it wont be include it in EAR file, you need to add it using Add External Jars option, only sap jars you need to add it to variable because they are already deployed in PI server.

Regards,

Praveen.

engswee
Active Contributor
0 Kudos

I think it's the other way around. I checked my EJB project and the Apache POI libraries are added as Variables and not External JARs.

Once you have done so and redeploy using Run As > Run On Server, you can check the generated EAR file should contain the Apache JARs

former_member182412
Active Contributor
0 Kudos

Hi Eng/Apu,

Sorry i used the wrong word instead of user library i used variable, If you created user library and add the jars to user library then these libraries are not added to EAR file.

If you add the jars to variable or external library then jars will added to EAR file.

Regards,

Praveen.

engswee
Active Contributor
0 Kudos

Yup correct.

For the Apache POI JAR files, you need to use either variable (which is what I do) or external JAR

For the PI adapter libraries, you need to use User Library (so that it is not included in the EAR bundle)

apu_das2
Active Contributor
0 Kudos

Hi Eng/Praveen,

Now I have deleted existing POI library from variable and added as external library , re build it and deployed again but still same issue -

Thanks,

engswee
Active Contributor
0 Kudos

Obviously you are not following what I said. I recommended you to use Variable for the Apache POI library.

If you are facing so much issue, you should just use EGit and clone the repository from GitHub. That is the most accurate way to have a correctly set up project as this is a very complex project.

former_member182412
Active Contributor
0 Kudos

Hi Apu,

Did you add it using Add External JARs.. option??

You can use either Add ExternalJARs option or Add Variable option, after you add without deploying into the server you can check these jars are added to the EAR file or not by right click on EAR project and Export->SAP EAR File to the local directory, open it using winzip tool see the jars are exist or not.

apu_das2
Active Contributor
0 Kudos

Hi Eng,

Now I have done this as you have said. But now its not able to resolve the import packages. Can you help here -

former_member182412
Active Contributor
0 Kudos

Hi Apu,

You created the variable but you did not add the jars to it.

Select the variable and click on edit.

Click on Extension

Select the required jars from the folder.

I see you already added the user library also, remove the user library.

Regards,

Praveen.

apu_das2
Active Contributor
0 Kudos

Hi Praveen,

Thanks for your prompt reply. I have changed it and done like below now . But still same error at run time -

former_member182412
Active Contributor
0 Kudos

Hi Apu,

First check the jars added to the EAR file like i said earlier(Export EAR file to local directory), make sure EAR file got required jars or not.

If you still face problems follow what eng said.

"If you are facing so much issue, you should just use EGit and clone the repository from GitHub. That is the most accurate way to have a correctly set up project as this is a very complex project."

Regards,

Praveen.

apu_das2
Active Contributor
0 Kudos

Hi Praveen,

I have extracted the EAR file but cant see any poi libraries there. It looks like I am doing some silly mistakes. Let me tell you how I am adding so that you can help me further -

1. Windows -> Preferences -> Java -> Build Path -> CassPath Variables -> Added EXT_LIB which will point poi jars.

    Windows -> Preferences -> Java -> Build Path -> User Libraries -> New PI_LIB -> Add Jars -> Added 4 system Jars.

2. Right click on EJB Project -> Build Path -> Configure Build Path .. -> Java Build Path -> Libraries -> Add Variable -> EXT_LIB -> Extend -> Select poi jars -> ok

    Add Library -> User Library -> Next -> Select PI_LIB -> Finish

3. Build EJB Project. Export SAP EJB JAR FILE

4. Build EAR Project. Export as SAP EAR FILE

5. Right click on EAR Project -> Run AS -> Run on Server.

Here is the content after extracting local exported EAR File ->

apu_das2
Active Contributor
0 Kudos

Guys, Any input?

engswee
Active Contributor
0 Kudos

Apu

It's very difficult to pinpoint why it's not working in your case because we cannot be sure if the project is set up correctly on your end in the first place. Classpath variables or external JARs work perfectly fine on my side so I don't know why it's not working on yours.

Your best bet is to use the approach I've detailed below. Otherwise, it's just not possible to support this further.

Regards

Eng Swee

engswee
Active Contributor
0 Kudos

Hi Apu

Any updates for this thread? Were you able to set up the project properly in the end?

Regards

Eng Swee

apu_das2
Active Contributor
0 Kudos

Hi Eng,

Thanks that you remember my post. Basically its not possible to install Plug in for EGit in my NWDS system as I access this through Citrix and has no access to install further plugin and client is not agree to for that even.

I understood that this Module is not working as poi jars are missing in my EAR at the time of deployment. Its a bit strange a I think I have done everything properly. Dunno why still its not adding at the time of deployment and in Channel I am getting Class Not Found error.

Thanks,

Apu

engswee
Active Contributor
0 Kudos

Hi Apu

One other option is to manually add the POI JAR files into the EAR file. Once you export the EAR file using Export > SAP EAR File. Then open the EAR file with a tool like 7-Zip and manually add the files into the archive. After that, you can use the Deployment perspective in NWDS to deploy the manually modified file.

Regards

Eng Swee

apu_das2
Active Contributor
0 Kudos