deploying .war on docker container running tomcat - java

I've been trying to deploy a webapp on a docker container image, I'm using tutum/tomcat. After I run the container and try to deploy the war file using /manager/html it shows me the following error message:
FAIL - Application at context path /1.0 could not be started
FAIL - Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/1.0]]
Also by using docker logs [container-id]:
java.lang.IllegalArgumentException: Invalid or unreadable WAR file : error in opening zip file

Related

glassfish 4.1 class org.springframework.beans.factory.BeanCreationException

please help, this is very confusing, I can't deploy my war file in glassfish (where previously it could) with an error message like this
"https://localhost:4848/management/domain/applications/application/myApp"
created successfully. Warning: Command _deploy did not complete
successfully on server instance instance1: remote failure: Failed to
load the application on instance instance1. The application will not
run properly. Please fix your application and redeploy. Exception
while loading the app : java.lang.IllegalStateException:
ContainerBase.addChild: start: org.apache.catalina.LifecycleException:
java.lang.NoClassDefFoundError: Could not initialize class
org.springframework.beans.factory.BeanCreationException. Please see
server.log for more details. Warning: Command _deploy did not complete
successfully on server instance instance1: remote failure: Failed to
load the application on instance instance1. The application will not
run properly. Please fix your application and redeploy. Exception
while loading the app : java.lang.IllegalStateException:
ContainerBase.addChild: start: org.apache.catalina.Lifecycle ....
msg.seeServerLog
glassfish : 4.1
java version : 1.7.0_121
os : ubuntu server 12
I also could not find meaningful information in the server.log
but my war file can work well on my local tomcat
I'm sure there is no duplicates lib, because it was previously running well and indeed there was no change in my lib

Error when running WAR file on Tomcat server

I built the WAR file of my application https://github.com/JonkiPro/REST-Web-Services. I put it on the Tomcat server and clicked START. Then he threw the error https://zapodaj.net/44f410f8abc74.png.html
FAIL - Application at context path [/WebApplication] could not be started
FAIL - Encountered exception [org.apache.catalina.LifecycleException: start: ]
java.lang.RuntimeException: Failed to get driver instance for jdbcUrl=jdbc:h2:mem:database
and wrote in the logs https://pastebin.com/7rWhPFLt.
I will mention that the application after compilation in IntelliJ works without a problem.
My application works on port 8443. I do not know if it matters. It seems to me that Tomcat has a database problem?

Unable in running Project from Tomcat to Glassfish server in Netbeans

I made a Java web project using Tomcat server.Now I am opening the same project in another PC where only Glassfish is installed(Due to some reasons I don't wanna run the project using Tomcat anymore).But it gives this exception now.
Exception during lifecycle processing
Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Unable to add listener of type: com.chat.listeners.ChatAppListener, because it does not implement any of the required ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, HttpSessionListener, or HttpSessionAttributeListener interfaces
Is there any warning when you opening the project in netbeans.Right click on the project , select resolve server missing problem.Choose Glassfish server.Run once again.
You have apache specific relations in your web.xml file (like file handler servlets).
That is why glassfish can't start your application.

FAIL - Failed to deploy application at context path /ROOT. Deploy plugin of jenkins failling to deploy

Attempting to set up jenkins and its container deploy plugin.
However, I am receiving the following stacktrace :
ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
org.codehaus.cargo.container.ContainerException: Failed to deploy [/myHome/jenkins/jobs/myAPP/workspace/target/ROOT.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:111)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:187)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:60)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:86)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:73)
at hudson.FilePath.act(FilePath.java:784)
at hudson.FilePath.act(FilePath.java:766)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:73)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:45)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:700)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:675)
at hudson.maven.MavenModuleSetBuild$RunnerImpl.post2(MavenModuleSetBuild.java:998)
at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:622)
at hudson.model.Run.run(Run.java:1429)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:481)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:238)
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Failed to deploy application at context path /ROOT
Which isn't really that helpful, I can deploy manually using tomcat manager, and also copying the war file across using command line options works. But i can not get the automated deploy to work.
I am using a tomcat url of http://localhost:8080/ and the deploy fails when their is no app currently deployed.
Any help gratefully received, thanks.
Just a wild guess but the ROOT context is not: /ROOT but rather / maybe there is something wrong in your config
Its a ContainerExc not fileNotFound; therefore the war file has been located.
URL should be http://localhost:8080
Is userName and Password provided?
Is this userName assigned a role of manager-script?
is the tomcat webapp cleared down once for work and temp folder?
If YES to above all, now run the tomcat without any war fiel present in the webapps folder and open a web broswer to see http://localhost:8080 is accessible.
Now whilst this tomcat running, build the jenkins job and deployment should be fine.

Glassfish Java error when deploying WAR

I have two Java SDKs installed. How do I find out which one Glassfishv3 is using? I am getting several Java EE errors when I try to deploy WAR files.
Below is an example of an error when I try deploying a WAR:
Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.spring.aop.ServiceBeanAutoProxyCreator#0' defined in class path resource [META-INF/base-spring.xml]:
Try putting this in your application somewhere, log (or otherwise get access to) the result:
System.out.println(System.getProperty("java.version"));

Categories