My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
BuildInstructions  
How to build core i-jetty
Featured
Updated Aug 21, 2011 by jan.bar...@gmail.com

Building Core i-jetty

Updated for i-jetty-3.0

You might also be interested in info on Building the Console Web Application.

From the Command Line

Building i-jetty at the command line is very straightforward.

You'll need these tools:

To build:

  1. Checkout the code from svn: svn co http://i-jetty.googlecode.com/svn/trunk/

Then, assuming you checked out the code to $I_JETTY_HOME, and you have the android sdk installed at $ANDROID_HOME, you do:

 cd $I_JETTY_HOME/i-jetty
 mvn clean install

Voila! You will have an installable .apk bundle in your $I_JETTY_HOME/i-jetty/i-jetty-ui/target directory. Now follow the instructions over at the Android Developers site to upload it to your phone or emulator.

Tweaking the Build Process

We use the maven android plugin to build i-jetty. If you need to tweak the default values used by the Android build tools, you will find the documentation for this plugin helpful.

Making an SDCard Image

i-jetty requires an sd card. If you're running with the emulator, you'll need to use the mksdcard utility from the android sdk. Here's an example of creating a file called "sdcard.img" which is a card with 60Mb storage:

mksdcard 60M ./sdcard.img

When you start the emulator, you can choose which android platform runtime to use, but remember you need to start the emulator with the scard option. Here's an example of starting the 1.6 runtime with the sdcard we created in the step above:

emulator -avd avd1.6 -sdcard ./sdcard.img

If you're using the emulator, you'll want to install the ijetty package:

adb install i-jetty/i-jetty-ui/target/i-jetty-[ijetty.version]-aligned.apk

Where ijetty.version is the version number of i-jetty, eg 2.1-SNAPSHOT.

If you want to make changes to i-jetty, you can remove the installed i-jetty with:

adb uninstall org.mortbay.ijetty

Using the Eclipse Plugin

You can import the i-jetty project into Eclipse. We use the wonderful m2 Eclipse plugin to make it easy.

Note: due to some massaging of the i-jetty-server component to comply with the Dalvik JVM running on Android, we advise that you do not have that project open in eclipse, as the Eclipse Android Plugin cannot properly do what's needed to get it working on Android. The Maven build is what creates the proper i-jetty-server component that i-jetty-ui (and Android) eventually use.

Please contact the i-jetty developers at dev@jetty.codehaus.org for help.

Comment by dko...@gmail.com, Jul 7, 2009

You may need to reolve the android.jar 1.5_r2 dependency. This can be an issue for new installations of maven. The command below should install the android.jar for 1.5_r2 in your .m2 local repository. To handle this, but maven can be tricky if you don't know what you are doing. Here is what I did:

mvn install:install-file -DgroupId?=android -DartifactId?=android -Dversion=1.5_r2 -Dpackaging=jar -Dfile=$ANDROID_HOME/android-sdk-linux_x86-1.5_r2/platforms/android-1.5/android.jar

Comment by dko...@gmail.com, Jul 8, 2009

I know we are all java people, but there is also a build.py file located in the top level of $I_JETTY_HOME. run 'python build.py --configure' and answer the questions. It will prompt you to ask you how you want to bake this thing and even figures out how to handle newer 1.5 SDK versions. Rerun with 'python build.py' and the thing will build and kick off the emulator if desired. Nice :)

Comment by pinket...@gmail.com, Jul 14, 2009

i got outOfMemoryError:Java heap spec with building i-jetty module. Other modules are working fine. Do you have any idea about that?

Comment by julianharty, Oct 13, 2009

To address the outOfHeapMemory java error when building i-jetty edit dx.bat (or equivalent on other operating systems to uncomment the following line:

set javaOpts=-Xmx256M

For android 1.5 the file is: android-sdk-windows-1.5_r3\platforms\android-1.5\tools\dx.bat

Comment by julianharty, Oct 13, 2009

Also, to build on Windows the command line needs some tweaks - see below for an example

First edit dx.bat to increase the memory allocation (see my previous comment for details) Then, assuming you have version 1.5r3 of the android SDK installed as follows, and the source in a folder called i-jetty:

cd i-jetty\code
set ANDROID_HOME=c:\downloads\code.google.com\android\android-sdk-windows-1.5_r3 
mvn -e install -Dandroid.home=%ANDROID_HOME% -Dandroid.platform=platforms\android-1.5
Comment by fab...@gmail.com, Oct 15, 2009

Hi, I'm trying to build i-jetty with Android SDK v1.6. Here's what i've done with python script: 1)Check out the code with Eclipse svn plugin; I import the code as project in the workspace. 2)I copy the downloaded modules,.settings, ecc. in another location, c:\i-jetty 3)I run the build.py --configure with these options: -Path to Android SDK: C:\android-sdk-windows-1.6_r1 -Platform? ['android-1.5','android-1.6']: [android-1.5] android-1.6 Could not guess SDK version SDK version: [1.1_r1] 1.6 Warning: the SDK version you're using does not match the one the software has been built for. There may be build errors due to changes in API.

Your API version is 1.6 while 1.1_r1 is required. Do you wish to continue?: [y/N]y Enable SD card with emulator?: [Y/n] Y SD card filename: [sdcard.img] Use fresh SD card every build?: [y/N] N Actually build the project?: [Y/n] Y Build system ('ant','make','maven'): maven? Always do make clean? : [Y/n] Y Run Emulator?: [Y/n] n Would you like to create an AVD? : [Y/n]n AVD name to use?: myAVD_1.6 using USB device?: [y/N] n Forward Ports?:[y/N] N Saving to 'default.build'... Configuration Complete!

4) I run build.py without options

5) I had errors while building ERROR: installing artifact failed.

6)In build.log INFO? Scanning for projects... INFO? ------------------------------------------------------------------------ ERROR? FATAL ERROR INFO? ------------------------------------------------------------------------ INFO? Error building POM (may not be this project's POM).

Project ID: org.mortbay.ijetty:ijetty-parent POM Location: C:\i-jetty\pom.xml Validation

Messages:

0? For managed dependency Dependency {groupId=android, artifactId=android, version=1.5_r3, type=jar}: system-scoped dependency must specify

an absolute path systemPath.

Reason: Failed to validate POM for project org.mortbay.ijetty:ijetty-parent at C:\i-jetty\pom.xml

I use maven v. 2.2.1

Comment by fab...@gmail.com, Oct 15, 2009

Later I start to run maven using mvn in command-line. First of all I had a memory exception; it's been already written how to fix it, but it was useful to know that the script uses \platforms\android-1.5\ even if i specified to use platforms\android-1.6 using command-line as follow:

set ANDROID_HOME=C:\android-sdk-windows-1.6_r1 mvn -e install -Dandroid.home=%ANDROID_HOME% -Dandroid.platform=platforms\android-1.6

After that I've i-jetty-debug-2.1-SNAPSHOT.apk and i-jetty-resources.apk in C:\i-jetty\modules\i-jetty\target (with many other things). I tried to install it in myAVD_1.6 (emulator with Android SDK 1.6) and it works.

Comment by gcst...@gmail.com, Nov 10, 2009

Does this work with android 2 on the droid?

What version of python does it expect for Windows?

Comment by senth...@google.com, Mar 3, 2010

I get "Error reading settings.xml: start tag not allowed in epilog but got s (position: END_TAG seen ...</settings>\n<s... @242:3)

Line: 242 Column: 3"
while executing the mvn clean install I did the above mentioned stuffs
  1. Checkout the code from svn: svn co http://i-jetty.googlecode.com/svn/trunk/
2. Edited maven /usr/share/maven2/conf/settings.xml file 3. Added the following lines to your settings.xml file, replacing the value of android.home with the location of android sdk as mentioned above
Then, assuming you checked out the code to $I_JETTY_HOME which is /home/senthilv/Desktop/i-jetty-2.1-src, and you have the android sdk installed at $ANDROID_HOME which is /home/senthilv/Desktop/Android/android-sdk-linux_86, did:
cd /home/senthilv/Desktop/i-jetty-2.1-src mvn clean install
Am i missing something? Could someone help me in building ijetty file using mvn?

Comment by koenig.t...@web.de, Apr 20, 2010

Hi while building I-Jetty using mvn I get the errormessage: Failed to resolve artifact. org.mortbay.ijetty:i-jetty-server:jar:2.1-SNAPSHOT and org.mortbay.ijetty:console:war:2.1-SNAPSHOT. It advises me to download them manually but I don't know where to find it if it isn't in the repository. Can someone give me a hint where I can get these files?

Comment by project member jan.bar...@gmail.com, Apr 21, 2010

Koenig,

You need to ensure you're building from the top level directory, as the various submodules depend on each other.

Jan

Comment by imjustma...@gmail.com, Jun 22, 2010

When building on windows, i get the following build error:

INFO? ------------------------------------------------------------------------ ERROR? BUILD ERROR INFO? ------------------------------------------------------------------------ INFO? Result of cmd.exe /X /C "c:\work\src\android-sdk-windows\\platforms\android-4\tools\dx -JXmx256M --dex --verbose --core-library --output=C:\work\src\i-jetty\i-jetty-ui\target/classes.dex --positions=lines C:\work\src\i-jetty\i-jetty- ui\target\classes C:\work\src\i-jetty\i-jetty-ui\target/dependency-classes" execution is: '1'.

any idea why ?

Comment by project member jan.bar...@gmail.com, Jun 22, 2010

Matt,

The known problems on windows usually revolve around the memory during the dex phase. Have a read of the comment by julianharty on Oct 13, 2009 about how to increase the memory. If that doesn't help, then do a "mvn -X clean install" and post the output to dev@jetty.codehaus.org and we'll take a closer look.

cheers Jan

Comment by ShuoChe...@gmail.com, Jun 30, 2010

I have got a similar problem here,

INFO?------ ERROR? BUILD ERROR INFO?------ INFO? Result of cmd.exe /X /c "C:\Android\android-sdk-windows\platforms\android-4\tools\dx -JXmx256M --dex --verbose --core-library --output=C:\User\Shuo\i-jetty\i-jetty-ui\target/classes.dex --position=lines C:\Users\Shuo\i-jetty\i-jetty-ui\target\classes C:\Users\Shuo\i-jetty\i-jetty-ui\target/dependency-classes" execution is: '1'

Any idea on this issue?

Thanks a lot.

Comment by amit.pug...@gmail.com, Jul 4, 2010

First thing, The latest code downloaded from svn doesn't work with android-7 or 8. You'll have to install android-4 in the platforms folder and then into the repository as mentioned in above posts. This will resolve the issue, "org.mortbay.ijetty:i-jetty-server:jar:2.1-SNAPSHOT". I don't know why the latest code is still dependent on android-4. :|

Next, I tried increasing the memory but still i get the same error "execution is : '1'". Below is the stack trace from mvn -X install -Dandroid.home=C:\android\android-sdk-windows -Dandroid.platform=platforms\android-4,

DEBUG? active project artifact:

artifact = active project artifact: artifact = active project artifact: artifact = active project artifact: artifact = active project artifact: artifact = org.mortbay.ijetty:console:war:2.1-SNAPSHOT:compile; project: MavenProject?: org.mortbay.ijetty:console:2.1-SNAPSHOT @ C:\android\I-Jetty\svn\trunk\webapps\console\pom.xml; project: MavenProject?: org.mortbay.ijetty:console:2.1-SNAPSHOT @ C:\android\I-Jetty\svn\trunk\webapps\console\pom.xml; project: MavenProject?: org.mortbay.ijetty:console:2.1-SNAPSHOT @ C:\android\I-Jetty\svn\trunk\webapps\console\pom.xml; project: MavenProject?: org.mortbay.ijetty:console:2.1-SNAPSHOT @ C:\android\I-Jetty\svn\trunk\webapps\console\pom.xml; project: MavenProject?: org.mortbay.ijetty:console:2.1-SNAPSHOT @ C:\android\I-Jetty\svn\trunk\webapps\console\pom.xml (selected for co
ile) DEBUG? Configuring mojo 'org.codehaus.mojo:exec-maven-plugin:1.1:exec' --> DEBUG? (f) arguments = [-JXmx256M, --dex, --verbose, --core-library, --output=C:\android\I-Jetty\svn\trunk\i-jetty-ui\target/classes.dex, - ositions=lines, C:\android\I-Jetty\svn\trunk\i-jetty-ui\target\classes, C:\android\I-Jetty\svn\trunk\i-jetty-ui\target/dependency-classes] DEBUG? (f) basedir = C:\android\I-Jetty\svn\trunk\i-jetty-ui DEBUG? (f) classpathScope = compile DEBUG? (f) executable = C:\android\android-sdk-windows/platforms/android-4/tools/dx DEBUG? (f) project = MavenProject?: org.mortbay.ijetty:i-jetty:2.1-SNAPSHOT @ C:\android\I-Jetty\svn\trunk\i-jetty-ui\pom.xml DEBUG? (f) skip = false DEBUG? -- end configuration -- INFO? [exec:exec {execution: generate-dex}] DEBUG? executable C:\android\android-sdk-windows/platforms/android-4/tools/dx not found in place, assuming it is in the PATH. INFO? error: no command specified INFO? usage: INFO? dx --dex [--debug] [--verbose] [--positions=<style>] [--no-locals] INFO? [--no-optimize] [--statistics] [--[no-]optimize-list=<file>] [--no-strict] INFO? [--keep-classes] [--output=<file>] [--dump-to=<file>] [--dump-width=<n>] INFO? [--dump-method=<name>[]] [--verbose-dump] [--no-files] [--core-library] INFO? [<file>.class | <file>.{zip,jar,apk} | <directory>] ... INFO? Convert a set of classfiles into a dex file, optionally embedded in a INFO? jar/zip. Output name must end with one of: .dex .jar .zip .apk. Positions INFO? options: none, important, lines. INFO? dx --annotool --annotation=<class> [--element=<element types>] INFO? [--print=<print types>] INFO? dx --dump [--debug] [--strict] [--bytes] [--basic-blocks | --rop-blocks] INFO? [--width=<n>] [<file>.class | <file>.txt] ... INFO? Dump classfiles in a human-oriented format. INFO? dx --junit [-wait] <TestClass> INFO? Run the indicated unit test. INFO? dx -J<option> ... <arguments, in one of the above forms> INFO? Pass VM-specific options to the virtual machine that runs dx. INFO? dx --version INFO? Print the version of this tool (1.2). INFO? dx --help INFO? Print this message. INFO? ------------------------------------------------------------------------ ERROR? BUILD ERROR INFO? ------------------------------------------------------------------------ INFO? Result of cmd.exe /X /C "C:\android\android-sdk-windows\platforms\android-4\tools\dx -JXmx256M --dex --verbose --core-library --output= \android\I-Jetty\svn\trunk\i-jetty-ui\target/classes.dex --positions=lines C:\android\I-Jetty\svn\trunk\i-jetty-ui\target\classes C:\android\I etty\svn\trunk\i-jetty-ui\target/dependency-classes" execution is: '1'. INFO? ------------------------------------------------------------------------ DEBUG? Trace org.apache.maven.lifecycle.LifecycleExecutionException?: Result of cmd.exe /X /C "C:\android\android-sdk-windows\platforms\android-4\tools\dx - mx256M --dex --verbose --core-library --output=C:\android\I-Jetty\svn\trunk\i-jetty-ui\target/classes.dex --positions=lines C:\android\I-Jetty vn\trunk\i-jetty-ui\target\classes C:\android\I-Jetty\svn\trunk\i-jetty-ui\target/dependency-classes" execution is: '1'.
at org.apache.maven.lifecycle.DefaultLifecycleExecutor?.executeGoals(DefaultLifecycleExecutor?.java:719) at org.apache.maven.lifecycle.DefaultLifecycleExecutor?.executeGoalWithLifecycle(DefaultLifecycleExecutor?.java:556) at org.apache.maven.lifecycle.DefaultLifecycleExecutor?.executeGoal(DefaultLifecycleExecutor?.java:535) at org.apache.maven.lifecycle.DefaultLifecycleExecutor?.executeGoalAndHandleFailures(DefaultLifecycleExecutor?.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor?.executeTaskSegments(DefaultLifecycleExecutor?.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor?.execute(DefaultLifecycleExecutor?.java:180) at org.apache.maven.DefaultMaven?.doExecute(DefaultMaven?.java:328) at org.apache.maven.DefaultMaven?.execute(DefaultMaven?.java:138) at org.apache.maven.cli.MavenCli?.main(MavenCli?.java:362) at org.apache.maven.cli.compat.CompatibleMain?.main(CompatibleMain?.java:60) at sun.reflect.NativeMethodAccessorImpl?.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl?.invoke(NativeMethodAccessorImpl?.java:39) at sun.reflect.DelegatingMethodAccessorImpl?.invoke(DelegatingMethodAccessorImpl?.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException?: Result of cmd.exe /X /C "C:\android\android-sdk-windows\platforms\android-4\tools\d -JXmx256M --dex --verbose --core-library --output=C:\android\I-Jetty\svn\trunk\i-jetty-ui\target/classes.dex --positions=lines C:\android\I-Je y\svn\trunk\i-jetty-ui\target\classes C:\android\I-Jetty\svn\trunk\i-jetty-ui\target/dependency-classes" execution is: '1'.
at org.codehaus.mojo.exec.ExecMojo?.execute(ExecMojo?.java:260) at org.apache.maven.plugin.DefaultPluginManager?.executeMojo(DefaultPluginManager?.java:490) at org.apache.maven.lifecycle.DefaultLifecycleExecutor?.executeGoals(DefaultLifecycleExecutor?.java:694) ... 17 more
INFO? ------------------------------------------------------------------------ INFO? Total time: 15 seconds INFO? Finished at: Mon Jul 05 01:00:54 IST 2010 INFO? Final Memory: 27M/65M INFO? ------------------------------------------------------------------------

Please help. It's been 1.5 hr since I'm stuck with this installation thing and haven't realized the power of a web server on mobile phone.

Comment by project member jan.bar...@gmail.com, Jul 4, 2010

Amit,

It doesn't look like you increased the amount of memory available. The debug output trace still shows -JXmx256M, which is the default. Try editing the i-jetty-ui/pom.xml file and adding the following argument to the dex command:

<argument>-JXmx1024M</argument>

I've updated the build instructions page to reflect that a version 4 platform is required to build i-jetty (because that is the lowest-common-denominator api that i-jetty supports).

regards Jan

Comment by amit.pug...@gmail.com, Jul 5, 2010

Thanks Jan for a quick reply. But I'm getting the same stack trace again, I did an exact match and this time the only change it shows is 1024M instead of 256M.

If you look at the stack trace, there is a statement saying, "C:\android\android-sdk-windows/platforms/android-4/tools/dx not found in place, assuming it is in the PATH."

I tried with(out) dx.jar in the Path env variable. But still no success.

Comment by amit.pug...@gmail.com, Jul 5, 2010

My goodness!! I commented the "<argument>-JXmx1024M</argument>" and it worked. So, let me summarize all the pre-requisites other than mentioned above to get "mvn install" work successfully,

1. You should have android-4 installed. 2. Install the android-4.jar into maven repository by, mvn install:install-file -DgroupId?=android -DartifactId?=android -Dversion=4 -Dpackaging=jar -Dfile=$ANDROID_HOME/android-sdk-linux_x86-1.5_r2/platforms/android-4/android.jar 3. Goto $IJETTY_HOME\i-jetty-ui\pom.xml. 4. Open it and comment the part saying "<argument>-JXmx1024M</argument>". 5. That's it and you are good to go. :)

Comment by project member jan.bar...@gmail.com, Jul 5, 2010

Hi Amit,

Glad that things are working for you now. However, you should not need to do step 2 of copying an android jar to the maven repo, as the pom refers to it via a its location on disk:

<systemPath>${android.home}${file.separator}${android.platform}${file.separator}android.jar</systemPath>

cheers Jan

Comment by john.joh...@gmail.com, Jul 6, 2010

can it run on Android 2.2?

Comment by project member jan.bar...@gmail.com, Jul 6, 2010

John,

I believe jetty should run just fine, however the Console webapp might have problems due to changes in the api for accessing media etc.

cheers Jan

Comment by Garre...@gmail.com, Jul 7, 2010

can i build the apk with jetty 7.1.4?

Comment by project member jan.bar...@gmail.com, Jul 7, 2010

GarrentWU,

Not at present. You're welcome to submit a patch for this. I've changed the status of the issue you raised from "defect" to "enhancement": http://code.google.com/p/i-jetty/issues/detail?id=77

BTW interesting project name: "remote-control-android". I'd be interested to see your progress :)

cheers Jan

Comment by arvindma...@gmail.com, Jul 11, 2010

Hi, Can someone let me know if it is possible to run JSP webapps on i-jetty? Also, if yes, what are the changes needs to be done. I am stuck up with this since last 2 days.

Thanks a lot Arvind

Comment by project member jan.bar...@gmail.com, Jul 11, 2010

Arvind,

Why not precompile your jsps? That way they can be included in the dex pass like any other java code.

Jan

Comment by arvindma...@gmail.com, Jul 11, 2010

Thanks Jan. I also thought so but pre-compiled JSP has reference to org.apache.jasper.runtime.HttpJspBase? which again is not with i-jetty. Not sure if we can port the external package as part of webapp on i-jetty and make them running.

Comment by arvindma...@gmail.com, Jul 13, 2010

Its driving me crazy. Not getting any information anywhere on i-jetty if it is possible to run JSP webapps. Googling it since last few days. Can someone please help in at least knowing if it is possible? Want to switch to something else to achieve the result because I am not able to resist the temptation of using JSP and at the same time not able to figure out if it is possible and how.

Please someone help. Thanks Arvind

Comment by zorglub...@gmail.com, Aug 3, 2010

Hi, I am trying to create an apps with an embedded web server but I am brand new to android, jetty and servlets. Do you think that I can reuse the code of i-jetty in my apps (it's just for myself)? Does it possible to download the .java files which are inside the javax.servlet directory? Can jetty 7.1 works on android with this files (I will certianly use WebSockets? later) or it's more complex?

Cheers, Silvère

Comment by cke...@gmail.com, Aug 4, 2010

If you are getting "no command specified" error while compiling i-jetty on windows do the following

  1. remove "<argument>-JXmx256M</argument>" from dx command line in i-jetty-ui/pom.xml.
  2. Edit android-sdk-windows/platforms/android-4/tools/dx.bat, search for "set javaOpts=" line and modify it to "set javaOpts=-Xmx1024M".

Comment by onlysaga...@gmail.com, Oct 19, 2010

Hi I am able to build the ijetty source code on windows. I have i-jetty-resources.apk in my iJetty\i-jetty-ui\target folder. I have done the signing of this apk. Now when i tried to install it on device i am getting following problem

435 KB/s (0 bytes in 62765.000s)

pkg: /data/local/tmp/i-jetty-resources_signed.apk
Failure INSTALL_FAILED_DEXOPT?

Does anyone know how to deal with this ?

Comment by Pach...@gmail.com, Nov 8, 2010

I am getting the following error when building, any ideas?

11/8/10 7:54:22 PM EST: INFO? Copying classes to C:\Users\xxxxx\Desktop\jetty\modules\i-jetty\target\included-wars\console.war 11/8/10 7:54:22 PM EST: Build errors for i-jetty; org.apache.maven.lifecycle.LifecycleExecutionException?: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.0:copy-dependencies (copy-war) on project i-jetty: Error copying artifact from C:\Users\xxxxx\Desktop\jetty\modules\console\target\classes to C:\Users\xxxxx\Desktop\jetty\modules\i-jetty\target\included-wars\console.war

Comment by jfaen...@gmail.com, Nov 12, 2010

Dear i-jetty developers,

I recently started using i-jetty and I really like its potential. I would like to now make some extensions and write some plugins for it. I read all the available information on the google code pages but still have some questions about running and debugging the i-jetty build within Eclipse? I tried two different approaches:

a) Using m2eclipse to import the POM.xml and build the project. An .apk file is generated but when I use "Run As->Android Application" I get an error message that "i-jetty.apk" could not be found.

b) I then instead used the Eclipse .project file which comes with i-jetty (in directory i-jetty\i-jetty-ui) directly. That means instead of creating the .project file with m2eclipse I imported the .project file which is in the trunk. The build went through with some warning messages. When I use "Run As->Android Application" the app is started on the phone. But when I use "Debug As->Android Application" and place some breakpoints in IJettyService.java, they are never reached.

Could you tell me the steps you are using to run and debug i-jetty in Eclipse?

Thanks so much!

Comment by vishalghadge, Dec 1, 2010

Hi, I tried new servelet, its building it get included in apk also.. problem is, it is not getting extracted like console.. Gone through almost all pom files.. POM for my servlet is inherited from console servlet. Any pointer on this will help..

Thanks, Vishal

Comment by letis...@gmail.com, Feb 4, 2011

Hello, I have been trying to build this from source code all day with no success so far. Can you please help with small hint? Which jetty source I need also to get current i-jetty built? Please note I would like to have the whole functionality as a part of my project, so I need to be able to build it in eclipse. I tried this and got stacked when jetty sources were included.

Thank you very much for any help!

Best regards:

Comment by Thomas1...@gmail.com, Mar 1, 2011

Hi i-Jetty Team,

JSP does not work. We try for 4 days, to get a simple Hello word, but we only get errors like: "java.jang.string not found", no JSP support, ...

We compiled the classfish jsp 2.1 and jsp-api 2.1 into the i-jetty server and get error about ClassLoader?? ClassCastExceptions?? .... in JspRuntimeContext??.

We fix this problem and got the next one. Inpossible to compile our JSP, because "java.lang.string not found".

What is the Problem? classpath, context.xml, android, wrong compiler????

Please help!

thx Sascha

Comment by Jan.Oliv...@gmail.com, Mar 13, 2011

Hi i-Jetty Team,

i want to publish my own custom web-application. I cannot access this applicaton through a web-browser in a different network. What is to do? Do you have some regards for me?

Thank you very much for any help!

Best regards!

Comment by italk...@gmail.com, Apr 4, 2011

Hi i-Jetty Team,When I use mvn,I see some errors:

D:\i-jetty\i-jetty-ui>mvn clean install INFO? Scanning for projects... INFO? ------------------------------------------------------------------------ ERROR? FATAL ERROR INFO? ------------------------------------------------------------------------ INFO? Error building POM (may not be this project's POM).

Project ID: org.mortbay.ijetty:i-jetty POM Location: D:\i-jetty\i-jetty-ui\pom.xml Validation Messages:

0? For dependency Dependency {groupId=android, artifactId=android, version

=4, type=jar}: system-scoped dependency must specify an absolute path systemPath .

1? For managed dependency Dependency {groupId=android, artifactId=android,
version=4, type=jar}: system-scoped dependency must specify an absolute path sy
stemPath.

Reason: Failed to validate POM for project org.mortbay.ijetty:i-jetty at D:\i-je tty\i-jetty-ui\pom.xml

INFO? ------------------------------------------------------------------------ INFO? Trace org.apache.maven.reactor.MavenExecutionException?: Failed to validate POM for pro ject org.mortbay.ijetty:i-jetty at D:\i-jetty\i-jetty-ui\pom.xml

at org.apache.maven.DefaultMaven?.getProjects(DefaultMaven?.java:378) at org.apache.maven.DefaultMaven?.doExecute(DefaultMaven?.java:292) at org.apache.maven.DefaultMaven?.execute(DefaultMaven?.java:129) at org.apache.maven.cli.MavenCli?.main(MavenCli?.java:287) at sun.reflect.NativeMethodAccessorImpl?.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl?.invoke(NativeMethodAccessorImpl?.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl?.invoke(DelegatingMethodAcces?
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

Caused by: org.apache.maven.project.InvalidProjectModelException?: Failed to vali date POM for project org.mortbay.ijetty:i-jetty at D:\i-jetty\i-jetty-ui\pom.xml

at org.apache.maven.project.DefaultMavenProjectBuilder?.processProjectLog

ic(DefaultMavenProjectBuilder?.java:1108)

at org.apache.maven.project.DefaultMavenProjectBuilder?.buildInternal(Def
aultMavenProjectBuilder.java:878)
at org.apache.maven.project.DefaultMavenProjectBuilder?.buildFromSourceFi
leInternal(DefaultMavenProjectBuilder?.java:506)
at org.apache.maven.project.DefaultMavenProjectBuilder?.build(DefaultMave?
nProjectBuilder.java:198)
at org.apache.maven.DefaultMaven?.getProject(DefaultMaven?.java:583) at org.apache.maven.DefaultMaven?.collectProjects(DefaultMaven?.java:461) at org.apache.maven.DefaultMaven?.getProjects(DefaultMaven?.java:365) ... 11 more
INFO? ------------------------------------------------------------------------ INFO? Total time: < 1 second INFO? Finished at: Tue Apr 05 09:41:35 CST 2011 INFO? Final Memory: 2M/247M INFO? ------------------------------------------------------------------------

Thank you very much for any help.

Maven version: 2.0.9 Java version: 1.6.0_24 OS name: "windows 7" version: "6.1" arch: "x86" Family: "windows"

Comment by o...@androidsx.com, Apr 16, 2011

First of all, excellent work. I was able to have i-jetty up and running withing minutes. In fact, it has been a perfect chance to learn maven.

I want to deploy my webapp in the /, so as I read in jetty docs your war should be deployed as root.war. I tried everything:

Adding in /webapps/console/pom.xml

..
<build>
  	<finalName>root</finalName>
..

Then, I also changed:

...
<configuration>
  <tasks>
    <mkdir
      dir="${project.build.directory}/${project.build.finalName}/WEB-INF/lib" />
    <jar
      basedir="${project.build.directory}"
      update="true"
      includes="classes.dex"
      destfile="${project.build.directory}/${project.build.finalName}/WEB-INF/lib/classes.zip" />
  </tasks>
..

It correctly generates the root.war, but when I run the install phase it continues to copy to the local repository as console-3.0-SNAPSHOT.war.

I noticed that in i-jetty-ui/target/included-wars, still copy it with console.war. So it seems is the pom.xml of i-jetty-ui but I didn't find nothing that could affect.

Thank you very much for your support, keep up the good work! Omar

Comment by Jianshu....@gmail.com, Apr 23, 2011

Build in windows failed with android-sdk-11 because arguments of dx not correct. I modify i-jetty-ui\pom.xml, comment out the line <argument>-JXmx1024M</argument>, it work now.

Comment by aasha.me...@gmail.com, Aug 8, 2011

Hi I-Jetty team. I am trying to build iJetty using Cygwin on windows. I set the http-proxy and port for maven without which it was not going a single step forward. But now I get the following error DEBUG? ======================================================================= DEBUG? Could not find metadata org.eclipse.jetty:jetty-webapp:7.5.0-SNAPSHOT/maven-metadata.xml in local (C:\Documents and Settings\aasha.medhi\.m2\r epository) DEBUG? Could not find metadata org.eclipse.jetty:jetty-webapp:7.5.0-SNAPSHOT/maven-metadata.xml in local (C:\Documents and Settings\aasha.medhi\.m2\r epository) WARNING? The POM for org.eclipse.jetty:jetty-webapp:jar:7.5.0-SNAPSHOT is missing, no dependency information available DEBUG? Could not find metadata org.eclipse.jetty:jetty-deploy:7.5.0-SNAPSHOT/maven-metadata.xml in local (C:\Documents and Settings\aasha.medhi\.m2\r epository) DEBUG? Could not find metadata org.eclipse.jetty:jetty-deploy:7.5.0-SNAPSHOT/maven-metadata.xml in local (C:\Documents and Settings\aasha.medhi\.m2\r epository) WARNING? The POM for org.eclipse.jetty:jetty-deploy:jar:7.5.0-SNAPSHOT is missing, no dependency information available DEBUG? org.mortbay.ijetty:i-jetty-server:jar:3.0-SNAPSHOT DEBUG? org.eclipse.jetty:jetty-webapp:jar:7.5.0-SNAPSHOT:compile DEBUG? org.eclipse.jetty:jetty-deploy:jar:7.5.0-SNAPSHOT:compile DEBUG? com.google.android:android:jar:1.6_r2:provided DEBUG? commons-logging:commons-logging:jar:1.1.1:provided DEBUG? org.apache.httpcomponents:httpclient:jar:4.0.1:provided DEBUG? org.apache.httpcomponents:httpcore:jar:4.0.1:provided DEBUG? commons-codec:commons-codec:jar:1.3:provided DEBUG? org.khronos:opengl-api:jar:gl1.1-android-2.1_r1:provided DEBUG? xerces:xmlParserAPIs:jar:2.6.2:provided DEBUG? xpp3:xpp3:jar:1.1.4c:provided INFO? ------------------------------------------------------------------------ INFO? Reactor Summary: INFO? INFO? I-Jetty :: Parent ................................. SUCCESS [0.328s] INFO? I-Jetty :: Jetty Adaptations for Android .......... FAILURE [0.188s] INFO? I-Jetty :: Android Application .................... SKIPPED INFO? ------------------------------------------------------------------------ INFO? BUILD FAILURE INFO? ------------------------------------------------------------------------ INFO? Total time: 2.546s INFO? Finished at: Mon Aug 08 16:57:33 IST 2011 INFO? Final Memory: 5M/9M INFO? ------------------------------------------------------------------------ ERROR? Failed to execute goal on project i-jetty-server: Could not resolve dependencies for project org.mortbay.ijetty:i-jetty-server:jar:3.0-SNAPSHO T: The following artifacts could not be resolved: org.eclipse.jetty:jetty-webapp:jar:7.5.0-SNAPSHOT, org.eclipse.jetty:jetty-deploy:jar:7.5.0-SNAPSHOT : Could not find artifact org.eclipse.jetty:jetty-webapp:jar:7.5.0-SNAPSHOT -> 1? org.apache.maven.lifecycle.LifecycleExecutionException?: Failed to execute goal on project i-jetty-server: Could not resolve dependencies for project o rg.mortbay.ijetty:i-jetty-server:jar:3.0-SNAPSHOT: The following artifacts could not be resolved: org.eclipse.jetty:jetty-webapp:jar:7.5.0-SNAPSHOT, o rg.eclipse.jetty:jetty-deploy:jar:7.5.0-SNAPSHOT: Could not find artifact org.eclipse.jetty:jetty-webapp:jar:7.5.0-SNAPSHOT

at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver?.getDependencies(LifecycleDependencyResolver?.java:196) at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver?.resolveProjectDependencies(LifecycleDependencyResolver?.java:108) at org.apache.maven.lifecycle.internal.MojoExecutor?.ensureDependenciesAreResolved(MojoExecutor?.java:258) at org.apache.maven.lifecycle.internal.MojoExecutor?.execute(MojoExecutor?.java:201) at org.apache.maven.lifecycle.internal.MojoExecutor?.execute(MojoExecutor?.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor?.execute(MojoExecutor?.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder?.buildProject(LifecycleModuleBuilder?.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder?.buildProject(LifecycleModuleBuilder?.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter?.singleThreadedBuild(LifecycleStarter?.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter?.execute(LifecycleStarter?.java:161) at org.apache.maven.DefaultMaven?.doExecute(DefaultMaven?.java:319) at org.apache.maven.DefaultMaven?.execute(DefaultMaven?.java:156) at org.apache.maven.cli.MavenCli?.execute(MavenCli?.java:537) at org.apache.maven.cli.MavenCli?.doMain(MavenCli?.java:196) at org.apache.maven.cli.MavenCli?.main(MavenCli?.java:141) at sun.reflect.NativeMethodAccessorImpl?.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl?.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl?.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.project.DependencyResolutionException?: Could not resolve dependencies for project org.mortbay.ijetty:i-jetty-server:jar:3. 0-SNAPSHOT: The following artifacts could not be resolved: org.eclipse.jetty:jetty-webapp:jar:7.5.0-SNAPSHOT, org.eclipse.jetty:jetty-deploy:jar:7.5.0 -SNAPSHOT: Could not find artifact org.eclipse.jetty:jetty-webapp:jar:7.5.0-SNAPSHOT
at org.apache.maven.project.DefaultProjectDependenciesResolver?.resolve(DefaultProjectDependenciesResolver?.java:170) at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver?.getDependencies(LifecycleDependencyResolver?.java:171) ... 22 more
Caused by: org.sonatype.aether.resolution.DependencyResolutionException?: The following artifacts could not be resolved: org.eclipse.jetty:jetty-webapp :jar:7.5.0-SNAPSHOT, org.eclipse.jetty:jetty-deploy:jar:7.5.0-SNAPSHOT: Could not find artifact org.eclipse.jetty:jetty-webapp:jar:7.5.0-SNAPSHOT
at org.sonatype.aether.impl.internal.DefaultRepositorySystem?.resolveDependencies(DefaultRepositorySystem?.java:412) at org.apache.maven.project.DefaultProjectDependenciesResolver?.resolve(DefaultProjectDependenciesResolver?.java:164) ... 23 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException?: The following artifacts could not be resolved: org.eclipse.jetty:jetty-webapp:j ar:7.5.0-SNAPSHOT, org.eclipse.jetty:jetty-deploy:jar:7.5.0-SNAPSHOT: Could not find artifact org.eclipse.jetty:jetty-webapp:jar:7.5.0-SNAPSHOT
at org.sonatype.aether.impl.internal.DefaultArtifactResolver?.resolve(DefaultArtifactResolver?.java:541) at org.sonatype.aether.impl.internal.DefaultArtifactResolver?.resolveArtifacts(DefaultArtifactResolver?.java:220) at org.sonatype.aether.impl.internal.DefaultRepositorySystem?.resolveDependencies(DefaultRepositorySystem?.java:395) ... 24 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException?: Could not find artifact org.eclipse.jetty:jetty-webapp:jar:7.5.0-SNAPSHOT
at org.sonatype.aether.impl.internal.DefaultArtifactResolver?.resolve(DefaultArtifactResolver?.java:531) ... 26 more
ERROR? ERROR? ERROR? For more information about the errors and possible solutions, please read the following articles: ERROR? 1? http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException ERROR? ERROR? After correcting the problems, you can resume the build with the command ERROR? mvn <goals> -rf :i-jetty-server

Please help. I am stuck with it.

Comment by ebo...@codesta.com, Aug 8, 2011

Anyone with the missing dependencies like:

"Could not find artifact org.eclipse.jetty:jetty-webapp:jar:7.5.0-SNAPSHOT"

Replace 7.5.0-SNAPSHOT with 7.4.5.v20110725 in /i-jetty/pom.xml. I don't know what the differences are between 7.5 v 7.4 though so do this at your own risk.

Comment by aasha.me...@gmail.com, Aug 8, 2011

I got the following error while compiler using cygwin on windows.

ERROR? Failed to execute goal on project i-jetty-server: Could not resolve dependencies for project org.mortbay.ijetty:i-jetty-server:jar:3.0-SNAPSHO T: The following artifacts could not be resolved: org.eclipse.jetty:jetty-webapp:jar:7.5.0-SNAPSHOT, org.eclipse.jetty:jetty-deploy:jar:7.5.0-SNAPSHOT : Could not find artifact org.eclipse.jetty:jetty-webapp:jar:7.5.0-SNAPSHOT -> 1? org.apache.maven.lifecycle.LifecycleExecutionException??: Failed to execute goal on project i-jetty-server: Could not resolve dependencies for project o rg.mortbay.ijetty:i-jetty-server:jar:3.0-SNAPSHOT: The following artifacts could not be resolved: org.eclipse.jetty:jetty-webapp:jar:7.5.0-SNAPSHOT, o rg.eclipse.jetty:jetty-deploy:jar:7.5.0-SNAPSHOT: Could not find artifact org.eclipse.jetty:jetty-webapp:jar:7.5.0-SNAPSHOT

Anyone any idea how to solve it? Please help.

Comment by project member joakim.erdfelt, Aug 15, 2011

If you have build issues, please use jetty-users@eclipse.org mailing list for help. http://www.eclipse.org/jetty/mailinglists.php

Comment by project member joakim.erdfelt, Aug 15, 2011

For those of you that do not yet have access to jetty 7.5.0-SNAPSHOT (via a private maven repository manager, or custom maven settings file), we've just added the public jetty snapshots repository to the pom.xml for i-jetty to make fetching them a bit easier.

Comment by panteley...@gmail.com, Jan 30, 2012

Hi,i-jetty team,

I deploy jetty test.war to i-jetty,it appear this error:

HTTP ERROR 503

Problem accessing /test/jsp/dump.jsp. Reason:

java.lang.ClassCastException?: org.mortbay.ijetty.webapp.AndroidClassLoader?

Caused by:

org.eclipse.jetty.servlet.ServletHolder?$1: java.lang.ClassCastException?: org.mortbay.ijetty.webapp.AndroidClassLoader? at org.eclipse.jetty.servlet.ServletHolder?.makeUnavailable(ServletHolder?.java:416) at org.eclipse.jetty.servlet.ServletHolder?.initServlet(ServletHolder?.java:462) at org.eclipse.jetty.servlet.ServletHolder?.doStart(ServletHolder?.java:264) at org.eclipse.jetty.util.component.AbstractLifeCycle?.start(AbstractLifeCycle?.java:59) at org.eclipse.jetty.servlet.ServletHandler?.initialize(ServletHandler?.java:770) at org.eclipse.jetty.servlet.ServletContextHandler?.startContext(ServletContextHandler?.java:249) at org.eclipse.jetty.webapp.WebAppContext?.startContext(WebAppContext?.java:1214) at org.eclipse.jetty.server.handler.ContextHandler?.doStart(ContextHandler?.java:676) at org.eclipse.jetty.webapp.WebAppContext?.doStart(WebAppContext?.java:455) at org.eclipse.jetty.util.component.AbstractLifeCycle?.start(AbstractLifeCycle?.java:59) at org.mortbay.ijetty.deployer.AndroidWebAppDeployer?.scan(AndroidWebAppDeployer?.java:203) at org.mortbay.ijetty.deployer.AndroidWebAppDeployer?.doStart(AndroidWebAppDeployer?.java:63) at org.eclipse.jetty.util.component.AbstractLifeCycle?.start(AbstractLifeCycle?.java:59) at org.eclipse.jetty.util.component.AggregateLifeCycle?.doStart(AggregateLifeCycle?.java:58) at org.eclipse.jetty.server.handler.AbstractHandler?.doStart(AbstractHandler?.java:53) at org.eclipse.jetty.server.handler.HandlerWrapper?.doStart(HandlerWrapper?.java:91) at org.eclipse.jetty.server.Server.doStart(Server.java:261) at org.eclipse.jetty.util.component.AbstractLifeCycle?.start(AbstractLifeCycle?.java:59) at org.mortbay.ijetty.IJettyService.startJetty(IJettyService.java:633) at org.mortbay.ijetty.IJettyService$JettyStarterThread?.run(IJettyService.java:149) Caused by: java.lang.ClassCastException?: org.mortbay.ijetty.webapp.AndroidClassLoader? at org.apache.jasper.compiler.JspRuntimeContext?.<init>(JspRuntimeContext?.java:174) at org.apache.jasper.servlet.JspServlet?.init(JspServlet?.java:150) at org.eclipse.jetty.servlet.ServletHolder?.initServlet(ServletHolder?.java:444)

Comment by jmbaquer...@gmail.com, Mar 23, 2012

Hi everybody! I have solve the problem that appear building with duplicate about.html. I don't know exactly what was the problem but I have changed the pom file into the i-jetty-ui folder using android-maven-plugin instead of maven-android-plugin and the version 3.0.0. Now I can build using maven via command line and when I launch the emulator and I install the apk it works correctly. But now I'm trying to set up the project in eclipse and when I try to import the project using the m2e plugin and the new pom file. When I do file/import/maven/existing maven project and I choose the project, eclipse show me that can't solve an error with a connector "android-maven-plugin:3.0.0:proguard". This is the message that appear "No marketplace entries found to handle android-maven-plugin:3.0.0:proguard in Eclipse. Please see Help for more information.". Can anybody help me with this please? Thanks a lot


Sign in to add a comment
Powered by Google Project Hosting