Thursday, October 25, 2012

WAS 7.0 app will not start inside RAD 7.5

PROBLEM:

The following error message appears when a J2EE app is attempted for deployment-
A composition unit with name  already exists. Select a different application name.

RESOLUTION:

Delete the /blas and /cus directories for the bad application from the configuration.
The resources will be located in the config directory of the profile.:

/config/cells/qcell/blas
/config/cells/qcell/cus 

See the following URL for more details:

Once the above directories are deleted, add projects to WAS Server inside RAD and then publish the application.

Thursday, April 28, 2011

SMTP RCPT TO Invalid address

PROBLEM:
Recently when my web application was sending out SMTP emails out to end users, I noticed the following error-
javax.mail.SendFailedException: Invalid Addresses;
com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3 Invalid address
at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1196)

CAUSE:
The end user's email address was not correct i.e., instead of being in the format of "user@domain.com", it was formatted as "user" i.e., missing domain information.

Monday, January 24, 2011

IBM WAS Changing Class Loader Policy on the Fly

I was recently working with an application and I needed to change the Class Loader policy for the WAS 7.0 server. It was set to "SINGLE". There was an issue with Integrated Service Console (ISC) application which also happens to be the Admin Console for the local installation. I could not bring up the Admin Console.

I discovered that I could change the classloader policy at the Server level from "SINGLE" to "MULTIPLE" by (a) opening this file using a text editor -C:\WAS70\profiles\AppSrv01\config\cells\US-L3L5666-LNode02Cell\nodes\US-L3L5666-LNode02\servers\server1\server.xml
(b) replace "SINGLE" with "MULTIPLE"

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.