iSeries EGL

All things EGL for the iSeries / i5 / Power System

Tomcat on the iSeries. Running Headless.

leave a comment »

First things, first. The server

When running Tomcat on the iSeries a few modifications to its startup script are required. First, the iSeries is headless, meaning it has no keyboard, monitor or mouse attached. (Yes, there are admin consoles, but this isn’t the same thing.)

In our case, Tomcat is running in a UNIX environment therefore the startup script for Tomcat is catalina400.sh. Do not modify the windows version (catalina400.bat)

Within catalina400.sh, Tomcat’s startup command (shown below) must be modified to include an additional parameter beyond the original parameters already supplied to the command.

 

Variable to indicate the server is operating in a ‘Headless’ state

The parameter “-Djava.awt.headless=true” is used to indicate to Java that the system, i.e the iSeries, is operating in a configuration in which the display device, keyboard, or mouse is lacking. See this link for a full explanation

The full command is :


java -ms64m -Duser.dir="$CATALINA_BASE" -Dcatalina.base="$CATALINA_BASE" -Dcatalina.home="$CATALINA_HOME" -Djava.awt.headless=true org.apache.catalina.startup.Bootstrap "$@" start

All parameter name/value pairs begin with “-D”.

Without the parameter, this stack-trace is produced, which is complaining about graphics, which the iSeries does not have. This is the clue indicating the proper course of action which results in the use of the parm.


SEVERE: Critical error during deployment: java.lang.UnsatisfiedLinkError at java.lang.Throwable.(Throwable.java:181) at java.lang.Error.(Error.java:37) at java.lang.LinkageError.(LinkageError.java:26) at java.lang.UnsatisfiedLinkError.(UnsatisfiedLinkError.java:25) at sun.java2d.Disposer.(Disposer.java:42) at javax.imageio.stream.MemoryCacheImageInputStream.(MemoryCacheImageInputStream.java:61) at com.sun.imageio.spi.InputStreamImageInputStreamSpi.createInputStreamInstance(InputStreamImageInputStreamSpi.java:53) at javax.imageio.ImageIO.createImageInputStream(ImageIO.java:331) at org.richfaces.application.InitializationListener$AWTInitializer.initialize(InitializationListener.java:84) at org.richfaces.application.InitializationListener.onStart(InitializationListener.java:122) at org.richfaces.application.InitializationListener.processEvent(InitializationListener.java:152) at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106) at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2129) at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2105) at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:300) at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:600) at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:369) at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:563) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1397) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:575) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1500) at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:252) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:186) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) . . .

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: