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

No comments: