Search
Calendar
July 2011
S M T W T F S
« Jun   Aug »
 12
3456789
10111213141516
17181920212223
24252627282930
31  
Your widget title
Archives

Archive for July, 2011

PostHeaderIcon weblogic.management.DeploymentException: Application XYZ is a WAR file, but it contains > 1 component

Case

I have a WAR which exposes RMI services via a servlet. It has perfectly worked for months. This afternoon, while redeploying it I got this error:

weblogic.management.DeploymentException: Application Jonathan-rmi-server is a WAR file, but it contains > 1 component

Complete Stacktrace

weblogic.management.DeploymentException: Application Jonathan-rmi-server is a
WAR file, but it contains > 1 component.
        at weblogic.servlet.internal.WarDeployment.createModule(WarDeployment.java:40)
        at weblogic.servlet.internal.WarDeployment.<init>(WarDeployment.java:27)
        at weblogic.servlet.internal.WarDeploymentFactory.createDeployment(WarDeploymentFactory.java:36)
        at weblogic.application.internal.DeploymentManagerImpl.createDeployment(DeploymentManagerImpl.java:84)
        at weblogic.deploy.internal.targetserver.BasicDeployment.createDeployment(BasicDeployment.java:149)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:202)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
        at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
        at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
        at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

Quick fix

Google does not give much information on this error. Anyway, I found this link: WebLogic9 Avoid new lines for attributes in the weblogic.xml . In my case it was not relevant, since my WAR was a classic one, deployable under any application server, and not specifically WebLogic.

Yet, to fix the issue, I had to split the redeploy operation into two phases undeploy and deploy. I could do that either using WebLogic console, or with Maven, ie replacing

mvn package  weblogic:deploy

with

mvn package weblogic:undeploy weblogic:deploy

PostHeaderIcon Maven / Jetty 7 / java.lang.NoClassDefFoundError: javax/servlet/ServletRequestListener

Case

My project is deployed via Maven on a Jetty 6 server. I have to upgrade the server to Jetty 7.
(BTW: notice that the plugin maven-jetty-plugin was renamed as jetty-maven-plugin)

I get this error:

java.lang.NoClassDefFoundError: javax/servlet/ServletRequestListener

Quick Fix

In Jetty plugin, add a dependency to servlet-api, eg:

          <plugin>
              <groupId>org.mortbay.jetty</groupId>
              <artifactId>jetty-maven-plugin</artifactId>
              <version>7.4.4.v20110707</version>
              <dependencies>
                  <dependency>
                      <groupId>javax.servlet</groupId>
                      <artifactId>servlet-api</artifactId>
                      <version>2.4</version>
                  </dependency>
              </dependencies>

PostHeaderIcon Maven / Jetty / Cause: Class name which was explicitly given in configuration using ‘implementation’ attribute: ‘org.mortbay.jetty.bio.SocketConnector’ cannot be loaded

Case

My project is deployed via Maven on a Jetty 6 server. I have to upgrade the server to Jetty 7.
(BTW: notice that the plugin maven-jetty-plugin was renamed as jetty-maven-plugin)

I get this error:

 Cause: Class name which was explicitly given in configuration using 'implementation' attribute: 'org.mortbay.jetty.bio.SocketConnector' cannot be loaded

Quick fix

org.mortbay.jetty.bio.SocketConnector was removed from Jetty with the release 7. To fix the issue, use a more recent implementation. For instance, replace this block:

<connector implementation="org.mortbay.jetty.bio.SocketConnector">

with that one:

<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">

PostHeaderIcon Maven / Jetty / Cannot override read-only parameter: contextPath in goal

Case

My project is deployed via Maven on a Jetty 6 server. I have to upgrade the server to Jetty 7.
(BTW: notice that the plugin maven-jetty-plugin was renamed as jetty-maven-plugin)

I get this error:

 Error configuring: org.mortbay.jetty:jetty-maven-plugin. Reason: ERROR: Cannot override read-only parameter: contextPath in goal: jetty:run-exploded

Quick fix

Insert a tag <webAppConfig> between <configuration> and <contextPath>. In other terms, replace this block:

<configuration>
    <contextPath>/I/love/USA</contextPath>
</configuration>

with that one:

<configuration>
    <webAppConfig>
        <contextPath>/I/love/USA</contextPath>
    </webAppConfig>
</configuration>

PostHeaderIcon Maven / Jetty / java.lang.ClassNotFoundException: org.apache.axis2.transport.http.AxisAdminServlet

Case

I have a WAR containing Axis2-built on webservices. I must deploy it under Jetty 6. The version of Axis2 is 1.5.X.
I get this exception:

java.lang.ClassNotFoundException: org.apache.axis2.transport.http.AxisAdminServlet

I assume the same case may occur with Tomcat.

Explanation

The class AxisAdminServlet was removed from Axis2 between the releases 1.4 and 1.5.

Quick fix

Add the following dependency in Maven’s Jetty plugin:

<plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>maven-jetty-plugin</artifactId>
    <version>6.1.26</version>
    <dependencies>
        <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-kernel</artifactId>
            <version>1.4.1</version>
        </dependency>
    </dependencies>
(...)