aspose file tools*
The moose likes BEA/Weblogic and the fly likes Reg : Problem with .war deploytment in weblogic 10.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Reg : Problem with .war deploytment in weblogic 10.3" Watch "Reg : Problem with .war deploytment in weblogic 10.3" New topic
Author

Reg : Problem with .war deploytment in weblogic 10.3

Arunan Ramanathan
Greenhorn

Joined: Jul 31, 2007
Posts: 24
Hi All,

When i deploy my application in Exploded format, i can able to deploy and run the application in weblogic.

Now i wrote a build script and created a myapp.war file but i am not able to deploy the .war file. I got the below exception,

--------------------------------------------------------
weblogic.application.ModuleException: [HTTP:101216]Servlet: "LogConfigServlet" failed to preload on startup in Web application: "app.war".
java.lang.NullPointerException
at com.xxx.websat.timber.logging.LogConfigServlet.getLogRoot(LogConfigServlet.java:343)
at com.xxx.websat.timber.logging.LogConfigServlet.loadConfigFile(LogConfigServlet.java:246)
at com.xxx.bco.pl.transaction.util.logging.LogConfigServlet.init(LogConfigServlet.java:75)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1985)
at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1959)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1878)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)
at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:43)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:140)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
--------------------------------------------------------------------------------


Even when i unzip the war file, i can able to deploy it (So i think it is not the problem with the war file)

I am using the following lines in the web.xml to load the LogConfigServlet in startup.

-------------------------------------------------------------
<servlet>
<servlet-name>LogConfigServlet</servlet-name>
<servlet-class>com.xxx.bco.pl.transaction.util.logging.LogConfigServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

--------------------------------------------------------------

I decompiled the class LogConfigServlet and below is the source code where the null pointer exception thrown.

----------------------------------------------------------------

protected String getLogRoot()
{
String logRoot = getServletConfig().getInitParameter("logRoot"); // This is not configured in web.xml so logroot will be null here.
if(logRoot == null)
{
logRoot = getServletContext().getRealPath("/WEB-INF/lib");
logRoot = logRoot.substring(0, logRoot.lastIndexOf(File.separatorChar)); // This is where the i guess null exception will be thrown
}
return logRoot;
}

-------------------------------------------------------------------

Can anybody guess the problem. I am struggling with this issue for past 1 week. It would be great if someone help me on this.


Scjp 1.4 - 80%
Arunan Ramanathan
Greenhorn

Joined: Jul 31, 2007
Posts: 24
OOps sorry i found the solution,

public java.lang.String getRealPath(java.lang.String path)

Returns a String containing the real path for a given virtual path. For example, the path "/index.html" returns the absolute file path on the server's filesystem would be served by a request for "http://host/contextPath/index.html", where contextPath is the context path of this ServletContext..

The real path returned will be in a form appropriate to the computer and operating system on which the servlet container is running, including the proper path separators. This method returns null if the servlet container cannot translate the virtual path to a real path for any reason (such as when the content is being made available from a .war archive).


Parameters:
path - a String specifying a virtual path
Returns:
a String specifying the real path, or null if the translation cannot be performed

I am sticking in this issue for a long time Hope this helps someone else

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reg : Problem with .war deploytment in weblogic 10.3
 
Similar Threads
jars on axis classpath from within service?
ExceptionInInitializerError when I deploy application on Managed server on Weblogic91
Servlet failed to preload on startup in Web application
Servlet failed to preload on startup in Web application
Servlet: "action" failed to preload on startup in Web application: "MyAPPName"