Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem in deploying a war file in Weblogic 7.0

Status
Not open for further replies.

rajihari

Programmer
Apr 2, 2003
2
US
Hi,
We developed our application in Weblogic 7.0. It is working fine. I tried deploying the exploded directory in weblogic 7.0, it also works fine. But when v tried to deploy the war file in the Weblogic 7.0, I'm getting the following error.

********************************************

<Apr 2, 2003 9:29:47 AM EST> <Error> <HTTP> <101216> <Servlet: &quot;StartupServlet&quot;
failed to preload on startup in webapp: &quot;gsda&quot;
javax.servlet.ServletException
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
pl.java:912)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
Impl.java:833)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java:773)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppS
ervletContext.java:2763)
at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebApp
ServletContext.java:2708)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAp
pServletContext.java:2681)
at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServl
etContext.java:4746)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:539)
at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer
.java:983)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContai
ner.java:1017)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(Sla
veDeployer.java:1112)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDep
loyer.java:732)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHan
dler.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
>

****************************************

We are following the dir structure as specified in weblogic documentation. We have placed the helper .jar files in /Web-Inf/lib dir.

Any clue would be of great help. Pls this is very urgent.

Thanks
Raji
 
Hi Raj,

i am facing the Same Problem,

the problem bcas of any startup class which will call class loader and in turn it will load some properties file using the url from the class loader.

i didn't get any solution for that.

its very urgent, culd you pl send me what did you did for this problem
 
I've also had this same problem. Does anyone have a solution?

------
KJR
 
Hi,
V have solved this problem.
The problem was in my StartupServlet.
In the servlet v used the following to find the root of the application. After finding the root of application, v used the value to access a file stored in that path. Like

String appPath = getServletContext().getRealPath(&quot;/&quot;);
FileInputStream fis = new FileInputStream(appPath + &quot;/WEB-INF/config/appConfig.cfg&quot;);

This getRealPath() method works fine if v use the exploded directory format. But it throws Null when v use the .war file to deploy.

To avoid this problem, don't use getRealPath method, if u r using .war format for deployment.

Instead, use getResourceAsStream() method of ServletContext to convert the file to Stream. (i.e) use something like this.

InputStream fis = getServletContext().getResourceAsStream(&quot;/WEB-INF/config/appConfig.cfg&quot;);

Hope this helps. Pls get back for any clarifications.




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top