Friday, December 10, 2010

Converting XMI file to XML

With J2EE 5.0 applications, we might see the following error during application deployment to WAS 7.0

com.ibm.websphere.management.application.client.AppDeploymentException: ADMA0207E: EE 5 module adminredirector.war in ear file contains unsupported xmi format bindings file.
at com.ibm.ws.management.application.client.AppInstallHelper.checkIfEE5ModulesContainXMIBindings(AppInstallHelper.java:1066)
at com.ibm.ws.management.application.client.AppInstallHelper.checkForEE5Restrictions(AppInstallHelper.java:324)
at com.ibm.ws.management.application.task.ValidateEE5RestrictionTask.performTask(ValidateEE5RestrictionTask.java:126)
The way to overcome the above error is
1) Convert ibm-web-ext.xmi and ibm-web-bnd.xml files to use the new IBM's J2EE 5.0 XML schema. Use files from an existing J2EE 5.0 application in RAD 7.5 or RAD 8.0 as a sample and modify them.
2) Change file extension to ".xml" from ".xmi".

Redeploy the application.

Wednesday, October 6, 2010

OpenJPA 1.2.2 in RAD 7.5

PROBLEM #1:

org.apache.openjpa.util.UserException: A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName property.

at org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:74)

..

..

[10/6/10 8:43:48:255 CDT] 00000017 SystemErr R Caused by: java.lang.RuntimeException: There were errors initializing your configuration: org.apache.openjpa.util.UserException: A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName property.

at org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:74)


RESOLUTION:

The link between WAS and OpenJPA is the "datasource" name specified in "persistence.xml". The above error indicates that such a link does not exist i.e., the datasource speficied in persistence.xml can not be found as JNDI resource on the WAS server. Therefore configure a matching JDBC resource (datasource). Further details on the link between two is found in OpenJPA-1.2.2 Manual.pdf - Section 4.2. Using a Third-Party DataSource.


PROBLEM #2:

[10/6/10 9:21:30:773 CDT] 00000019 SystemErr R org.apache.openjpa.persistence.PersistenceException: There were errors initializing your configuration: org.apache.openjpa.util.UserException: A connection could not be obtained for driver class "null" and URL "null". You may have specified an invalid URL.

at org.apache.openjpa.jdbc.schema.DataSourceFactory.newConnectException(DataSourceFactory.java:256)


RESOLUTION:

In the Data Source Configuration, I need to select the "Component-managed Authentication Alias". If it had a value of "None' which is the default, I was witnessing the above problem.

Friday, August 27, 2010

What edition of Eclipse ?


I use IBM's Rational Application Developer (RAD) as IDE. I know it is built on top of Eclipse platform. There are multiple versions of Eclipse - Europa(3.3), Ganymede(3.4), Galileo(3.5) and Helios (3.6).
How do I tell what version of Eclipse is my RAD built upon?
Within RAD, go to Help--> About RAD for WebSphere Software. Click on "Configuration Details" button at the bottom.

Save the configuration properties to a ".txt" file and search inside it for "org.eclipse.platform".
I have found an entry in mine -
org.eclipse.platform (3.4.2.R342_v20090122-9I96EiWElHi8lheoJKJIvhM3JfVsYbRrgVIWL) "Eclipse Platform"

From the above, I conclude that my RAD is based on Eclipse 3.4 or Ganymede platform.

Monday, April 5, 2010

Adding Shared Libraries to WAS 7.0 Application

I had a couple of shared libraries that I wanted to associate with a Web App inside IBM WAS 7.0 Admin Console. When I opened the "Shared Libraries" option for the application, I could add the new shared libraries but they would not stick i.e., could not be saved. This might be a bug in the admin console.

I found that the following work around is effective. Export the application as an EAR file. Then deploy the application using "Install" option. Once this is done, the shared libraries "stick" with the application.

Wednesday, March 31, 2010

Mismatched serialization UIDs minor code 89A

Recently I was trying to run MyFaces TomaHawk examples under IBM WebSphere WAS 7.0 in RAD 7.5 environment. The set of examples were available as a WAR file at the Apache MyFaces Tomahawk downloads site. I imported the WAR file into my workspace without any issues. However when I tried to publish the application to the server, it would not deploy. I was noticing the following error -
Application Failed to Start. myfaces-example-simple-1.1.9EAR
java.rmi.MarshalException: CORBA MARSHAL 0x4942f89a No; nested exception is:

org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Mismatched serialization UIDs : Source (RepId RMI:java.lang.Throwable:F8678B4F4D2EB705:D5C635273977B8CB) = D5C635273977B8CB whereas Target (RepId RMI:com.ibm.ws.webcontainer.exception.WebAppNotLoadedException:2E921E9DEB124A7F:2D33383134313233) = 2D33383134313233 vmcid: IBM minor code: 89A completed: No


When I tried Google Search, there just were too many hits. The one that I found relevant to my situation was the mismatch between configuration files and my intended deployment environment. I intended to use J2EE 5.0, Servlet container 2.5 and JSF 1.2 versions. However the imported examples WAR file was using Servlet container 2.4 and JSF 1.0 versions. Once I made the "web-app" tag in web.xml to conform to Servlet container 2.5 specification and "faces-config" tag in Faces Configuration files to JSF 1.2 version, the problem went away. It was an easy fix but finding the issue was hard. Phew!