Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Issues getting iJetty up and running with dependencies

Hi David,

Can you post the logcat output? I'd like to see the exact classes and
stack trace line numbers.

NB The cometd stuff will bring in dependencies on some of the jetty
jars, which is normally not a problem, as the webapp classloader
should make them visible, but maybe that's not working in android -
seeing the stacktraces will help pinpoint.

thanks,
Jan

On 22 May 2012 05:20, David Whittaker <dpwhittaker@xxxxxxxxx> wrote:
> Hi,
>
> I'm trying to port the chat demo to iJetty3 and Cometd 2.4.2  I think I have
> all the code updated for Cometd, but when I download and install the war
> onto my phone, I get several class not found errors relating to the classes
> contained in the cometd-java-server dependency.  I've got the jar unpacker
> and dex steps in my maven build, and I see the classes in dex output, so I
> know they are getting compiled into the classes.dex/zip.  I also see that
> the classes.zip is placed under WEB-INF/lib.  I also see the dalvikvm
> unzipping the classes.zip in the android log, immediately followed by all
> the class not found errors.  I even did a dexdump on the classes.dex and
> found the classes it was complaining about.  I'm really stumped here.  If
> anyone can offer some clarification, that would be helpful.  Here's my pom,
> if it helps:
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
>     <parent>
> <groupId>org.mortbay.ijetty</groupId>
> <artifactId>example-webapps-parent</artifactId>
> <version>3.2-SNAPSHOT</version>
> <relativePath>../pom.xml</relativePath>
>     </parent>
>
>     <modelVersion>4.0.0</modelVersion>
>     <artifactId>chat</artifactId>
>     <name>CometD Chat</name>
>   <version>3.2-SNAPSHOT</version>
>   <packaging>war</packaging>
>   <url>http://maven.apache.org</url>
>   <properties>
> <cometd.version>2.4.2</cometd.version>
>   </properties>
>
>     <dependencies>
> <dependency>
>  <groupId>com.google.android</groupId>
>  <artifactId>android</artifactId>
>  <version>${android.version}</version>
>  <scope>provided</scope>
> </dependency>
>         <dependency>
>             <groupId>org.slf4j</groupId>
>             <artifactId>slf4j-android</artifactId>
>             <version>1.6.1-RC1</version>
>         </dependency>
>         <dependency>
>             <groupId>org.eclipse.jetty</groupId>
>             <artifactId>jetty-servlet</artifactId>
>             <version>${jetty.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>org.cometd.java</groupId>
>             <artifactId>cometd-java-server</artifactId>
>             <version>2.4.2</version>
>         </dependency>
>     </dependencies>
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <version>2.3.2</version>
>         <configuration>
>           <source>1.5</source>
>           <target>1.5</target>
>           <verbose>false</verbose>
>         </configuration>
>       </plugin>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-dependency-plugin</artifactId>
>         <version>2.3</version>
>         <executions>
>           <execution>
>             <id>unpack-dependencies</id>
>             <phase>generate-sources</phase>
>             <goals>
>               <goal>unpack-dependencies</goal>
>             </goals>
>             <configuration>
>
> <failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>
>               <excludeArtifactIds>servlet-api,android</excludeArtifactIds>
>               <excludeTransitive>true</excludeTransitive>
>
> <outputDirectory>${project.build.directory}/generated-classes</outputDirectory>
>             </configuration>
>           </execution>
>         </executions>
>       </plugin>
>
>           <!-- Convert the compiled classes into a clases.dex. -->
>       <plugin>
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>exec-maven-plugin</artifactId>
>         <version>1.2</version>
>         <executions>
>           <execution>
>             <id>generate-dex</id>
>             <phase>process-classes</phase>
>             <goals>
>               <goal>exec</goal>
>             </goals>
>             <configuration>
>               <!--
> executable>${env.ANDROID_HOME}/platform-tools/dx</executable -->
>               <executable>java</executable>
>               <arguments>
>                <!-- <argument>-JXmx1024M</argument> -->
>                 <argument>-jar</argument>
>
> <argument>${env.ANDROID_HOME}/platform-tools/lib/dx.jar</argument>
>                 <argument>--dex</argument>
>                 <argument>--verbose</argument>
>                 <argument>--core-library</argument>
>
> <argument>--output=${project.build.directory}/classes.dex</argument>
>                 <argument>--positions=lines</argument>
>                 <argument>${project.build.directory}/classes/</argument>
>
> <argument>${project.build.directory}/generated-classes/</argument>
>               </arguments>
>             </configuration>
>           </execution>
>         </executions>
>       </plugin>
>       <plugin>
>         <artifactId>maven-antrun-plugin</artifactId>
>         <version>1.6</version>
>         <executions>
>           <execution>
>             <id>copydex</id>
>             <phase>process-classes</phase>
>             <goals>
>               <goal>run</goal>
>             </goals>
>             <configuration>
>               <tasks>
>                 <mkdir
>
> dir="${project.build.directory}/${project.artifactId}-${project.version}/WEB-INF/lib"
> />
>                 <jar
>                   basedir="${project.build.directory}"
>                   update="true"
>                   includes="classes.dex"
>
> destfile="${project.build.directory}/${project.artifactId}-${project.version}/WEB-INF/lib/classes.zip"
> />
>               </tasks>
>             </configuration>
>           </execution>
>         </executions>
>       </plugin>
>     </plugins>
>   </build>
>
> </project>
>
>
> I know I'm probably missing something obvious.  If you see something, thanks
> in advance for letting me know.
> David Whittaker
>
> _______________________________________________
> jetty-dev mailing list
> jetty-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>


Back to the top