Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we deploy a custom war file into tomcat which is in che container #3588

Closed
codergabs opened this issue Jan 4, 2017 · 19 comments
Closed
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.

Comments

@codergabs
Copy link

[Short description of problem here]

I want to deploy some custom war file into tomcat which is in che container.
I don't see any ssh port enabled there, Is there any way to configure some port and make
the war file transfer possible into the home/user/che/tomcat/webapps/

My expectation is my custom war to co exist with
ROOT.war
dashboard.war
swagger.war
wsmaster.war

And I could see the username for che container is root,
what is it's default password

Che version: 5.0.0-M8
OS and version: Windows 7

@ghost ghost added the kind/question Questions that haven't been identified as being feature requests or bugs. label Jan 4, 2017
@ghost
Copy link

ghost commented Jan 4, 2017

@codergabs do you want to hot deploy your custom war on the go?

@codergabs
Copy link
Author

@eivanstov
Yes, Want to hot deploy,
Could put the war using volume into webapps.
But not hot deploying, and tomcat after stopping not starting as well.

@codergabs
Copy link
Author

@eivantsov
still couldn't find a way to ssh into the container.

@ghost
Copy link

ghost commented Jan 4, 2017

sshd isn't running in che-server container.

Can you elaborate on what you are trying to achieve? Perhaps what you are looking for is a development mode for Eclipse Che. In this mode, your local binaries get mounted into che-server container, and all changes you do locally will take effect in a container as well.

@codergabs
Copy link
Author

@eivantsov
You are right I got the local binaries mounted.
Now i am facing another issue, The war is not hot deploying, and when i am trying to restart the tomcat, getting the following error

2017-01-04 08:22:51,752[ina-startStop-1] [ERROR] [o.a.c.core.ContainerBase 917] - A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/agent-binaries]]
at java.util.concurrent.FutureTask.report(FutureTask.java:122) [na:1.8.0_111]
at java.util.concurrent.FutureTask.get(FutureTask.java:192) [na:1.8.0_111]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:915) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871) [catalina.jar:8.0.38]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) [catalina.jar:8.0.38]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407) [catalina.jar:8.0.38]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397) [catalina.jar:8.0.38]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_111]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111]
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/agent-binaries]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162) [catalina.jar:8.0.38]
... 6 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@5caf8c9c]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162) [catalina.jar:8.0.38]
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4969) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5099) ~[catalina.jar:8.0.38]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) [catalina.jar:8.0.38]
... 6 common frames omitted
Caused by: java.lang.IllegalArgumentException: The main resource set specified [/home/user/che/tomcat/webapps/${che.home}/lib] is not valid
at org.apache.catalina.webresources.StandardRoot.createMainResourceSet(StandardRoot.java:730) ~[catalina.jar:8.0.38]
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:688) ~[catalina.jar:8.0.38]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) [catalina.jar:8.0.38]
... 9 common frames omitted

@codergabs
Copy link
Author

@eivantsov ,
I got it, I was starting catalina instead of che, so some parameter set was missing.
I can deploy my war file now on restart.
To hot deploy probably need to change the server.xml right.

@TylerJewell
Copy link

Yes, that is correct.

@codergabs
Copy link
Author

codergabs commented Jan 6, 2017

@eivantsov @TylerJewell

Surprisingly one of my war file is giving following exception on deployment

Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method) ~[na:1.8.0_111]
at java.util.zip.ZipFile.(ZipFile.java:219) ~[na:1.8.0_111]
at java.util.zip.ZipFile.(ZipFile.java:149) ~[na:1.8.0_111]
at java.util.jar.JarFile.(JarFile.java:166) ~[na:1.8.0_111]
at java.util.jar.JarFile.(JarFile.java:103) ~[na:1.8.0_111]

It is extracting on some other tomcat, but failing in the tomcat in che container,
Any pointers you guys have on this.
space is ok permission is 777, still failing.
Some sample war downloaded from web is working fine

@ghost
Copy link

ghost commented Jan 6, 2017

@codergabs it'd be great to know when this exception occurs, what custom war you are trying to deploy, share code etc. Without this info there's little we can suggest.

@codergabs
Copy link
Author

@eivantsov

I have put the war file into webapps, when I am restarting che server, my expectation is
the war file will be extracted, but it is not, and in log I can see the ZIPException.
My server.xml is autoDeploy false, which is default.

Sharing code will be little difficult for me.
It's a war file containing only js files and xml files no java code in that.
Can you please give me some guidelines what I can check to debug this issue.

the same custom war is getting deployed at other tomcat.
I remember it got deployed once in che tomcat, but I have remove the folder and war file, when I am trying to restart after copying the war file again, from then onwards it's giving this error not deploying.

regards,
Gourab

@ghost
Copy link

ghost commented Jan 6, 2017

@codergabs does switching off auto deploy, then copying war and restarting Tomcat help?

@codergabs
Copy link
Author

@eivantsov
No, even then also it's throwing ZIPException.

@ghost
Copy link

ghost commented Jan 6, 2017

Does 'chmod +r' make any difference?

Also, if you deploy it with a clean Tomcat, does it throw the same exception?

@codergabs
Copy link
Author

@eivantsov
chmod +r did not work.
In a clean tomcat on my windows machine, the same war do not throw this exception.
There it is working fine

@ghost
Copy link

ghost commented Jan 6, 2017

Can you share the war itself? It does look like permissions issue.

@ghost
Copy link

ghost commented Jan 6, 2017

I'd try to play with permissions for parent directories as well.

@codergabs
Copy link
Author

@eivantsov
retarting che container worked.
Strange!!!!

@ghost
Copy link

ghost commented Jan 10, 2017

@codergabs should I close the issue?

@codergabs
Copy link
Author

codergabs commented Jan 10, 2017

@eivantsov
You can close the issue as I have got the workaround,

But I am intermittently getting the ZipException issue, not only in my installation ,
In another installation of my colleague as well.
I just restart the container in that case.

Probably if I remove the extracted folder from /webapps and then restart the che tomcat
then it is not extracting again.
Although cannot confirm this reproduction step.

You may look into this for the product improvement perspective.

Thank You for your help.

@ghost ghost closed this as completed Jan 10, 2017
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.
Projects
None yet
Development

No branches or pull requests

2 participants