The Source for Java Technology Collaboration

Home » java.net Forums » GlassFish » GlassFish

Thread: Problems with GlassFish trying to compile properties file

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 3 - Last Post: Jul 25, 2008 6:14 PM by: jluehe
chile62

Posts: 14
Problems with GlassFish trying to compile properties file
Posted: Jul 24, 2008 2:26 PM
 
  Click to reply to this thread Reply

I'm migrating a web app from Tomcat to GlassFish and have run into a problem with a 3rd party library that handles network-attached encryption. We are using an Ingrian NAE device for the encryption which requires as setup to drop in a IngrianNAE.jar file and a IngrianNAE.properties file in the <JAVA_JDK_HOME>\jre\lib\ext directory. This setup works just fine for Tomcat. When I deploy to GlassFish though and I launch my web application I get the following error:

--------------------------------------------------------------------------------------------------------------------
org.apache.jasper.JasperException: PWC6033: Unable to compile class for JSP

PWC6199: Generated servlet error:
[javac] error: error reading C:\tools\java\jdk1.5.0_06\jre\lib\ext\IngrianNAE.properties; error in opening zip file

PWC6199: Generated servlet error:
[javac] Note: C:\tools\glassfish\nodeagents\nodeagent1\instance-1\generated\jsp\j2ee-modules\MyWebApp\org\apache\jsp\login_jsp.java uses unchecked or unsafe operations.

PWC6199: Generated servlet error:
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 error
--------------------------------------------------------------------------------------------------------------------

So it looks like GlassFish is trying to read the IngrianNAE.properties file as a jar file. When I remove this file the app will compile and launch but the encryption through the NAE device will fail because it needs the properties file there. I can then add the properties file back in and it will work. It looks like GlassFish only complains about the properties file when it first compiles the jsps when I first start up the app. So how can I fix this so I can deploy apps without having to do all this manual work (hide the properties file, compile app, then add the properties file back in, restart server)? And why would Tomcat not have a problem with this same Ingrian setup?

I have already tried to place the properties file in a jar file, this keeps GlassFish from complaining about compilation but the Ingrian encryption will not work with the properties file in a jar file. I can't place the properties file anywhere else, this is how the Ingrian device and library works and it's 3rd party so can't change that. Ideally there would be a way to make GlassFish ignore the properties file when "compiling the jsps".

Any ideas? I am really stuck and this needs to figured out for a successful migration into GlassFish. Several of our other apps use the Ingrian NAE device and library the same way too.

Manfred Riem
RE: Problems with GlassFish trying to compile properties file
Posted: Jul 24, 2008 2:26 PM   in response to: chile62
  Click to reply to this thread Reply

Try the following:

1. Put the JAR file property file anywhere on your filesystem,
but not in the lib/ext directory of your JDK/JRE.

2. Open up the administration console and add a Classpath
prefix pointing to the JAR file. See JVM Settings and
then the Path Settings.

Let me know if that works ;)

-----Original Message-----
From: glassfish@javadesktop.org [mailto:glassfish@javadesktop.org]
Sent: Thursday, July 24, 2008 3:27 PM
To: users@glassfish.dev.java.net
Subject: Problems with GlassFish trying to compile properties file

I'm migrating a web app from Tomcat to GlassFish and have run into a problem with a 3rd party library that handles network-attached encryption. We are using an Ingrian NAE device for the encryption which requires as setup to drop in a IngrianNAE.jar file and a IngrianNAE.properties file in the <JAVA_JDK_HOME>\jre\lib\ext directory. This setup works just fine for Tomcat. When I deploy to GlassFish though and I launch my web application I get the following error:

--------------------------------------------------------------------------------------------------------------------
org.apache.jasper.JasperException: PWC6033: Unable to compile class for JSP

PWC6199: Generated servlet error:
[javac] error: error reading C:\tools\java\jdk1.5.0_06\jre\lib\ext\IngrianNAE.properties; error in opening zip file

PWC6199: Generated servlet error:
[javac] Note: C:\tools\glassfish\nodeagents\nodeagent1\instance-1\generated\jsp\j2ee-modules\MyWebApp\org\apache\jsp\login_jsp.java uses unchecked or unsafe operations.

PWC6199: Generated servlet error:
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 error
--------------------------------------------------------------------------------------------------------------------

So it looks like GlassFish is trying to read the IngrianNAE.properties file as a jar file. When I remove this file the app will compile and launch but the encryption through the NAE device will fail because it needs the properties file there. I can then add the properties file back in and it will work. It looks like GlassFish only complains about the properties file when it first compiles the jsps when I first start up the app. So how can I fix this so I can deploy apps without having to do all this manual work (hide the properties file, compile app, then add the properties file back in, restart server)? And why would Tomcat not have a problem with this same Ingrian setup?

I have already tried to place the properties file in a jar file, this keeps GlassFish from complaining about compilation but the Ingrian encryption will not work with the properties file in a jar file. I can't place the properties file anywhere else, this is how the Ingrian device and library works and it's 3rd party so can't change that. Ideally there would be a way to make GlassFish ignore the properties file when "compiling the jsps".

Any ideas? I am really stuck and this needs to figured out for a successful migration into GlassFish. Several of our other apps use the Ingrian NAE device and library the same way too.
[Message sent by forum member 'chile62' (chile62)]

http://forums.java.net/jive/thread.jspa?messageID=289187

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net


chile62

Posts: 14
Re: RE: Problems with GlassFish trying to compile properties file
Posted: Jul 24, 2008 6:01 PM   in response to: Manfred Riem
 
  Click to reply to this thread Reply

This worked! Thank you.

To recap for others with similar problems: Having a properties file in the jre/lib/ext directory causes problems compiling jsps because the app server tries to treat the properties file as a jar file to use as the class path to compile jsps. For my case using the Ingrian device setup, the properties file is tied to the jar file location. The Ingrian device looks for the <path to ingrian.jar>/ingrian.properties file. By moving both of these out of jre/lib/ext directory and like you said adding the path to the ingrian.jar file to the jvm classpath options of Glassfish, the ingrian jar file was found and the properties file was no longer in the jre/lib/ext directory causing the jsp compile to fail.

jluehe

Posts: 281
Re: RE: Problems with GlassFish trying to compile properties file
Posted: Jul 25, 2008 6:14 PM   in response to: Manfred Riem
 
  Click to reply to this thread Reply

Let us take a look. Preferably, this should work without the workaround suggested by Manfred (but still, thanks for the workaround, Manfred!).




 XML java.net RSS