Posts Tagged ‘Jetty’
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-plugi
n)
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">
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-plugi
n)
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>
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> (...)
GWT in noserver mode with Tomcat or WebLogic
Abstract
You would like to work on the client side of your GWT application, without building and deploying the Jetty server. Or, in the same way, you need test some server features available in WebLogic but not in Jetty, such as the EJB.
GWT 2.0 documentation, at the segment How do I use my own server in hosted mode instead of GWT’s built-in Jetty instance? is not precise at all on the 3rd step: it simply states:
“change the URL at the end of the argument list to match the URL you recorded in step #1.”
Process
- Let’s assume your WAR is deployed on
http://distantMachine:8080/myApplication
. The servlet container may be Tomcat or WebLogic, it does not matter - In Eclipse, go in “
Run Configuration...
“. Duplicate your current and classic GWT application configuration. - Go in
Server
, uncheck “Run built-in server
“. - In
Arguments
tab, write the following line:-noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -war C:\eclipse\workspace\myApplication\src\main\webapp\lalou.jonathan.web.gwt.MyApplication -startupUrl http://distantMachine:8080/myApplication lalou.jonathan.web.gwt.MyApplication
- Run
- The application is available at the following address:
http://distantMachine:8080/muyApplication/?gwt.codesvr=127.0.0.1:9997