Error deploying application to Glassfish 3 - eclipse

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.

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

Tomcat has went faulty in Eclipse

I have Eclipse Mars installed in Windows 7 professional and installed Tomcat 8 which I then imported into Eclipse. This all worked really well but then for some reason Tomcat refuses to start when I run a JSP file through the server. The first error message at the top of the stack trace in the Console is;
SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-
nio-8081"]
The only thing I can think caused this is I started Tomcat 8 using the startup.bat in the bin folder, then after this it went faulty. I have tried deleting the Tomcat server from Eclipse and re-importing it but that didn't work. I have Tomcat 8 set up with port 8081 because 8080 is already used and checked the server.xml file at the first connector still says port 8081.
How do I resolve this please? I have added all the main message outputs in the console. However, the ones concerning the filter I don't think are the problem because I removed the filter tag section from the applications web.xml file and the other errors persisted.
SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-nio-8081"]
java.io.IOException: Unable to establish loopback connection
SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8081]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-8081]]
SEVERE: Failed to initialize end point associated with ProtocolHandler ["ajp-nio-8010"]
java.io.IOException: Unable to establish loopback connection
SEVERE: Failed to initialize connector [Connector[AJP/1.3-8010]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[AJP/1.3-8010]]
Two below concern the filter in web.xml
SEVERE: Exception starting filter CH_13LogFilter
java.lang.ClassNotFoundException: action.CH_13LogFilter
SEVERE: One or more Filters failed to start. Full details will be found in the appropriate container log file
NOTE: I have also found that this only occurs in one project in Eclipse. If I run other projects through the Tomcat server in Eclipse it works fine!! But I still can't see what has changed in this project.
How very odd - but one worth remembering. Once I had tried running a different project through Tomcat in Eclipse the project with the problem is now working fine!!

Eclipse error: a Child component failed during start java.util.concurrent.ExecutionException:

I installed Apache tomcat 7 in my eclipse. I created a server and started it which is working fine. When I am trying to run any project, even a simple JSP hello world file, then the following error occurs.
Example: I created a web dynamic project with just a "index.jsp", but this problem is occurring and I don't know how solve it.
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException:
org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Example]]
test:
delete tomcat from your server list.
delete the folder .metadata from your workbench.
restart eclipse and open ur workbench.
add tomcat at ur server list.
import ur project.
finally maven -> upDate.

JBoss & warbler: no such file to load

guys.
I'm using Rails 3.2.13, jruby-1.7.12, JBoss EAP 6.2 and warbler 1.4.3.dev(have tried 1.4.1 and 1.4.2 - it doesn't matter). And I got such error while entering first page of my application:
19:32:18,822 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/]] (ServerService Thread Pool -- 68) ERROR: initialization failed: org.jruby.rack.RackInitializationException: no such file to load -- /home/alex/Projects/install_test/eap-6.2/jboss-eap-6.2/standalone/tmp/vfs/temp/temp37c8c04246e7d946/content-69d213af89011d97/home/alex/Projects/install_test/eap-6.2/jboss-eap-6.2/standalone/tmp/vfs/temp/temp37c8c04246e7d946/content-95fa3e2c22b1402c/config/environment.rb
I got this error only when there are two different deployments in my JBoss:
Where ap_ROOT.war is my rails application and rp_app.war is my java application. In case when there is only rails application there are no errors.
As I found
/home/alex/Projects/install_test/eap-6.2/jboss-eap-6.2/standalone/tmp/vfs/temp/temp37c8c04246e7d946/content-69d213af89011d97
is the path to the rp_app.war(java application) deployment folder and
/home/alex/Projects/install_test/eap-6.2/jboss-eap-6.2/standalone/tmp/vfs/temp/temp37c8c04246e7d946/content-95fa3e2c22b1402c
is the path to the app_ROOT.war(rails application) deployment folder.
Someway it get messed up and JBoss can't find 'config/environment.rb'.
Thanks,
Alex.

weblogic 11g R1

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!!