cancel
Showing results for 
Search instead for 
Did you mean: 

webapplication can't load external jar files

Former Member
0 Kudos

Hello,

I want to migrate an application to the NetWeaver SP11. But when I deploy the EAR file I get an error for each linked jar file. Here is an example of the message from the system.log.


Error in method getResourceAsStream(log4j.jar). The error is: A resource path must begin with [ / ]. The error occurred in {0}.

The EAR File contains a simple web-application based on JSF and the MyFaces framework. The jar files are located in the WEB-INF/lib directory and also present in the build path of the web-module project.

The amazing thing is that the application was working well. This problem occurs since the SAP NetWeaver Developer Studio crashed yesterday.

Has anybody an idea?

thanks a lot, Daniel

Message was edited by: Daniel Heise

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI

This can happen only if you are not using NWDS to Build and deploy , since if you are adding some jar\s in the classpath of the web project , at the time of building th web application it add these claspath jars in the web-inf\lib folder . please check whether you have all the required jar files in the Ear file u r deploying .

Hope this helps , do not forget to reward points

regards

rajesh kr

Message was edited by: Rajesh K. R.

Former Member
0 Kudos

Hi Rajesh,

I use the NWDS to develop, build and to deploy the application. All jars are linked to the web-project (not with the ear-project).

The deployed EAR file contains the WAR file from the web-project which also includes the linked jar files in the WEB-INF/lib directory. This means all required jars are deployed.

By the way: I have another project in the NWDS which is set up the same way like this (same framework, same jars, same structure). This project produces no errors while deploying.

I also set up a new project and imported all data from the old one. This also produces the same errors while deploying.

very freaky!?!

another idea?

Daniel

Former Member
0 Kudos

Hi

Are you using getResourceasStream() method in your code ?

regards

rajeshkr

Former Member
0 Kudos

No.

I think the method is called by the application server or the framework while initializing some classes (perhaps a servlet or something).

In the meantime I got the application running although the error is still present.

The problem appeares only while deploying. Navigating through the application raises no new error messages. It seems that the application has access to the jars.

Should I ignore the error messages?

Daniel

Former Member
0 Kudos

Some blank posts because I got some errors while posting my message. After going back and sending again the message was posted multiple.

Former Member
0 Kudos

blank

Message was edited by: Daniel Heise

Former Member
0 Kudos

blank

Message was edited by: Daniel Heise

Former Member
0 Kudos

blank

Message was edited by: Daniel Heise

Former Member
0 Kudos

blank

Message was edited by: Daniel Heise

Former Member
0 Kudos

blank

Message was edited by: Daniel Heise

Former Member
0 Kudos

Hi

Can you please check the defaultLog.trc . And post the error stack trace .

regards

rajeshkr

Former Member
0 Kudos

Hi

Can you please check the defaultLog.trc . And post the error stack trace .

regards

rajeshkr

Former Member
0 Kudos

Hi

Can you please check the defaultLog.trc . And post the error stack trace .

regards

rajeshkr

Answers (2)

Answers (2)

Former Member
0 Kudos

@all

The problem is solved and the reason was a special character in the web.xml which the WAS couldn't interpret.

Former Member
0 Kudos

Hi,

close NW, delete the project into your workspace. Then follow these steps in order to import your project:

To import a WAR:

- Create a J2EE Web Module Project in NW

- Copy wars/WEB-INF/* into project/WEB-INF

- Copy wars/* in project/webContent

To import EAR:

- Create a J2EE Ent. Application Project in NW

- Copy ears/META-INF/application.xml into project/META-INF

- Copy ears/*.jar into project/

Hope this help you.

Vito

Please mark helpful answers