× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Let me scroll back a bit.

There are some Java programs that require the use of a graphics engine in order to render the graphic components. For example, we use Jasper Reports to generate PDF reports and iChart to generate charts on the iSeries using Java (mostly java servlets).

The first time we used Jasper, we got the error message about the need to have java.awt.headless=true in the properties file. Installing PASE and then setting these values in the '/QIBM/UserData/Java400/SystemDefault.properties' file is what took care of the error for us. As I mentioned both in the post from last year and the latest post, I am not sure what it took to make the system finally read the file. I suspect that it was because we had an instance of Java running somewhere (either a Tomcat app or some other Java app). Once we ended the java app the next instantiation must have used the new settings because the error went away.

When we install the applications at our customers site, we make sure that PASE is installed and the properties file configured before we fire up a Java app and I haven't had the experience of it NOT working since our own first experience.

We start nothing in PASE. We submit no jobs or use any shell. The ONLY shell command we use is to start Tomcat. So, no, I don't think it is necessary to call any programs or run any shell commands in order for your java program to render graphics using AWT "headless". Again, we make sure PASE is installed and we make sure the SystemDefault.properties file is set, and it has worked for us.
The entire file contents are as follows:

java.home=/QIBM/ProdData/Java400/jdk14/ java.version=1.4 os400.awt.native=true java.awt.headless=true user.timezone=America/Denver Of course this would mean that you have the jdk 1.4 version installed on your iSEries (licensed program 5722JV1 6 Java Developer Kit 1.4).

If all of that is true for you, then I am as stumped as you. You could check it after your next IPL or you could try calling IBM and see if they have suggestions.

Pete

P.S. If you actually *wanted* VNC running, you'd need to have 5722PTL installed and use the directions found at this link:

http://www-03.ibm.com/servers/enable/site/porting/tools/vnc.html but again, there is no need to have it running in order to run Java programs using AWT in headless mode.




Hatzenbeler, Tim wrote:

To make this work do I need to run this first?

CALL PGM(QSYS/QP2SHELL)
PARM('/QOpenSys/QIBM/ProdData/DeveloperTools/vnc/vncserver_java' ':1')

I'm not running NAWT...  Should this be running when I set the headless
value to true?

Thanks, Tim


-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On
Behalf Of Pete Helgren
Sent: Monday, February 06, 2006 1:16 PM
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] Java Error was Tomcat java properties question

We start Tomcat from a CL that calls the Qshell commands so, no, it isn't
necessary to be running it interactively from the shell in order for this to
work.

This is ringing a bell in my head because I *know* we had this problem
before and resolved it.  This entry is in the archives:

http://archive.midrange.com/java400-l/200501/msg00051.html

The only other thing I saw in the thread was that the

java.home=/QIBM/ProdData/Java400/jdk14/
java.version=1.4

was needed.  What version of the JVM are you running?

Pete


Hatzenbeler, Tim wrote:

I do have that installed... Do I have to be in a qp2term session when I start tomcat? Or will the jvm automagically tap in to pase?

Thanks, Tim

-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Pete Helgren
Sent: Monday, February 06, 2006 12:36 PM
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] Java Error was Tomcat java properties question

Tim,

Sorry if I asked this or you mentioned this before:

Do you have PASE installed? ("OS/400 - Portable App Solutions Environment" licensed program 5722SS1 Option 33)

You will need to have it installed for the graphics engine referred to by AWT.

Make sure that all JVM instances aren't running. I remember that at first I couldn't get it to work. Can't remember what, exactly, it took after PASE was installed but I think Tomcat had to be restarted and any JVM instances ended before it started to work.

Pete


Hatzenbeler, Tim wrote:



I changed my config, to only have those 2 lines...

And I'm still getting this error...

AWT class or API used without specifying property os400.awt.native=true or java.awt.headless=true

Is there a quick way, in a jsp, to pull these properties values, and show them on the screen,to see what there set to? Mayby tomcat, is overriding the values..

Thanks, Tim


-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
On Behalf Of Pete Helgren
Sent: Friday, February 03, 2006 8:48 PM
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] Java Error was Tomcat java properties question

Skip the java.home and java.version stuff, we use that to point to a specific JVM

Use only :

os400.awt.native=true java.awt.headless=true


and see what happens.

Pete

Hatzenbeler, Tim wrote:



This is in our file:

java.home=/QIBM/ProdData/Java400/jdk14/
java.version=1.4 os400.awt.native=true java.awt.headless=true ------------------------------------

I'm running 5.2


If I use those settings, tomcat doesn't want to work...

I removed them, and placed them in the catalina.sh, and I got the same error...

"$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
  -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
  -Dcatalina.base="$CATALINA_BASE" \
  -Dcatalina.home="$CATALINA_HOME" \
--->  -Djava.awt.headless=true \
  -Djava.io.tmpdir="$CATALINA_TMPDIR" \
  org.apache.catalina.startup.Bootstrap "$@" start \
  >> "$CATALINA_BASE"/logs/catalina.out 2>&1 &

  if [ ! -z "$CATALINA_PID" ]; then
    echo $! > $CATALINA_PID
fi

40   02/03/06  15:34:59.128760  realcftrap2              0018F8   QJVAJNI
QSYS        *STMT
To module . . . . . . . . . :   QJVAJNI

To procedure  . . . . . . . :   JNI_CreateJavaVM

Statement . . . . . . . . . :   5529

Message . . . . :   The Java Virtual Machine has ended.

Cause . . . . . :   Java Virtual Machine 1 has ended because of reason
4. The reason codes are defined as follows: 01- A Java program called the

  java.lang.System.exit method with a zero status code. 02- A Java
program called the java.lang.System.exit method with a non zero status code
of


0. 03- An unexpected system error was detected. 04- A critical Java Virtual Machine thread has ended and processing cannot continue. Recovery .
.


. : If the Java Virtual Machine ended because of reason code 03, an internal error has occurred. Contact you service representative. Information about the error was saved in the Licensed Internal Code log.

40   02/03/06  15:34:59.254304  QJVAUTLJVM   QSYS        *STMT    QJVAJVM
QSYS        *STMT
From module . . . . . . . . :   QJVAUTLJVM

From procedure  . . . . . . :   JvaSendMsg


Do I need to launch tomcat through the pase enviornment? Or just the standard strqsh?

I'm struggling here...

Thanks, Tim

-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
On Behalf Of Pete Helgren
Sent: Friday, February 03, 2006 1:41 PM
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] Tomcat java properties question

You don't set it for an app, you just set the general property in the /QIBM/UserData/Java400/SystemDefault.properties file

This is in our file:

java.home=/QIBM/ProdData/Java400/jdk14/
java.version=1.4 os400.awt.native=true java.awt.headless=true
HTH

Pete Helgren


Hatzenbeler, Tim wrote:



I have a webapp, that is giving me this error message...

AWT class or API used without specifying property os400.awt.native=true or java.awt.headless=true

How would I set the headless = true, for an app in tomcat?
Thanks, Tim




--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/web400.



--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list To post
a


message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change
list


options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/web400.



--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list To post a
message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list
options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/web400.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.