Friday, August 29, 2008

Will it load?

After thinking about the Websphere errors I got yesterday, I thought about getting the Rational Developer from IBM - I have a developer's research ID and should be able to get a development environment for testing setup and loading the erroneous code. But, that may also be a big waste of time... Not sure, I'll keep it in mind though, but I really don't want to waste a few days setting up another development environment on top of what I already have. And, it may cause conflicts...

I went ahead and brought up Eclipse and tried a simple import of the EAR (I already know things aren't that easy, this is a J2EE app and it requires additional stuff like a database connection pool and additional JARs to properly function). And sure enough, it won't even import, bombing out during the import with a cryptic error on a FILE NOT FOUND but with no indication of what is not found. Here is the Glassfish log for the attempted run:
[#|2008-08-29T10:26:42.596-0500|INFO|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|Application server startup complete.|#]

[#|2008-08-29T10:26:45.596-0500|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;;|Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context ''|#]

[#|2008-08-29T10:26:45.596-0500|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;;|Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context ''|#]

[#|2008-08-29T10:28:25.786-0500|INFO|sun-appserver9.1|javax.enterprise.system.tools.admin|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;C:\Documents and Settings\rcbp010\Local Settings\Temp\s1astempdomain1server-1990537853\SUN_cbci_app.ear;|ADM1006:Uploading the file to:[C:\Documents and Settings\rcbp010\Local Settings\Temp\s1astempdomain1server-1990537853\SUN_cbci_app.ear]|#]

[#|2008-08-29T10:28:25.786-0500|INFO|sun-appserver9.1|javax.enterprise.system.tools.admin|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;C:\Documents and Settings\rcbp010\Local Settings\Temp\s1astempdomain1server-1990537853\SUN_cbci_app.ear;|ADM1006:Uploading the file to:[C:\Documents and Settings\rcbp010\Local Settings\Temp\s1astempdomain1server-1990537853\SUN_cbci_app.ear]|#]

[#|2008-08-29T10:28:35.614-0500|INFO|sun-appserver9.1|javax.enterprise.system.core.classloading|_ThreadID=19;_ThreadName=Thread-88;|LDR5202:Exception in EJBClassLoader
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
    at java.io.WinNTFileSystem.canonicalize0(Native Method)
    at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:396)
    at java.io.File.getCanonicalPath(File.java:559)
    at com.sun.enterprise.loader.EJBClassLoader$1.run(EJBClassLoader.java:435)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.enterprise.loader.EJBClassLoader.findResource0(EJBClassLoader.java:405)
    at com.sun.enterprise.loader.EJBClassLoader.findResource(EJBClassLoader.java:484)
    at java.lang.ClassLoader.getResource(ClassLoader.java:977)
    at java.lang.ClassLoader.getResource(ClassLoader.java:972)
    at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1159)
    at com.sun.enterprise.loader.EJBClassLoader.getResourceAsStream(EJBClassLoader.java:799)
    at com.sun.xml.rpc.spi.JaxRpcObjectFactory.newInstance(JaxRpcObjectFactory.java:131)
    at com.sun.enterprise.webservice.codegen.JaxRpcRICodegen.(JaxRpcRICodegen.java:134)
    at com.sun.enterprise.webservice.codegen.JaxRpcCodegenFactory.getAdapter(JaxRpcCodegenFactory.java:63)
    at com.sun.ejb.codegen.IASEJBC.doCompile(IASEJBC.java:855)
    at com.sun.ejb.codegen.IASEJBC.ejbc(IASEJBC.java:593)
    at com.sun.enterprise.deployment.backend.EJBCompiler.preDeployApp(EJBCompiler.java:290)
    at com.sun.enterprise.deployment.backend.EJBCompiler.compile(EJBCompiler.java:226)
    at com.sun.enterprise.deployment.backend.AppDeployer.runEJBC(AppDeployer.java:319)
    at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:240)
    at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:148)
    at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:191)
    at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
    at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919)
    at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:279)
    at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:788)
    at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187)
    at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:223)
|#]

[#|2008-08-29T10:28:35.614-0500|INFO|sun-appserver9.1|javax.enterprise.system.core.classloading|_ThreadID=19;_ThreadName=Thread-88;|LDR5202:Exception in EJBClassLoader
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
    at java.io.WinNTFileSystem.canonicalize0(Native Method)
    at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:396)
    at java.io.File.getCanonicalPath(File.java:559)
    at com.sun.enterprise.loader.EJBClassLoader$1.run(EJBClassLoader.java:435)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.enterprise.loader.EJBClassLoader.findResource0(EJBClassLoader.java:405)
    at com.sun.enterprise.loader.EJBClassLoader.findResource(EJBClassLoader.java:484)
    at java.lang.ClassLoader.getResource(ClassLoader.java:977)
    at java.lang.ClassLoader.getResource(ClassLoader.java:972)
    at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1159)
    at com.sun.enterprise.loader.EJBClassLoader.getResourceAsStream(EJBClassLoader.java:799)
    at com.sun.xml.rpc.spi.JaxRpcObjectFactory.newInstance(JaxRpcObjectFactory.java:131)
    at com.sun.enterprise.webservice.codegen.JaxRpcRICodegen.(JaxRpcRICodegen.java:134)
    at com.sun.enterprise.webservice.codegen.JaxRpcCodegenFactory.getAdapter(JaxRpcCodegenFactory.java:63)
    at com.sun.ejb.codegen.IASEJBC.doCompile(IASEJBC.java:855)
    at com.sun.ejb.codegen.IASEJBC.ejbc(IASEJBC.java:593)
    at com.sun.enterprise.deployment.backend.EJBCompiler.preDeployApp(EJBCompiler.java:290)
    at com.sun.enterprise.deployment.backend.EJBCompiler.compile(EJBCompiler.java:226)
    at com.sun.enterprise.deployment.backend.AppDeployer.runEJBC(AppDeployer.java:319)
    at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:240)
    at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:148)
    at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:191)
    at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
    at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919)
    at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:279)
    at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:788)
    at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187)
    at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:223)
|#]

[#|2008-08-29T10:28:39.333-0500|INFO|sun-appserver9.1|javax.enterprise.system.tools.deployment|_ThreadID=19;_ThreadName=Thread-88;|deployed with moduleid = SUN_cbci_app|#]

[#|2008-08-29T10:28:39.333-0500|INFO|sun-appserver9.1|javax.enterprise.system.tools.deployment|_ThreadID=19;_ThreadName=Thread-88;|deployed with moduleid = SUN_cbci_app|#]
Curious, there are two entries for each entry in the log... were there somehow two instances of the server running??? hmmm....

Thursday, August 28, 2008

Meticulous Investigation

A careful inspection of what's happening is in order. It's time to dig into this thing before blindly banging my head on a wall trying to determine why there was no module referenced in the first migration.

An idea came to me - the thought is to perform the following procedure: extract the websphere EARs and put extracted files in a folder, migrate the EARs into another folder, perform another extract on the migrated EARs into a third folder. Then, I can readily compare differences between the extracted files and inspect the XML for any issues I'll need to address or such things I may want to research or call in the lifeline forum support team :)

This project consists of 9 related applications. The majority of the applications deploy 3 or 4 of the EARs with many EJB EARs being reused. I'll pick an application that is composed of 4 EARs called "cbci_app". Within the file structure provided by the hosting entity, I see there are 4 EARs:
- cbci_app
- cwmmanager_ejb
- cwsmanager_ejb
- offline_ejb

So, I created a testing area, set up four "parent" folders named for their EAR name. Within each, I created 3 folders labeled "IBM_extraction", "Sun_migration", "Sun_extraction". I placed the original EAR files in the root area containing the 4 parents and renamed all 4 files by appending "ibm_". Then, I extracted the files and moved all them into the specific "IBM_extraction" folder for that EAR.
H:\Testing\cbci_app\ibm_extraction\>%java_home%\bin\jar -xvf ..\..\ibm_cbci_app.ear
  inflated: META-INF/MANIFEST.MF
  inflated: .j2ee
   created: META-INF/
  inflated: cbci_app.war
  inflated: .compatibility
  inflated: itext-1.3.jar
  inflated: META-INF/ibm-application-ext.xmi
  inflated: META-INF/application.xml
  inflated: .runtime
  inflated: META-INF/.modulemaps

H:\Testing\cbci_app\ibm_extraction\>cd ..\..

H:\Testing\>
Then, I invoked the migration tool and copied the resultant files into the specific "Sun_extraction" folder.
H:\Testing\>%asmt_home%\bin\asmigrate -c -S ws50 -T glassfish -t h:\testing\cbci_app\sun_migration h:\testing\ibm_cbci_app.ear
JAVA_HOME=C:\Java\jdk5
ASMT_HOME=c:\Java\SDK\asmt
J2EE_HOME=C:\Java\SDK

Extracting archives :-
-------------------

Extracting: cbci_app.ear
xxx

Extracting: cbci_app.war
xxxxxx

Clean up...

Pre-processing input :-
-------------------
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||||||||||

Migration Status :-
----------------

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

---------------------- Output SUMMARY ------------------------

Java:

Total files processed : - 36
Succeded : - 0
Failed : - 0
Partially Processed : - 0
Unchanged : - 36

JSP:

Total files processed : - 33
Succeded : - 0
Failed : - 0
Partially Processed : - 0
Unchanged : - 33

XML:

Total files processed : - 4
Succeded : - 4
Failed : - 0
Partially Processed : - 0
Unchanged : - 0

HTML:

Total files processed : - 17
Succeded : - 0
Failed : - 0
Partially Processed : - 0
Unchanged : - 17

Configuration:

Total files processed : - 0
Succeded : - 0
Failed : - 0
Partially Processed : - 0
Unchanged : - 0

--------------------- End of SUMMARY ------------------------

H:\Testing>
Next, I see that the resulting EAR filename still has the ibm prefix, so I remove that in order to use this later as the "real" tool within my development environment. Then, I copy the EAR to the sun_extraction folder as well as the root and extract...
H:\Testing\>ren cbci_app\sun_migration\ibm_cbci_app.ear cbci_app.ear

H:\Testing\>copy cbci_app\sun_migration\cbci_app.ear .\sun_cbci_app.ear

1 files copied

H:\Testing\>copy sun_cbci_app.ear cbci_app\sun_extraction

1 files copied

H:\Testing\>cd cbci_app\sun_extraction

H:\Testing\cbci_app\sun_extraction\>%java_home%\bin\jar -xvf ..\..\sun_cbci_app.ear
  inflated: .compatibility
  inflated: .j2ee
  inflated: .runtime
  inflated: cbci_app.war
  inflated: itext-1.3.jar
  inflated: META-INF\.modulemaps
  inflated: META-INF\application.xml
  inflated: META-INF\ibm-application-ext.xmi
  inflated: META-INF\MANIFEST.MF
  inflated: META-INF\sun-application.xml

H:\Testing\cbci_app\sun_extraction\>cd ..\..

H:\Testing\>

And I continue until all four EARs are extracted... (I wish it would be that easy...)

And wouldn't ya know it... I saw that 5 Java files failed to successfully migrate in the very next EJB EAR.
H:\Testing\cwmmanager_ejb>%asmt_home%\bin\asmigrate -c -S ws50 -T glassfish -t sun_migration ibm_cwmmanager_ejb.ear
JAVA_HOME=C:\Java\jdk5
ASMT_HOME=c:\Java\SDK\asmt
J2EE_HOME=C:\Java\SDK

Extracting archives :-
-------------------

Extracting: ibm_cwmmanager_ejb.ear
xxx

Extracting: cwmmanager_ejb.jar
xxxxxxxxx

Clean up...

Pre-processing input :-
-------------------
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Migration Status :-
----------------

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

---------------------- Output SUMMARY ------------------------

Java:

Total files processed : - 23
Succeded : - 0
Failed : - 5
Partially Processed : - 0
Unchanged : - 18

JSP:

Total files processed : - 0
Succeded : - 0
Failed : - 0
Partially Processed : - 0
Unchanged : - 0

XML:

Total files processed : - 3
Succeded : - 3
Failed : - 0
Partially Processed : - 0
Unchanged : - 0

HTML:

Total files processed : - 0
Succeded : - 0
Failed : - 0
Partially Processed : - 0
Unchanged : - 0

Configuration:

Total files processed : - 0
Succeded : - 0
Failed : - 0
Partially Processed : - 0
Unchanged : - 0


--------------------- End of SUMMARY ------------------------

H:\Testing\cwmmanager_ejb>
Opening the HTML report and navigating to the #Failed section, all 5 files reference "unsupported proprietary" websphere classes:
- com.ibm.websphere.csi.CSIServant
- com.ibm.websphere.csi.TransactionalObject
- com.ibm.ejs.container.*

well... Ain't this a monkey wrench? Now we're in for some work trying to figure out what is needed from those classes and what would be a Sun equivalent. No one promise a rose garden (but I was hoping). Inspecting some of the code for the classes, it turns out these are all generated RMI stubs - hrmmmpffff - I might need some help with this.

Anyhow, I will continue with the rest of the EARs and see what else falls out...

Same thing occurred with the cwsmanager_ejb EAR and offline_ejb EAR, same classes falling out, same RMI stubs. Maybe it won't be all that bad. I'll just have to figure out a Sun equivalent for those 2 com.ibm.websphere.csi classes and figure out an equivalent to the com.ibm.ejs.container tree. I believe I have all the source code...

Now, with that issue in mind, I'll investigate and compare the application.xml files in all the EARs... (note, I'll insert spaces to confuse the blog's parser)

WEBSPHERE ==--> cbci_app\ibm_extraction\application.xml:
< ?xml version="1.0" encoding="UTF-8"? >
< !DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
< application id="Application_ID">
  < display-name>cbci_app.ear< /display-name>
  < module id="WebModule_1127318530434">
    < web>
      < web-uri>cbci_app.war< /web-uri>
      < context-root>/app/cbci< /context-root>
    < /web>
  < /module>
< /application>

GLASSFISH ==--> cbci_app\sun_extraction\application.xml:
< ?xml version="1.0" encoding="UTF-8"? >
< application version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
  < display-name>cbci_app.ear< /display-name>
  < module>
    < web>
      < web-uri>cbci_app.war< /web-uri>
      < context-root>/app/cbci< /context-root>
    < /web>
  < /module>
< /application>

GLASSFISH ==--> cbci_app\sun_extraction\sun-application.xml:
< ?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE sun-application PUBLIC "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 8.0 J2EE Application 1.4//EN" "http://www.sun.com/software/sunone/appserver/dtds/sun-application_1_4-0.dtd">
< sun-application/>

WEBSPHERE ==--> cwmmanager_ejb\ibm_extraction\application.xml:
< ?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
< application id="Application_ID">
  < display-name>cwmmanager_ejb.ear< /display-name>
  < module id="EjbModule_1199742798007">
    < ejb>cwmmanager_ejb.jar< /ejb>
  < /module>
< /application>

GLASSFISH ==--> cwmmanager_ejb\sun_extraction\application.xml:
< ?xml version="1.0" encoding="UTF-8"?>
< application version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
  < display-name>cwmmanager_ejb.ear< /display-name>
  < module>
    < ejb>cwmmanager_ejb.jar< /ejb>
  < /module>
< /application>

GLASSFISH ==--> cwmmanager_ejb\sun_extraction\sun-application.xml:
< ?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE sun-application PUBLIC "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 8.0 J2EE Application 1.4//EN" "http://www.sun.com/software/sunone/appserver/dtds/sun-application_1_4-0.dtd">
< sun-application/>

WEBSPHERE ==--> cwsmanager_ejb\ibm_extraction\application.xml:
< ?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
< application id="Application_ID">
  < display-name>cwsmanager_ejb.ear< /display-name>
  < module id="EjbModule_1123102691856">
    < ejb>cwsmanager_ejb.jar< /ejb>
  < /module>
< /application>

GLASSFISH ==--> cwsmanager_ejb\sun_extraction\application.xml:
< ?xml version="1.0" encoding="UTF-8"?>
< application version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
  < display-name>cwsmanager_ejb.ear< /display-name>
  < module>
    < ejb>cwsmanager_ejb.jar< /ejb>
  < /module>
< /application>

GLASSFISH ==--> cwsmanager_ejb\sun_extraction\sun-application.xml:
< ?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE sun-application PUBLIC "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 8.0 J2EE Application 1.4//EN" "http://www.sun.com/software/sunone/appserver/dtds/sun-application_1_4-0.dtd">
< sun-application/>

WEBSPHERE ==--> offline_ejb\ibm_extraction\application.xml:
< ?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
< application id="Application_ID">
  < display-name>offline_ejb.ear< /display-name>
  < module id="EjbModule_1074111948423">
    < ejb>offline_ejb.jar< /ejb>
  < /module>
< /application>

GLASSFISH ==--> offline_ejb\sun_extraction\application.xml:
< ?xml version="1.0" encoding="UTF-8"?>
< application version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
  < display-name>offline_ejb.ear< /display-name>
  < module>
    < ejb>offline_ejb.jar< /ejb>
  < /module>
< /application>

GLASSFISH ==--> offline_ejb\sun_extraction\sun-application.xml:
< ?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE sun-application PUBLIC "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 8.0 J2EE Application 1.4//EN" "http://www.sun.com/software/sunone/appserver/dtds/sun-application_1_4-0.dtd">
< sun-application/>

Now all that's done, I should do a graphic display of what I have so far:
H:\Testing>tree
Folder PATH listing for volume Data
Volume serial number is 7FFDC000 FC69:DF84
H:.
+---cbci_app
¦   +---IBM_extraction
¦   ¦   +---META-INF
¦   +---Sun_extraction
¦   ¦   +---META-INF
¦   +---SUN_migration
¦       +---Input_Archives
¦           +---META-INF
¦           +---Utilities
¦           +---Wars
¦               +---cbci_app
¦                   +---META-INF
¦                   +---WEB-INF
¦                       +---classes
¦                       ¦   +---US
¦                       ¦       +---IL
¦                       ¦           +---state
¦                       ¦               +---revenue
¦                       ¦                   +---CBC
¦                       ¦                       +---CBCI
¦                       +---lib
+---cwmmanager_ejb
¦   +---IBM_extraction
¦   ¦   +---META-INF
¦   +---Sun_extraction
¦   ¦   +---META-INF
¦   +---Sun_migration
¦       +---Input_Archives
¦           +---Jars
¦           ¦   +---cwmmanager_ejb
¦           ¦       +---com
¦           ¦       ¦   +---ibm
¦           ¦       ¦       +---ejs
¦           ¦       ¦       ¦   +---container
¦           ¦       ¦       +---websphere
¦           ¦       ¦           +---csi
¦           ¦       +---META-INF
¦           ¦       +---org
¦           ¦       ¦   +---omg
¦           ¦       ¦       +---stub
¦           ¦       ¦           +---java
¦           ¦       ¦           ¦   +---lang
¦           ¦       ¦           ¦   +---util
¦           ¦       ¦           +---javax
¦           ¦       ¦               +---ejb
¦           ¦       +---US
¦           ¦           +---IL
¦           ¦               +---state
¦           ¦                   +---revenue
¦           ¦                       +---CWM
¦           ¦                           +---CWMManager
¦           ¦                               +---ejb
¦           +---META-INF
¦           +---Utilities
+---cwsmanager_ejb
¦   +---IBM_extraction
¦   ¦   +---META-INF
¦   +---Sun_extraction
¦   ¦   +---META-INF
¦   +---Sun_migration
¦       +---Input_Archives
¦           +---Jars
¦           ¦   +---cwsmanager_ejb
¦           ¦       +---com
¦           ¦       ¦   +---ibm
¦           ¦       ¦       +---ejs
¦           ¦       ¦       ¦   +---container
¦           ¦       ¦       +---websphere
¦           ¦       ¦           +---csi
¦           ¦       +---META-INF
¦           ¦       +---org
¦           ¦       ¦   +---omg
¦           ¦       ¦       +---stub
¦           ¦       ¦           +---java
¦           ¦       ¦           ¦   +---lang
¦           ¦       ¦           ¦   +---util
¦           ¦       ¦           +---javax
¦           ¦       ¦               +---ejb
¦           ¦       +---US
¦           ¦           +---IL
¦           ¦               +---state
¦           ¦                   +---revenue
¦           ¦                       +---CWS
¦           ¦                           +---CWSManager
¦           ¦                               +---ejb
¦           +---META-INF
¦           +---Utilities
+---offline_ejb
   +---IBM_extraction
   ¦   +---META-INF
   +---Sun_extraction
   ¦   +---META-INF
   +---Sun_migration
       +---Input_Archives
           +---Jars
           ¦   +---offline_ejb
           ¦       +---com
           ¦       ¦   +---ibm
           ¦       ¦       +---ejs
           ¦       ¦       ¦   +---container
           ¦       ¦       +---websphere
           ¦       ¦           +---csi
           ¦       +---META-INF
           ¦       +---org
           ¦       ¦   +---omg
           ¦       ¦       +---stub
           ¦       ¦           +---javax
           ¦       ¦               +---ejb
           ¦       +---US
           ¦           +---IL
           ¦               +---state
           ¦                   +---revenue
           ¦                       +---offline
           ¦                           +---ejb
           +---META-INF
           +---Utilities

H:\Testing>


Just had a thought... Isn't it interesting that all the application.xml files actually have a defined module - at least one? This is what prompted me to start this exercise anyhow... Makes me wonder if I can load the web app in Eclipse. Sounds like a job for tomorrow.

Wednesday, August 27, 2008

Baby steps...

After installing Java 5 SE JDK, I tried the migration again...
C:\>%asmt_home%\bin\asmigrate -c -S ws50 -T glassfish -t c:\temp\gfout c:\temp\c
bc_20080717\source\cbci_app_v2\cbci_app.ear
JAVA_HOME=C:\Java\jdk5
ASMT_HOME=c:\Java\SDK\asmt
J2EE_HOME=C:\Java\SDK

Extracting archives :-
-------------------


Extracting: cbci_app.ear
xxx

Extracting: cbci_app.war
xxxxxx

Clean up...


Selected Directory is not empty. Some Output file(s) may be overwritten. Do you
want to continue? (Y/N):y

Pre-processing input :-
-------------------
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||||||||||



Migration Status :-
----------------

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||





---------------------- Output SUMMARY ------------------------

Java:

Total files processed : - 36
Succeded : - 0
Failed : - 0
Partially Processed : - 0
Unchanged : - 36

JSP:

Total files processed : - 33
Succeded : - 0
Failed : - 0
Partially Processed : - 0
Unchanged : - 33

XML:

Total files processed : - 4
Succeded : - 4
Failed : - 0
Partially Processed : - 0
Unchanged : - 0

HTML:

Total files processed : - 17
Succeded : - 0
Failed : - 0
Partially Processed : - 0
Unchanged : - 17

Configuration:

Total files processed : - 0
Succeded : - 0
Failed : - 0
Partially Processed : - 0
Unchanged : - 0


--------------------- End of SUMMARY ------------------------

C:\>

WOOT!

So, after getting over my elation at the migration tool's successful run, I examine the output folder (C:\temp\GFOUT). Looks like ASMT created a folder structure during the extraction phase of the migration with a root folder entitled Input_Archives and I see an HTML page which turns out to be the migration report. I see only a single EAR that indicate re-packaging the application for deployment - but according to the documentation, I should have some build scripts or the migration tool should've invoked an ANT build. Maybe I'm not clear on what should've happened - so I look at the documentation again and think I should see if I can open the EAR within Eclipse.

Loading up Eclipse and making sure the AppServer is running, then importing the generated EAR file - I get an error message: "A Java EE Enterprise Application must contain one or more modules." referencing application.xml located at cbci_app/EarContent/META-INF.

Opening up the file in Eclipse's text mode:
{adding spaces so this blog won't interpret the XML code}

< ? xml version="1.0" encoding="UTF-8" ? >
< application id="Application_ID" version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" >
< display-name >
cbci_app< / display-name >
< / application >"


Gosh... There's nothing in there at all. Am I going to have to add the JARs manually? Definitely needs work!!! It's time to try this again... (in the morning...) and I'll probably post more info to the forums...

...and so it goes...

Tuesday, August 26, 2008

Migration woes...

Initial attempts at running the Glassfish Migration tool on the websphere code is still not bringing me joy and I'm wondering if this route is going to be a viable option or if I'll need to regroup and re-think the tasks needed to accomplish migrating the code. I spend some time getting a feel for the command-line options, thinking perhaps I might get some more insight or more output than I'm seeing with the GUI tool.

BTW - I've been running the migration tool using this command as a Windows shortcut:
C:\>%ASMT_HOME%\bin\asmigrate -u

So, I make another attempt and this time I decide I am going to work with an EAR file that is definitely a web application (so I can see what happens to JSPs - if we get that far). I run the following command sequence:
C:\>asadmin start-domain
Starting Domain domain1, please wait.
Log redirected to C:\Java\SDK\domains\domain1\logs\server.log.
Redirecting output to C:/Java/SDK/domains/domain1/logs/server.log
Domain domain1 is ready to receive client requests. Additional services are being started in background.
Domain [domain1] is running [Sun Java System Application Server 9.1_02 (build b04-fcs)] with its configuration and logs at: [C:\Java\SDK\domains].
Admin Console is available at [http://localhost:4848].
Use the same port [4848] for "asadmin" commands.
User web applications are available at these URLs:
[http://localhost:8081 https://localhost:8181 ].
Following web-contexts are available:
[/web1 /__wstx-services wsrp-consumer-portlet producer portletdriver consumer amserver wsrp-producer-portlet ].
Standard JMX Clients (like JConsole) can connect to JMXServiceURL:
[service:jmx:rmi:///jndi/rmi://aging002711:8686/jmxrmi] for domain management purposes.
Domain listens on at least following ports for connections:
[8081 8181 4848 3700 3820 3920 8686 ].
Domain does not support application server clusters and other standalone instances.

C:\>%asmt_home%\bin\asmigrate -c -S ws50 -T glassfish -t c:\temp\gfout c:\temp\cbc_20080717\source\cbci_app_v2\cbci_app.ear

JAVA_HOME=C:\Java\SDK\jdk\
ASMT_HOME=c:\Java\SDK\asmt
J2EE_HOME=C:\Java\SDK\

Extracting archives :-
-------------------

Extracting: cbci_app.ear
xxx

Extracting: cbci_app.war
xxxxxx

Clean up...

Selected Directory is not empty. Some Output file(s) may be overwritten. Do you
want to continue? (Y/N):y

Pre-processing input :-
-------------------
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||||||||||


Migration Status :-
----------------

Exception in thread "main" java.lang.NoSuchMethodError: javax.xml.bind.annotation.XmlAccessorType.value()Ljavax/xml/bind/annotation/AccessType;
at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getAccessType(ClassInfoImpl.java:244)
at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getProperties(ClassInfoImpl.java:195)
at com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.getProperties(RuntimeClassInfoImpl.java:79)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:112)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:45)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:37)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:141)
at com.sun.xml.bind.v2.model.impl.RegistryInfoImpl.(RegistryInfoImpl.java:50)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.addRegistry(ModelBuilder.java:183)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:152)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:306)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:179)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:70)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:50)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:133)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:286)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:244)
at sun.iasmt.util.ASMTJaxbContext.(Unknown Source)
at sun.iasmt.convertors.common.xmlconvertor.AppReader.read(Unknown Source)
at sun.iasmt.control.SJSMTXmlFileHandler.readXMLFile(Unknown Source)
at sun.iasmt.control.ASMTController.startupEngineAndConvert(Unknown Source)
at sun.iasmt.control.ASMTController.startupEngineAndConvert(Unknown Source)
at sun.iasmt.user.cmd.CommandCallController.(Unknown Source)
at sun.iasmt.user.IASMTMain.runTool(Unknown Source)
at sun.iasmt.user.IASMTMain.(Unknown Source)
at sun.iasmt.user.IASMTMain.main(Unknown Source)

C:\>

So far, after inspecting this output, I can tell I AM making progress!!! But, I'm still having some sort of issue that is related to either something not configured properly or something having to do with how the Migrate Tool is invoking JAXB (if my interpretation of the first "Unknown Source" element is correct). I try a couple of other EAR files that I know all call different classes and all result with the same exception. I decide to post to all three blogs again with an update indicating that progress is happening, but slowly... and am still stuck. Then I start researching some things on XML Parsing and JAXB implementations to see if I can figure something out.

Sekhar comes to the rescue again! He said,
"The problem is in using [the] migration tool with Java SE 6 (which includes JAXB 2.x). So if you are using [the latest] Java EE + JDK bundle from http://java.sun.com/javaee/downloads/index.jsp (Sun's Java downloads site), this will use JDK 6 and you will run into this problem."

He provided two potential workarounds:

  • download GlassFish distribution without Java SE bundled and Java SE 5 separately and set J2EE_HOME and JAVA_HOME accordingly.

  • if you have already downloaded Java EE + JDK bundle from Sun's Java downloads site, then download Java SE 5 (JDK) and set JAVA_HOME accordingly. This seems to override the JDK 6 installed with Java EE + JDK bundle.


Now it's time to go back to Sun's downloads and find the Java SE 5 JDK and download it.

..... to be continued .....

Monday, August 25, 2008

Let the games begin

Let me go into some of the steps I've taken to get started with this project. Since the primary task is to perform some form of conversion from the current Webspere environment to something else, I needed to decide what that something else was to be. It appears the folks to receive the converted application are a Microsoft shop with established SQL Server instances and an IIS web farm, I first investigated whether there's been any new information of using Java ISAPI wrappers for IIS (ie. using Tomcat to handle JSP. I know from previous experience this has traditionally been quite troublesome in a heavy-usage server with the ISAPI service dying or hanging and a number of other troublesome issues). Seems this is still a problem... I discussed other options and inquired about opposition to using a web server other than IIS, something like Apache or something a little more Java-friendly. Management is agreeable if I can make it work in their environment... So, I accepted the challenge...

I set up a development environment by downloading the latest Eclipse (Ganymede) J2EE package - which contained the complete Sun J2EE Developer Kit (SDK). I knew I'll need to know versions of main system involved and recorded what I downloaded:
- Java JDK SE 1.6
- (destination) Sun Application Server 9.1
- (from AS) Websphere Application Server 5.1
- (from DB) IBM DB2 8.2 (Fixpack 7)
- (dest. DB) M$ SQL Server 2000 (v8.00.760)


I loaded one of the built-in sample apps, built it and executed it - verified the install is good.

I learned of the Sun Migration Tool a while ago and went looking for it first by reading the documentation that comes with the Application Server downloaded with the complete J2EE Developer Kit from Sun and by researching Sun's website. I found this page. This sounds like just the tool I need to migrate all the code and web pages from the Websphere server over to development environment I set up. I downloaded it, read the docs (some of it anyway... especially that pertaining to installing and configuring), and followed the installation procedures. I grabbed a random JAR file from the code I was given to see if it could do something simple (I'm thinking I should start small before trying to tackle an entire EAR or something). And I get:

Exception in thread "AWT-EventQueue-0" java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key ASMTGUI.ErrorMsg
FileDoesnotExists
at java.util.ResourceBundle.getObject(ResourceBundle.java:384)
at java.util.ResourceBundle.getString(ResourceBundle.java:344)
at sun.iasmt.util.ASMTResourceBundle.getValue(Unknown Source)
at sun.iasmt.util.ASMTResourceBundle.getValue(Unknown Source)
at sun.iasmt.user.gui.GuiMain.validateSrcInputArgs(Unknown Source)
at sun.iasmt.user.gui.GuiMain.actionPerformed(Unknown Source)
at sun.iasmt.user.gui.ActionPanel.processActionEvent(Unknown Source)
at sun.iasmt.user.gui.ActionPanel$4.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.Component.processMouseEvent(Component.java:6041)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5806)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

So, I review the documents, I review my own setup, configurations, and spend many hours trying to see if there is something I didn't setup correctly. I keep thinking the "FileNotFound" error is important but can't seem to figure out what it is looking for that's not there. Finally, after way too many hours of futility, I search out postings within forums (google is my friend), with variations and permutations of a search phrase: "Sun Java Migration Tool" - searching for some answers. I find three forums that have had either questions or some traffic with some relevence to what I'm looking for: Java.net J2EE forum, Sun Developer J2EE forum, and Java Ranch J2EE forum. I posted my own question after not finding anything specific to my problem to all three forums, hoping I'll get some insight or some idea of where I need to look to dig into the problem. Only on Java.net, did I get some help.

I got two responses that eventually led me to thinking I should revise my environment installation (I had originally thrown everything into a general Windows "Program Files" parent folder I called "Java") to remove any possibility of strangeness due to the archaic & pesky {SPACE} issue and long filename problems of old (yeah, I been around fer a spell and recall the old days). So, after some finagling and finally doing a complete uninstall of everything (I hope) and even digging through the registry to remove all instances and references to "C:\Program Files\Java" - replacing it with "c:\java" - I reinstall the SDK to c:\java; update three environment variables within windows
{within a CMD window:
?> set ASMT_HOME=c:\java\sdk\asmt
?> set J2EE_HOME=c:\java\sdk
?> set JAVA_HOME=c:\java\sdk\jdk
}

While in the CMD window, I checked to make sure I could start the App Server:
  ?> asadmin start-domain <= and it worked fine.

Rerunning the Sun migration tool gave me the same thing as before. So, I at least know the {space} issue is not the issue. I carefully read the forum responses again and follow a couple of links provided by a person who has a Sun blog address (perhaps he is actually a Sun engineer as his blog says) and goes by the handle "sekhar" (here is his blog). Sekhar has posted a number of blogs on a set of sample applications he is working on migrating from numerous application servers to Glassfish. After a couple of forum messages back and forth, Sekhar suggested I was using the wrong migration tool - that the Application Server I'm working with *IS* glassfish (I was confused by this) and that I need to get the latest "Glassfish Migration Tool" overwriting the "Application Server Migration Tool (ASMT)" I've been working with. This time, I decided to go ahead and set up a copy of an EAR file and it's associated files as a source and using the GUI tool as I have been doing (with the Sun Migration Tool)...

And the result:
Exception in thread "Thread-4" java.lang.NoSuchMethodError: javax.xml.bind.annotation.XmlAccessorType.value()Ljavax/xml/bind/annotation/AccessType;
at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getAccessType(ClassInfoImpl.java:244)
at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getProperties(ClassInfoImpl.java:195)
at com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.getProperties(RuntimeClassInfoImpl.java:79)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:112)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:45)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:37)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:141)
at com.sun.xml.bind.v2.model.impl.RegistryInfoImpl.(RegistryInfoImpl.java:50)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.addRegistry(ModelBuilder.java:183)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:152)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:306)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:179)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:70)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:50)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:133)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:286)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:244)
at sun.iasmt.util.ASMTJaxbContext.(Unknown Source)
at sun.iasmt.convertors.common.xmlconvertor.EjbJarReader.read(Unknown Source)
at sun.iasmt.control.SJSMTXmlFileHandler.readXMLFile(Unknown Source)
at sun.iasmt.control.ASMTController.startupEngineAndConvert(Unknown Source)
at sun.iasmt.control.ASMTController.startupEngineAndConvert(Unknown Source)
at sun.iasmt.user.cmd.CommandCallController.(Unknown Source)
at sun.iasmt.user.gui.MigrationInitiator.run(Unknown Source)


*SIGH*

...more to come...