无法从jenkins部署到Tomcat 7

时间:2015-04-26 00:19:36

标签: tomcat jenkins

我让Jenkins在OpenShift上运行,我需要构建一个应用程序并将其部署到tomcat。所以我无法将我的应用程序部署到tomcat 7。 OBS:Tomcat 7正在我的电脑上运行。 我收到以下错误:

    Started by user Jenkins Admin
    Building in workspace /var/lib/openshift/553bb7984382ecc5ce00009f/app-root/data/jobs/teste1/workspace
    Checkout:workspace / /var/lib/openshift/553bb7984382ecc5ce00009f/app-root/data/jobs/teste1/workspace - hudson.remoting.LocalChannel@1ef62e0
    Using strategy: Default
    Last Built Revision: Revision c8de886c2a824bdb4db4a70f757a891155ad9611 (origin/HEAD, origin/master)
    Checkout:workspace / /var/lib/openshift/553bb7984382ecc5ce00009f/app-root/data/jobs/teste1/workspace - hudson.remoting.LocalChannel@1ef62e0
    Fetching changes from 1 remote Git repository
    Fetching upstream changes from https://github.com/bergmpe/mysite.git
    Seen branch in repository origin/HEAD
    Seen branch in repository origin/master
    Commencing build of Revision c8de886c2a824bdb4db4a70f757a891155ad9611 (origin/HEAD, origin/master)
    Checking out Revision c8de886c2a824bdb4db4a70f757a891155ad9611 (origin/HEAD, origin/master)
    Warning : There are multiple branch changesets here
    [workspace] $ /var/lib/openshift/553bb7984382ecc5ce00009f/app-root/data/tools/hudson.tasks.Ant_AntInstallation/myAnt/bin/ant
    Buildfile: /var/lib/openshift/553bb7984382ecc5ce00009f/app-root/data/jobs/teste1/workspace/build.xml

init:

compile:
    [javac] /var/lib/openshift/553bb7984382ecc5ce00009f/app-root/data/jobs/teste1/workspace/build.xml:41: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

compile-tests:
    [javac] /var/lib/openshift/553bb7984382ecc5ce00009f/app-root/data/jobs/teste1/workspace/build.xml:46: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 1 source file to /var/lib/openshift/553bb7984382ecc5ce00009f/app-root/data/jobs/teste1/workspace/build/test-classes

test:
    [junit] Running com.berg.NumeroPerfeitoTest
    [junit] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.09 sec

package:

BUILD SUCCESSFUL

    Total time: 3 seconds
    Deploying /var/lib/openshift/553bb7984382ecc5ce00009f/app-root/data/jobs/teste1/workspace/dist/num-perfeito-1.0.war to container Tomcat 7.x Remote
    ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
    org.codehaus.cargo.container.ContainerException: Failed to redeploy [/var/lib/openshift/553bb7984382ecc5ce00009f/app-root/data/jobs/teste1/workspace/dist/num-perfeito-1.0.war]
        at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:193)
        at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
        at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
        at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
        at hudson.FilePath.act(FilePath.java:920)
        at hudson.FilePath.act(FilePath.java:893)
        at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
        at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
        at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:756)
        at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
        at hudson.model.Build$BuildExecution.post2(Build.java:182)
        at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:669)
        at hudson.model.Run.execute(Run.java:1731)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:232)
    Caused by: java.net.ConnectException: Connection timed out
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:579)
        at java.net.Socket.connect(Socket.java:528)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
        at sun.net.www.http.HttpClient.New(HttpClient.java:308)
        at sun.net.www.http.HttpClient.New(HttpClient.java:326)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:997)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:933)
        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:851)
        at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:534)
        at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:686)
        at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:699)
        at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:174)
        ... 16 more
    java.net.ConnectException: Connection timed out
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:579)
        at java.net.Socket.connect(Socket.java:528)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
        at sun.net.www.http.HttpClient.New(HttpClient.java:308)
        at sun.net.www.http.HttpClient.New(HttpClient.java:326)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:997)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:933)
        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:851)
        at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:534)
        at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:686)
        at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:699)
        at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:174)
        at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
        at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
        at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
        at hudson.FilePath.act(FilePath.java:920)
        at hudson.FilePath.act(FilePath.java:893)
        at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
        at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
        at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:756)
        at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
        at hudson.model.Build$BuildExecution.post2(Build.java:182)
        at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:669)
        at hudson.model.Run.execute(Run.java:1731)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:232)
    Finished: FAILURE

2 个答案:

答案 0 :(得分:0)

我只是将 use strict; use warnings; my $cmd = "hpacucli ctrl all show config"; my $row = ""; my $inarray = 0; open my $fd, "$cmd|"; while (<$fd>) { chomp; next if /^Smart/; s/^\s+//g; next if m/^$/; next if m/^logicaldrive/; my $last_line = $row; $row = $_; if ($row =~ (/^array|^unassigned/)) { print $last_line if (!$inarray); print $row; } else { print $row if ($inarray); $last_line = ""; $inarray = 0; } print "$row\n"; } 放入jenkins.war目录,然后访问webapps,这对我来说效果很好。

答案 1 :(得分:0)

我解决了。我也在openshift上安装了tomcat。