Error while redeploying WAR in Jenkins,how to solve? - java

i am running two tomcat server simultaneously on port 8090 & 8081.
8090 connected with Jenkins-staging job
& 8081 connected with Jenkins-production job
8090 running perfectly. but 8081 has the following error :
Started by user admin
Building in workspace C:\Program Files (x86)\Jenkins\workspace\deploy-to-prod
Copied 1 artifact from "maven3-project" build number 69
Deploying C:\Program Files (x86)\Jenkins\workspace\deploy-to-prod\webapp\target\webapp.war to container Tomcat 8.x Remote with context
Redeploying [C:\Program Files (x86)\Jenkins\workspace\deploy-to-prod\webapp\target\webapp.war]
Undeploying [C:\Program Files (x86)\Jenkins\workspace\deploy-to-prod\webapp\target\webapp.war]
ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to undeploy [C:\Program Files (x86)\Jenkins\workspace\deploy-to-prod\webapp\target\webapp.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:139)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:177)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:147)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:117)
at hudson.FilePath.act(FilePath.java:1078)
at hudson.FilePath.act(FilePath.java:1061)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:114)
at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeploy(PasswordProtectedAdapterCargo.java:93)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:64)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1835)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The Tomcat Manager responded "FAIL - Unable to delete [C:\Program Files\APACHE\apache-tomcat-8.5.37-production\webapps\webapp.war]. The continued presence of this file may cause problems.
" instead of the expected "OK" message
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:715)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:501)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.undeploy(TomcatManager.java:441)
at org.codehaus.cargo.container.tomcat.Tomcat7xRemoteDeployer.performUndeploy(Tomcat7xRemoteDeployer.java:61)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:129)
... 18 more
org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The Tomcat Manager responded "FAIL - Unable to delete [C:\Program Files\APACHE\apache-tomcat-8.5.37-production\webapps\webapp.war]. The continued presence of this file may cause problems.
" instead of the expected "OK" message
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:715)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:501)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.undeploy(TomcatManager.java:441)
at org.codehaus.cargo.container.tomcat.Tomcat7xRemoteDeployer.performUndeploy(Tomcat7xRemoteDeployer.java:61)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:129)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:177)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:147)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:117)
at hudson.FilePath.act(FilePath.java:1078)
at hudson.FilePath.act(FilePath.java:1061)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:114)
at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeploy(PasswordProtectedAdapterCargo.java:93)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:64)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1835)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE
# i have already changed server.xml file:
<Connector port="8081" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8444" />
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8084" protocol="AJP/1.3" redirectPort="8444" />
`

Related

Build step failed with exception org.codehaus.cargo.container.ContainerException: Failed to redeploy

I get below error when trying to deploy a WAR using Jenkins.
I created new Deploy-to-staging project, edited its config as follows:
In Build, select copy artifacts from another project
select the project artifact
Select Post-build Actions
On my attempt to build the (Project Build) code, Deploy-to-staging fails, and I get
ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to redeploy [/var/lib/jenkins/workspace/Deploy-to-staging/webapp/target/webapp.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:188)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:147)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:117)
at hudson.FilePath.act(FilePath.java:1077)
at hudson.FilePath.act(FilePath.java:1060)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:114)
at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeploy(PasswordProtectedAdapterCargo.java:93)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:64)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1844)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The username and password you provided are not correct (error 401)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:698)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:876)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:889)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:173)
... 17 more
Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:8090//manager/text/list
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:571)
... 20 more
org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The username and password you provided are not correct (error 401)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:698)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:876)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:889)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:173)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:147)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:117)
at hudson.FilePath.act(FilePath.java:1077)
at hudson.FilePath.act(FilePath.java:1060)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:114)
at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeploy(PasswordProtectedAdapterCargo.java:93)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:64)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1844)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:8090//manager/text/list
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:571)
... 20 more
Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE
How can I fix this?
My tomcat credentials, located in [tomcat directory]/conf/tomcat-users.xml, are as follows:
<tomcat-users>
<role rolename="manager-script"/>
<role rolename="admin-gui"/>
<user username="tomcat" password="tomcat" roles="manager-script,admin-gui" />
Comment tag Valve in context.xml files
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
There are multiple context.xml files in tomcat directory, update following context.xml files and restart tomcat service-
/apache-tomcat-8.5.41/webapps/manager/META-INF/context.xml
/apache-tomcat-8.5.41/webapps/host-manager/META-INF/context.xml

JBoss EAP 7.0 startup error

I've installed JBoss on a CentOS 7 virtual machine and Jboss tools on Eclipse Oxygen. I'm only trying to start server via Eclipse, without any project to deploy.
But i've received this error:
Exception in thread "main" org.jboss.modules.ModuleLoadException: Error loading module from /opt/jboss-eap-7.0/modules/system/layers/base/org/jboss/msc/main/module.xml
at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:228)
at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:204)
at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:170)
at org.jboss.modules.LocalModuleFinder.lambda$findModule$0(LocalModuleFinder.java:149)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.modules.LocalModuleFinder.findModule(LocalModuleFinder.java:144)
at org.jboss.modules.ModuleLoader.findModule(ModuleLoader.java:439)
at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:342)
at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:289)
at org.jboss.modules.Module.addExportedPaths(Module.java:1229)
at org.jboss.modules.Module.addPaths(Module.java:1121)
at org.jboss.modules.Module.link(Module.java:1448)
at org.jboss.modules.Module.relinkIfNecessary(Module.java:1476)
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:225)
at org.jboss.modules.Main.main(Main.java:396)
Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to add resource root 'jboss-msc-1.2.6.Final-redhat-1.jar' at path 'jboss-msc-1.2.6.Final-redhat-1.jar' (position: END_TAG seen ... <resource-root path="jboss-msc-1.2.6.Final-redhat-1.jar"/>... #34:67) caused by: java.util.zip.ZipException: zip file is empty
at org.jboss.modules.xml.ModuleXmlParser.parseResourceRoot(ModuleXmlParser.java:891)
at org.jboss.modules.xml.ModuleXmlParser.parseResources(ModuleXmlParser.java:735)
at org.jboss.modules.xml.ModuleXmlParser.parseModuleContents(ModuleXmlParser.java:535)
at org.jboss.modules.xml.ModuleXmlParser.parseDocument(ModuleXmlParser.java:340)
at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:226)
... 14 more
[1]+ Exit 1 java "-Dprogram.name=JBossTools: Red Hat JBoss EAP 7.0" -Xms64m -Xmx512m -Dorg.jboss.resolver.warning=true -Djava.net.preferIPv4Stack=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true "-Dorg.jboss.boot.log.file=/opt/jboss-eap-7.0/standalone/log/boot.log" "-Dlogging.configuration=file:/opt/jboss-eap-7.0/standalone/configuration/logging.properties" "-Djboss.home.dir=/opt/jboss-eap-7.0" -Dorg.jboss.logmanager.nocolor=true -jar /opt/jboss-eap-7.0/jboss-modules.jar -mp "/opt/jboss-eap-7.0/modules" org.jboss.as.standalone -b 0.0.0.0 --server-config=standalone.xml -Djboss.server.base.dir=/opt/jboss-eap-7.0/standalone
JBTOOLS_SERVER_LAUNCH_TERMINATED_CMD:Red Hat JBoss EAP 7.01504388944983: 1

How do I undeploy all artifacts from WildFly?

I am developing a web application and deploying (with IntelliJ) to WildFly 10.1. I recently renamed my webapp module, which results in renaming my war file from foo.war to bar.war. Every time I start up, I get this error:
12:24:15,899 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."foo_war_exploded.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."foo_war_exploded.war".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "foo_war_exploded.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0160: Failed to mount deployment content
at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:95)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
... 5 more
Caused by: java.io.FileNotFoundException: /.../foo_war_exploded (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at org.jboss.vfs.spi.RootFileSystem.openInputStream(RootFileSystem.java:51)
at org.jboss.vfs.VirtualFile.openStream(VirtualFile.java:318)
at org.jboss.vfs.VFS.mountZipExpanded(VFS.java:533)
at org.jboss.as.server.deployment.DeploymentMountProvider$Factory$ServerDeploymentRepositoryImpl.mountDeploymentContent(DeploymentMountProvider.java:108)
at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:91)
... 6 more
...
[2017-04-23 12:24:18,957] Artifact bar:war exploded: Artifact is deployed successfully
Notice that deploying (and undeploying) the renamed war works fine. I just can't undeploy the leftover of the old war.
How do I undeploy all artifacts from WildFly to make a fresh start?
You have multiple options here:
via Maven:
add the wildfly plugin parameters matchPattern and matchPatternStrategy to your pom.xml in the section <project><build><plugins>:
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<configuration>
<!-- use regular expressions here -->
<matchPattern>(foo|bar).war</matchPattern>
<matchPatternStrategy>all</matchPatternStrategy>
</configuration>
</plugin>
(unfortunately there are no predefined corresponding CLI properties)
and run from a console
mvn wildfly:undeploy -Dwildfly.hostname=XXX -Dwildfly.port=9993 -Dwildfly.username=XXX -Dwildfly.password=XXX -Dwildfly.protocol=https-remoting
(or setup an equivalent run configuration in your IDE)
via WildFly Command Line Interface (CLI):
run jboss-cli -c controller=https-remoting://XXX:9993 -u=XXX
type in your password and then
undeploy (discover artifacts by pressing TAB)
via WildFly Web Management Interface:
visit e.g. https://XXX:9993/console/App.html#standalone-deployments
select the artifact and choose 'Remove' from the dropdown menu
I have logged in through wildfly web console panel (http://127.0.0.1:9990/console/index.html) and then removed old deployed SNAPSHOT from deployment tab, then Re-run my wildfly server from Intellij again and now it is works for me. When i re-run my wildfly server from intellij, it it deployed new SNAPSHOT to the server, so it is working fine and problem is solved for me.

can't deploying War file : error in opening zip file

I'm working on a web application based in java which is correctly running in local with Jetty but I can't deploy a War version on a linux server with Tomcat. I get in the Catalina.out file : error in opening zip file.
I read a lot of topics about this error (permissions, corrupted jar files...) but none helps me. How to find more explanations or details about this error ?
Here is the stack trace :
18-Jan-2016 10:39:01.036 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1663 ms
18-Jan-2016 10:39:01.109 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
18-Jan-2016 10:39:01.109 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.30
18-Jan-2016 10:39:01.168 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /opt/tomcat/webapps/UserInterface-1.0-SNAPSHOT.war
18-Jan-2016 10:39:02.235 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/UserInterface-1.0-SNAPSHOT]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1795)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot#6da9455d]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4928)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5058)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet#6e366f32]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:699)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 13 more
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: error in opening zip file
at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:96)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 16 more
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.jar.JarFile.<init>(JarFile.java:166)
at java.util.jar.JarFile.<init>(JarFile.java:103)
at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:88)
... 17 more
Thanks,
possible reasons for this issue are:
1. your application/WEB-INF/lib may contain duplicate jar
2. improper permission to application or application/WEB-INF/lib
This issue is mainly because of the corrupted JARS in your deployment war file.
unzip <artifact-name>.war
find <artifact-folder> -name "*jar" | xargs -L 1 zip -T | grep error | grep invalid
This lists the corrupted JARS in the console.
Once you find the corrupted JARS, either manually replaces the JARS in the lib folder or Create a new build and deploy it.
I meet the similar issue. "Caused by: java.util.zip.ZipException: error in opening zip file", I deleted .m2/repository folder, regenerator the war, and then fixed.
I also got the same issue .it happens because corrupted jars.
solution: remove the corrupted jar and replace it again from the correct jar.create the new WAR File

Apache fediz 1.2 - Context initialization failed

I am trying to set up the fedizhelloworld example on two apache-tomcat-7.0.59 servers (one for the RP and one for the IDP)
I am having trouble with the IDP and am getting the following errors on startup.
catalina.out:
2015-05-21 13:58:06,176 [localhost-startStop-1] ERROR
org.springframework.web.context.ContextLoader - Context
initialization failed <openjpa-2.3.0-r422266:1540826 nonfatal general
error> org.apache.openjpa.persistence.PersistenceException: There were
errors initializing your configuration: <openjpa-2.3.0-r422266:1540826
fatal user error> org.apache.openjpa.util.UserException: A connection
could not be obtained for driver class "null" and URL "null". You may
have specified an invalid URL.
idp.log:
2015-05-21 13:42:45,456 [localhost-startStop-1] ERROR
org.springframework.web.context.ContextLoader - Context
initialization failed <openjpa-2.3.0-r422266:1540826 nonfatal general
error> org.apache.openjpa.persistence.PersistenceException: There were
errors initializing your configuration: <openjpa-2.3.0-r422266:1540826
fatal user error> org.apache.openjpa.util.UserException: A connection
could not be obtained for driver class "null" and URL "null". You may
have specified an invalid URL.
This is my server.xml settup:
<Server port="9005" shutdown="SHUTDOWN">
<!-- http configuration -->
<Connector port="9080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="9443" />
<!-- https configuration -->
<Connector port="9443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
keystoreFile="idp-ssl-server.jks"
keystorePass="tompass" sslProtocol="TLS" />
I made the start up/shutdown scripts in CATALINA_HOME:
#!/bin/bash
CATALINA_HOME=/home/mmcginn/Sites/fireworks/SAML_lab/CXF_Lab/tomcat-7-IDP
$CATALINA_HOME/bin/startup.sh
and...
#!/bin/bash
CATALINA_HOME=/home/mmcginn/Sites/fireworks/SAML_lab/CXF_Lab/tomcat-7-IDP
$CATALINA_HOME/bin/shutdown.sh
I put the example keystore in CATALINA_HOME "idp-ssl-sever.jks"
Then finally, I deployed "fediz-idp.war" and "fediz-idp-sts.war" to the webapps folder.
What am I missing?
Try downloading and adding a hsqldb driver (jar) into to your fediz idp lib directory ($CATALINA_HOME/webapps/fediz-idp/WEB-INF/lib). You may check your persitence.properties, persistenceContext.xml config.

Categories

Resources