[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[jetty-users] Crazy Windows/Version Issues
|
Hey guys,
So I'm a new Jetty user, so forgive me if I'm just missing something. I'm trying to install/configure Jetty in a Windows Server 2008 environment (client requirement, ugh.) I'm managed to get everything work great, except I had to use Jetty 7.4.5, as I was getting really really odd errors when attempting to use 7.5.1. I did not try 8.x, as the webapp works properly under 7.4.x in a linux environment.
So, I've attached my install script that I have created to distribute to the client's IT department. I followed the steps exactly for both attempts, the only difference being the version of Jetty.
The big gotcha is when trying to actually run my webapp, as the welcome page loads fine under both versions. When using 7.5.1, when I go to any JSP page (they're all trivial, nothing fancy other than java.util.Date logic) I either get a Jasper no-jdk exception:
org.apache.jasper.JasperException: java.err.nojdk
or multiple errors describing that all the Jasper or servlet classes do not exist (package javax.servlet does not exist ... ) (see attached).
The only difference between the two installs in the Jetty version. I assume that it has something to do with the loading of the JDK or other assorted Java libs. Perhaps I'm inadvertently loading everything twice, as the 7.5.1 is honoring an environment var or something?
In any case, I'd like to get this ironed out so I can move between the jetty versions.
Any help or explanation is appreciated!
Thanks,
Evan
Atlanta
REM 0. Install Java
http://download.oracle.com/otn-pub/java/jdk/6u25-b06/jdk-6u25-windows-x64.exe
Add JAVA_HOME environment variable to 'C:\Program Files\Java\jdk1.6.0_25'
REM 1. Open command prompt as Administrator
mkdir C:\java\apache-commons-daemon
REM 2. Download commons-daemon binaries for windows to directory above from
REM http://www.apache.org/dist/commons/daemon/binaries/windows/commons-daemon-1.0.7-bin-windows.zip
REM 3. unzip which will create C:\java\apache-commons-daemon\commons-daemon-1.0.7-bin-windows
mkdir C:\java\jetty
REM 4. Download jetty to directory above from
REM http://download.eclipse.org/jetty/7.4.5.v20110725/dist/jetty-distribution-7.4.5.v20110725.zip
REM Make sure you get the 7.4.5 version.
REM 5. unzip to C:\java\jetty\jetty-7.4.5
REM 6. Verify that jetty can be started
cd C:\java\jetty\jetty-7.4.5
java -jar start.jar
REM Look for any obvious errors on the console
REM Open a browser at http://localhost:8080/
REM You should be presented with the Jetty Start Page,
REM and be able to execute the Hello World Servlet
REM OK, that's enough,
REM come back to the command prompt and ctrl-C to stop the jetty server
REM 7. Copy and rename commons-daemon binaries into the JETTY_HOME directory structure
REM Note that the GUI manager is copied to JETTY_HOME,
REM and the service exe is copied to JETTY_HOME\bin
REM Note that both binaries get the same target name,
REM but are placed in different directories
REM This is just makes it easier to launch the GUI manager
REM by not having to provide command line arguments
REM Note that I have selected the amd64\prunsrv.exe as the service exe,
REM I am running on Windows 7 64 bit Intel i7 Xeon
cd C:\java\jetty\jetty-7.4.5
copy \java\apache-commons-daemon\commons-daemon-1.0.7-bin-windows\prunmgr.exe .\JettyService.exe
copy \java\apache-commons-daemon\commons-daemon-1.0.7-bin-windows\amd64\prunsrv.exe .\bin\JettyService.exe
REM 8. Time to install the service
bin\JettyService //IS//JettyService --DisplayName="Jetty Service" --Install=C:\java\jetty\jetty-7.4.5\bin\JettyService.exe --LogPath=C:\java\jetty\jetty-7.4.5\logs --LogLevel=Debug --StdOutput=auto --StdError=auto --StartMode=Java --StopMode=Java --Jvm=auto ++JvmOptions=-Djetty.home=C:\java\jetty\jetty-7.4.5 ++JvmOptions=-DSTOP.PORT=8087 ++JvmOptions=-DSTOP.KEY=downB0y ++JvmOptions=-Djetty.logs=C:\java\jetty\jetty-7.4.5\logs ++JvmOptions=-Dorg.eclipse.jetty.util.log.SOURCE=true ++JvmOptions=-XX:MaxPermSize=128M ++JvmOptions=-XX:+CMSClassUnloadingEnabled ++JvmOptions=-XX:+CMSPermGenSweepingEnabled --Classpath=C:\java\jetty\jetty-7.4.5\start.jar --StartClass=org.eclipse.jetty.start.Main ++StartParams=OPTIONS=Server,jsp,jmx,resources,websocket,ext ++StartParams=C:\java\jetty\jetty-7.4.5\etc\jetty.xml ++StartParams=C:\java\jetty\jetty-7.4.5\etc\jetty-deploy.xml ++StartParams=C:\java\jetty\jetty-7.4.5\etc\jetty-webapps.xml ++StartParams=C:\java\jetty\jetty-7.4.5\etc\jetty-contexts.xml ++StartParams=C:\java\jetty\jetty-7.4.5\etc\jetty-testrealm.xml --StopClass=org.eclipse.jetty.start.Main ++StopParams=--stop
REM 9. Test that the service starts at the command prompt
cd bin
JettyService //TS
REM 10. If there's a mistake and you need to delete the service, you can run:
REM bin\JettyService //DS
REM 11. Now launch the GUI manager to check the parameter settings
cd ..
JettyService.exe
REM 12. For SSL, I used OpenSSL and followed the instrucitons here: http://docs.codehaus.org/display/JETTY/How+to+configure+SSL
cd C:\java\jetty
openssl genrsa -des3 -out jetty.key 2048
openssl req -new -key jetty.key -out jetty.csr
- Submit the CSR to authority for key -
REM For 2048-bit CSRs, you must create a certficiate chain as follows.
type [CRT Returned From Authority].crt intermediate.crt [intermediate2.crt]... rootCA.crt > cert-chain.txt
REM Sometimes, the pkcs12 export will complain about line termination. Make sure that the cert-chain.txt has the necessary line breaks between the concatenation points. Also, insure that each CRT file is valid. (no copy-paste issues)
openssl pkcs12 -export -inkey jetty.key -in cert-chain.txt -out jetty.pkcs12
C:\Program Files\Java\jdk1.6.0_25\bin\keytool -importkeystore -srckeystore jetty.pkcs12 -srcstoretype PKCS12 -destkeystore keystore
Put this keystore file in C:\java\jetty. Use the provided jetty.xml file, which has the SSL connector configured.
Attachment:
jetty-7.5.1.servlet.error
Description: Binary data