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 .....

No comments: