I would like to know if anyone knows what are the steps to have a successful complied war file. I tried to export as war on eclipse but got no success every time i tried to access the web service i received this message: error 503, service unavailable.
I even tried to compile the hello servlet example and after load it to i-jetty i get the error 503, as far as i understood eclipse war exporter doesn't work to i-jetty, taking a better look on the chat-2.2.war i notice too some strange files like classes.zip on WEB-INF and on开发者_运维技巧 META-INF a maven folder with some ijetty lib.
Backing to the beginning i would like to know what are the steps to get a success war file compiled for i-jetty ?
thanks for your time best regards Alexandre
I tried doing this and also ran into all kinds of hurdles. But I did eventually get it running. I didn't deploy it directly to the server, though, and that may be your problem. Have you tried making a .war file and manually downloading it from the i-Jetty app? So instead of "deploy", try "package" for your goal.
Also, have you looked at this site?
You're seeing the classes.zip file because as part of the compile it has to translate the Java bytecode into the format that the Dalvik VM reads. It does this automatically in the maven script using the dx tool. This contains the stuff that you'd normally find in a .dex file.
Hope this is helpful!
can you please let me know if you figured out how to accomplish this? (An actual working method)
I found a work-around, by simply taking the classes.zip file and manually placing it in the jetty/webapps/console/WEB-INF/lib folder. This is because I figured that the "Zipping the classes.dex file" mentioned in Nick's link was not working because I could not find the classes.zip file anywhere in the application.
So after copying it myself, my error 503 message went away and the webapp was deployed successfully. However I'm not too pleased with this solution because it's not feasible to ask people who want to install my application from the playstore to go to a website, download the classes.zip file, and copy it into the correct folder.
EDIT:
Hahaha! No sooner did I write this answer that I figured out how to correctly create the classes.zip file (deploying the webapp from within the application will work now!).
So basically as the official i-jetty website says, you need to include the 3 things in your pom.xml listen in the site https://code.google.com/p/i-jetty/wiki/DownloadableWebapps. Now the problem you will face by only including those three is that on newer Android releases (the android-maven-plugin), you will face issues with the part. So you need to add the Following to enable correct execution (add it AFTER closing the plugins element, and BEFORE closing the build element ( <./plugin> ADD IT HERE <./build> , without the dots):
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[2.0,)</versionRange>
<goals>
<goal>copy-dependencies</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
Now when you run the maven build, you will generate the your_webapp.war file you need in the your_application/target/res-overlay/raw folder. Copy the your_webapp.war file into the your_application/res/raw folder. Now run the maven build again. There you have it!! The webapp can be built correctly now :) Thanks a lot for getting me thinking and thus leading me to the solution!!
I got the solution for your question. follow the following steps
1) Install ijetty on your device first then jetty folder will create on sdcard.
2) Create xyz folder inside webapp folder which is placed in jetty folder on your device.
3) Copy your hello.war file and paste to xyz folder
4) Click the Downloads tab in Enter path in edittext like localhost:port number/xyz
6) The port no is depend on you which you are using in ijetty server.
6) The context name must be start with / and you can give any name like /hello
The steps I provide are relevant to my application ( Like4Wifi ).
First of all, understand that you cannot run JSP pages, but only servlets.
In order to have a working example, download the source code provided above and follow the steps:
1). Create your war file and extract it. In this case, the Like4Wifi.war
2). Get the whole 'com' folder/package from 'classes' folder
3). dx the whole 'com' folder (./dx --dex --output=com/facebook/like4wifi/Like4Wifi.dex com/facebook/like4wifi/Like4Wifi.class)
4). Remove original .class file
5). Rename .dex file to .class
6a). Create 'classes.zip' at 'WEB-INF/lib' folder
6b). The content of 'classes.zip' is 'META-INF' folder and its contents and also classes.dex (not the app_name.dex and without the folder/package tree)
7). Move 'classes.zip' to 'lib' folder.
9). Copy the 'Like4Wifi' folder into 'webapps' folder to the mobile.
10). Copy the other jetty libraries from WEB-INF/lib from the console folder at mobile - VOLUNTARILY
Please, keep this application as an example and do not turn it against people!
精彩评论