weblogic 11g R1 - deployment

I have prepared my ejb jars and war using weblogic.appc
weblogic 11g R1, all compilations were fine, I have prepared ear and deployed in weblogi server .I am getting belows erorr. afte deployment and ear status went to failed state.
I am not att all using this oracle.help.OHW file. don't know it is refered
Can any suggest how comeout of this problem.
[HTTP:101216]Servlet: "OHW" failed to preload on startup in Web application: "cbcm". javax.servlet.ServletException: [HTTP:101249][ServletContext#13514259[app:cbcm module:cbcm path:/cbcm spec-version:null]]: Servlet class oracle.help.OHW for servlet OHW could not be loaded because the requested class was not found in the classpath . java.lang.ClassNotFoundException: oracle.help.OHW. at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:551) 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.EarDeployment.activate(EarDeployment.java:58) 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:209) at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

Check your web.xml within your WAR, there is a servlet and servlet-mapping for the Oracle help files and this servlet most likely.
Comment out those.

I received the same error as "failed to preload on startup in Web application:".
Below is how I am able to resolve the error.
in your web.xml, check if following property is present
<load-on-startup>0</load-on-startup>
this property is to load your bundled artifacts during the server restart itself. This was the cause of the issue because there were some jar file which weblogic server required to load before the loading of our bundled artifacts. Now since server is not yet started completely and all the libraries required to our application is not yet loaded, hence server is throwing "failed to preload on startup in Web application:".
The solution to this is remove load-on-startup from web.xml and That's it!!

Related

How to find missing classes in a webapp running in JBoss EAP 7.4?

My webapp running on JBoss EAP 7.4 is having problems locating certain classes. When I run, I see the following in the log:
2022-08-02 14:30:52,387 WARN [org.jboss.modules.define] (default
task-2) Failed to define class
org.apache.phoenix.schema.MetaDataSplitPolicy in Module
"deployment.dbp.rest-1.1.0-SNAPSHOT.war" from Service Module Loader:
java.lang.NoClassDefFoundError: Failed to link
org/apache/phoenix/schema/MetaDataSplitPolicy (Module
"deployment.dbp.rest-1.1.0-SNAPSHOT.war" from Service Module Loader):
Failed to link
org/apache/phoenix/schema/SplitOnLeadingVarCharColumnsPolicy (Module
"deployment.dbp.rest-1.1.0-SNAPSHOT.war" from Service Module Loader):
org/apache/phoenix/compat/hbase/CompatSteppingSplitPolicy
MetaDataSplitPolicy and SplitOnLeadingVarCharColumnsPolicy are present in our war file, but CompatSteppingSplitPolicy is not. The /usr/lib/phoenix/phoenix-hbase-compat-2.4.1-5.1.2.jar file contains CompatSteppingSplitPolicy. Adding external modules directories in JBoss EAP 6/7 tells how the classpath be extended to deployed content reference directories and files external to the installation. I modified my .bashrc accordingly, and the log file now includes:
module.path = /opt/jboss-eap-7.4/modules:/usr/lib/phoenix/phoenix-hbase-compat-2.4.1-5.1.2.jar:/usr/lib/phoenix/*
Unfortunately, I still get the same error. What can I do to fix it?
why not adding the jar in your war ? otherwise you need to add a dependency on that module in your war

WebLogic Server Version: 12.1.2.0.0 Attempting to precompile

I am deploying my JAVA EE ear app. as usual in WL server,
but suddenly it seems that everytime WL is trying precompile all the JSP again and the deployment take ages
12.1.2.0.0.>
ST> <Info> <HTTP> <BEA-101343> <my_devices: Attempting to precompile /WEB-INF/jsp/template/header.jsp, since the class file associated with it was found to be out-of-date.>
ST> <Info> <HTTP> <BEA-101295> <Recompiling JSP [ServletContext#29540787[app:my_devices module:my_devices path:null spec-version:3.0]], resource [/WEB-INF/jsp/template/popupHeader.jsp], because it is stale. It was previously compiled using a different version of WebLogic Server.
12.1.2.0.0.>
Precompile is a good thing !!
But if you want to disable it to get a faster deployment, change your weblogic.xml file and include the following:
<jsp-descriptor>
<jsp-param>
<param-name>precompile</param-name>
<param-value>false</param-value>
</jsp-param>
</jsp-descriptor>
That should help you on this !

How to use log4j in an EJB Module with WebLogic?

I have included the log4j.jar in libraries;
added log4j.xml in the sources folder;
but I m getting an error:
**<Apr 22, 2014 11:07:50 AM PKT> <Warning> <EJB> <BEA-010065> <MessageDrivenBean threw an Exception in onMessage(). The exception is:
java.lang.NoClassDefFoundError: org/apache/log4j/Logger.
java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at test.MyMessageBean.onMessage(MyMessageBean.java:39)
at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:575)
at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:477)
at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:375)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4855)
Truncated. see log file for complete stacktrace**
I have also tried including classpath: .\lib\log4j....jar in the MANIFEST.MF
but still no positive response..
Kindly guide me how to resolve this???
Use Java Util Logging, which is included in the JEE spec. No additional jars have to be added.
Whether it's EJB Module or you are working on some other application with WebLogic Server;
it requires a configuration Process; you can go through the links given below:
[http://techworldrocks.wordpress.com/2012/08/16/configure-log4j-logging-for-weblogic-server-log/][1]
[http://docs.oracle.com/cd/E24329_01/web.1211/e24428/config_logs.htm#i1014785][1]

java.lang.ClassNotFoundException for a class in external JAR

I have a maven project in Eclipse Java EE IDE for Web Developers.
When running Tomcat, I'm getting an error for a class that I can see that I have included.
My question is - do I have to add these JARs to an additional place because of Tomcat Apache?
Error:
SEVERE: Servlet /Resource threw load() exception
java.lang.ClassNotFoundException: org.odata4j.jersey.producer.resources.ODataApplication
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:171)
at com.sun.jersey.core.reflection.ReflectionHelper.classForNameWithException(ReflectionHelper.java:240)
at com.sun.jersey.core.reflection.ReflectionHelper.classForNameWithException(ReflectionHelper.java:220)
at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:711)
And here is the class in my Library:
UPDATE:
My Web Deployment Assembly looks like:
The issue you are seeing is due to the fact that tomcat is looking at the wrong directory. It is currently most likely pointed at your src/main/webapp directory of your project. This does not jive with how maven works. Maven downloads the dependencies, but will only include them in the target build. You need to have the tomcat server look at target/myapp-0.0.1, or build to a war and deploy that way. The easiest solution as of now, would be for you to use the tomcat plugin. After setting it up, you can use an imbedded server, and just use the following command 'mvn tomcat:run'.
Maven Tomcat Plugin Docs
UPDATE:
I looked at the properties settings, and you should actually be able to edit the "Web Deployment Assembly" settings for your project (under project properties). Check screenshot for how I have mine setup. Notice how Maven Dependencies is mapped.
http://imgur.com/ofxryns

Error deploying application to Glassfish 3

When I try to deploy my application named shopping-1 to Glassfish 3 I get the following error:
'Publishing to GlassFish Server Open Source Edition 3 (Java EE 6)2 at localhost...'has encountered a problen.
cannot Deploy shopping-1
Deployment Error for module: shopping-1: Exception while loading the app :
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException:
org.apache.catalina.LifecycleException:
java.lang.ClassNotFoundException:
org.springframework.web.servlet.DispatcherServlet
How do I track down and fix this issue?
apparently the shopping-1.war file doesn't include the archive containing the DispatcherServlet class.
unzip -l shopping-1.war | grep spring (on Linux) will give you the list of all spring-related included jar files
First run appserver admin-list applications
Check if there are any deployed applications on the server.
Undeploy by running them if there are.
Stop the application server.
Open the location folder where you have the war file for deployment
Check that there is only one war file at a time in it.
7.Start the application server
Deploy the war.
Should work fine.