Troubleshooting Apache Geronimo 2.1
From TroubleshootingWiki
| Official Page |
| Project Documentation |
| Download |
|
Contents |
Server startup errors
If any of the configurations fail to start during server startup, the server will automatically be shutdown. Most errors during startup are logged to the command window, as well as to the geronimo.log file under the <GERONIMO_HOME>/var/log directory (<GERONIMO_HOME>/<INSTANCE_NAME>/var/log directory in the case of a non-default instance). Here are some common startup errors and ways to resolve these errors.
BindException
A BindException is thrown when a GBean attempts to bind to a port that is already in use by another process on the system. A typical log entry for this kind of error is shown below:
2009-07-14 00:02:14,642 ERROR [GBeanInstanceState] Error while starting; GBean is now in the FAILED state: abstractName="org.apache.geronimo. framework/rmi-naming/2.1.4/car? ServiceModule=org.apache.geronimo. framework/rmi-naming/2.1.4/car, j2eeType=GBean,name=RMIRegistry" java.rmi.server.ExportException: Port already in use: 1099; nested exception is: java.net.BindException: Address already in use: JVM_Bind at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:249) ...
Some of the reasons due to which this error may occur, and the associated remedies are:
- The server instance is already running in a different server process. There is nothing to do in this case.
- You are attempting to start a different server instance created using the multiple instances feature provided by Geronimo, and the
org.apache.geronimo.server.namesystem property is not set. Make sure that you set theorg.apache.geronimo.server.namesystem property correctly, by using theGERONIMO_OPTSenvironment variable. - You are attempting to start a different server instance created using the multiple instances feature provided by Geronimo, and the
org.apache.geronimo.server.namesystem property is set correctly. ThePortOffsetproperty in theconfig-substitutions.propertiesfile under<GERONIMO_HOME>/<INSTANCE_NAME>/var/configmay not have been set correctly. Set thePortOffsetproperty so that the conflict is resolved. Remember that this property is used to offset the server ports when using multiple instances within the same installation.
IllegalArgumentException due to a wrong instance name
An IllegalArgumentException is thrown when you attempt to start a non-existent server instance. A message similar to the following is logged to the console:
11:49:26,439 ERROR [GBeanInstanceState] Error while starting; GBean is now in the FAILED state: abstractName="org.apache.geronimo.framework /j2ee-system/2.1.4/car? ServiceModule=org.apache.geronimo. framework/j2ee-system/2.1.4/car, j2eeType=GBean,name=ServerInfo" java.lang.IllegalArgumentException: Server directory is not a directory: C:\tutorial\temp\geronimo-tomcat6-javaee5-2.1.4\wrong_inst at org.apache.geronimo.system.serverinfo. BasicServerInfo.deriveBaseServer(BasicServerInfo.java:187) ...
To resolve this problem, specify the correct instance name in the org.apache.geronimo.server.name system property.
InvalidConfigurationException
An InvalidConfigurationException is thrown when a configuration that the server is attempting to start does not exist. One reason due to which this can happen is with the multiple server instances feature, when a configuration deployed through one server instance is undeployed through a different server instance, which results in entries corresponding to that configuration being left out of the config.xml files. A typical error message logged in this case looks like the following:
org.apache.geronimo.kernel.config.InvalidConfigException: Could not locate configs to start: [packt-samples/helloworld/1.0/war] at org.apache.geronimo.system.main. EmbeddedDaemon.doStartup(EmbeddedDaemon.java:167)
To resolve this problem, edit the config.xml
file and remove the problematic configuration entries.
Deployment errors
In this section, we will look at some common deployment errors and how these errors can be resolved.
MissingDependencyException
A MissingDependencyException is thrown when a configuration or
repository artifact specified as a dependency in the application, or the
configuration being deployed does not exist on the server.
The following is a typical error message displayed during deployment:
Error: Unable to deploy mywebapp-1.0.war: Unable to createconfiguration for deployment load of default/mywebapp-1.0/1.0/war failed Error starting configuration gbean default/mywebapp-1.0/1.0/war Missing dependency: default/non-existant/1.0/jar
The following is a typical message logged to Administration Console when deploying from Deploy New portlet:
org.apache.geronimo.common.DeploymentException: Unable to create configuration for deployment at org.apache.geronimo.deployment. DeploymentContext. createTempConfiguration (DeploymentContext.java:150) Caused by: org.apache.geronimo.kernel. repository.MissingDependencyException: Missing dependency: default/non-existant/1.0/jar at org.apache.geronimo.kernel.config. ConfigurationResolver.resolve (ConfigurationResolver.java:113) ...
To resolve this error, make sure that the parent configurations declared in the dependencies exist on the server. You can use the Repository Viewer portlet to view a list of artifacts in the repository. Click on the artifact in the portlet to get help on how to use the artifact as a dependency.
XmlException Invalid deployment descriptor
An XmlException can occur due to an erratic deployment plan, or if the deployer is unable to recognize an element. The following is an example of a deployment exception due to an element in the deployment plan not being recognized:
org.apache.geronimo.common.DeploymentException: xml problem for web app . Caused by: org.apache.xmlbeans.XmlException: Invalid deployment descriptor: errors: error: cvc-complex-type.2.4a: Expected elements 'work-dir@http://geronimo.apache.org/xml/ns/j2ee/web/ tomcat-2.0.1 clustering@http://geronimo.apache.org/xml/ns/j2ee/ application-2.0 web-container @http://geronimo.apache.org/xml/ns/naming-1.2 host @http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1 cross-context @http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1 disable-cookies @http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1 valve-chain @http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1 listener-chain @http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1 tomcat-realm @http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1 manager @http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1 cluster @http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1 abstract-naming-entry @http://geronimo.apache.org/xml/ns/naming-1.2 ejb-ref @http://geronimo.apache.org/xml/ns/naming-1.2 ejb-local-ref @http://geronimo.apache.org/xml/ns/naming-1.2 service-ref @http://geronimo.apache.org/xml/ns/naming-1.2 resource-ref @http://geronimo.apache.org/xml/ns/naming-1.2 resource-env-ref @http://geronimo.apache.org/xml/ns/naming-1.2 message-destination @http://geronimo.apache.org/xml/ns/naming-1.2 security-realm-name @http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1 service @http://geronimo.apache.org/xml/ns/deployment-1.2 persistence @http://java.sun.com/xml/ns/persistence' instead of 'tomcat-clustering-wadi @http://geronimo.apache.org/xml/ns/tomcat-clustering-wadi-1.2' here Descriptor: <xml-fragment xmlns:tom= "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1" xmlns:tom1="http://geronimo.apache.org/xml/ns/tomcat-clustering-wadi-1.2"> <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/ deployment-1.2"> <dep:moduleId> <dep:groupId>packt-samples</dep:groupId> <dep:artifactId>helloworld-cluster</dep:artifactId> <dep:version>1.0</dep:version> <dep:type>war</dep:type> </dep:moduleId> <dep:dependencies/> </dep:environment> <tom:context-root>/helloworld-cluster</tom:context-root> <tom1:tomcat-clustering-wadi/> <!--clustering-wadi/--> </xml-fragment> at org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil. validateDD(XmlBeansUtil.java:187) ...
In this example, the error is due to the <tomcat-clustering-wadi/> element not being recognized, as the org.apache.geronimo.configs/tomcat6-clustering-builder-wadi/2.1.4/car is not running when deployment was attempted. To resolve this kind of error, start the builder configuration and deploy the application again.
DuplicateDeploymentException
A DuplicateDeploymentException is thrown when an EJB module contains EJBs with the same names as the EJBs already running on the server. This is because the deployment-ids created for the EJBs are same as the running EJBs. A typical log message for this error is given below:
2009-07-17 01:03:17,421 ERROR [GBeanInstanceState] Error while starting; GBean is now in the FAILED state: abstractName="packt-samples/myejbapp/2.0/jar? J2EEApplication=null,j2eeType=EJBModule,name=packt-samples/myejbapp/2.0/jar" org.apache.openejb.DuplicateDeploymentIdException: Application cannot be deployed as it contains deployment-ids which are in use: app: C:\tutorial\geronimo-tomcat6-javaee5-2.1.4\var\temp\geronimo- deployer5436850122084871803.tmpdir\myejbapp.jar myejbapp/MySessionBean myejbapp/MyEjb3ServiceBean myejbapp/MyEjb3ServiceBean2 myejbapp/MyEjb3ServiceBean3 at org.apache.openejb.assembler.classic.Assembler. createApplication(Assembler.java:438) ...
This error can be overcome by setting the openejb.deploymentId.format system variable, in order to override the default setting that is causing the conflict. See http://openejb.apache.org/3.0/system-properties.html and http://openejb.apache.org/3.0/jndi-names.html for more details.
Runtime errors
In this section, we will look at some runtime errors that can occur and how these errors can be resolved.
LoginException No LoginModules configured
A LoginException occurs when the security realm configured in a web application is not running on the server. A warning message similar to the following will be logged to the geronimo.log file.
2009-07-17 00:48:58,234 WARN [TomcatGeronimoRealm] Login exception authenticating username "system" javax.security.auth.login.LoginException: No LoginModules configured for test-realm ...
To resolve this error, make sure that the configured security realm is running. You can use the Security Realms portlet to view all of the security realms running on the server. To avoid running the application while the security realm is stopped, you should add a dependency on the security realm configuration to your application's deployment plan, so that the security realm is started automatically before starting your application.
Source
The source of this content is Chapter Appendix B: Troubleshooting Apache Geronimo 2.1 of Apache Geronimo 2.1: Quick Reference by Manu T. George, Vamsavardhana Reddy Chillakuru (Packt Publishing, 2009).

