Issue Details (XML | Word | Printable)

Key: GLASSFISH-14951
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Bobby Bissett
Reporter: sss150302
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
glassfish

Glassfish 2.1.1Patch8 Cluster profile to Glassfish 3.1 Upgrade gives NullPointerException

Created: 02/Dec/10 04:36 AM   Updated: 17/Feb/11 12:10 AM   Resolved: 07/Dec/10 01:11 PM
Component/s: upgrade_tool
Affects Version/s: 3.1_b31
Fix Version/s: 3.1_ms07

Time Tracking:
Not Specified

File Attachments: 1. Text File server-start-domain--upgrade-domain1.log (173 kB) 02/Dec/10 07:58 PM - sss150302
2. Text File server-with-new-upgrade-tool-jar.log (529 kB) 02/Dec/10 09:57 PM - sss150302
3. Java Archive File upgrade-tool.jar (111 kB) 02/Dec/10 09:38 AM - Bobby Bissett

Environment:

Redhat Enterprise Linux Server 5.3 ( Linux 5)


Tags: 3_1-upgrade 3_1-verified QA Upgrade testing
Participants: Bobby Bissett and sss150302


 Description  « Hide

Redhat Enterprise Linux Server 5.3 ( Linux 5)

Steps to reproduce:
1)Install glassfish v2.1.1 Patch8.
2) Start the domain and the database
3)create a node agent, and two instance.
4) Deploy some applications.
5)install 3.1 B31 nightly build ( glassfish-3.1-b31-11_19_2010.zip)
6)cd to glassfish3/glassfish/bin and execute
./asupgrade --source ../../../v211p8/asb1/domains/domain1
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.sun.enterprise.tools.upgrade.common.VersionExtracter.extractVersionFromConfigFile(VersionExtracter.java:100)
at com.sun.enterprise.tools.upgrade.common.SourceAppSrvObj.getVersionEdition(SourceAppSrvObj.java:72)
at com.sun.enterprise.tools.upgrade.common.BaseDomainInfoObj.getVersion(BaseDomainInfoObj.java:112)
at com.sun.enterprise.tools.upgrade.common.CommonInfoModel.isUpgradeSupported(CommonInfoModel.java:109)
at com.sun.enterprise.tools.upgrade.gui.MainFrame.processArguments(MainFrame.java:437)
at com.sun.enterprise.tools.upgrade.gui.MainFrame.nextButtonActionPerformed(MainFrame.java:307)
at com.sun.enterprise.tools.upgrade.gui.MainFrame.access$200(MainFrame.java:77)
at com.sun.enterprise.tools.upgrade.gui.MainFrame$3.actionPerformed(MainFrame.java:181)
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.Component.processMouseEvent(Component.java:6263)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6028)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
[root@ejp-172x-154 bin]# java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)

When this happens asupgrade does nothing.
the domain1 dir is moved to domain1.original, No server.log is generated.



Bobby Bissett added a comment - 02/Dec/10 06:52 AM

Can you tell me where exactly to get v2.1.1 Patch8? Without that, I can't reproduce this.

I'm going to remove the 'blocking' tag. To workaround this, just don't use the upgrade tool. Instead, copy the domain1 directory from the v2.1.1 server to the 3.1 server and run "asadmin start-domain --upgrade". That's all the tool really does.


Bobby Bissett added a comment - 02/Dec/10 07:07 AM

Even without reproducing the issue I can see that the error handling code in that class is a mess. It's an NPE factory. I'll add some more checking to it and attach a new upgrade jar file today to the issue. Maybe you could drop it into your existing installation to test then.


Bobby Bissett added a comment - 02/Dec/10 09:38 AM

Can you please try again with the attached upgrade-tool.jar file? It can replace the one in the glassfish lib directory.

I suspect there was some problem determining the version of your source domain from the domain.xml file, but the code in the tool wasn't providing good error messages. Furthermore, it then assumed it could read your domain.xml and that causes an NPE, which was then caught and a whole new NPE was caused by the catch block!

So this attached jar may not allow you to proceed with the upgrade, but it should at least tell us what the underlying problem is.


sss150302 added a comment - 02/Dec/10 07:42 PM

Linux version of the bundle is :
http://milestone.india.sun.com/java/re/glassfish/v2.1.1-sust/promoted/p08/b01/bundles/sges_ee-2_1_1-p08-linux.bin

Meanwhile I will try with upgrade-tool.jar


sss150302 added a comment - 02/Dec/10 07:57 PM

I copied the domain1 dir form v2.1.1 Patch8 installation to glassfishv3.
Domain is not started with "asadmin start-domain --upgrade domain1" command

I could see a major exception for which already some bug is already filed.
Attaching the server.log

[#|2010-12-03T09:16:45.669+0530|WARNING|glassfish3.1|javax.enterprise.system.util.org.glassfish.enterprise.iiop.util|_ThreadID=22;_ThreadName=Thread-1;|No default ThreadPool defined
com.sun.corba.ee.spi.orbutil.threadpool.NoSuchThreadPoolException
at org.glassfish.enterprise.iiop.util.S1ASThreadPoolManager.getThreadPool(S1ASThreadPoolManager.java:246)
at org.glassfish.enterprise.iiop.util.S1ASThreadPoolManager.getDefaultThreadPool(S1ASThreadPoolManager.java:276)
at com.sun.enterprise.connectors.work.CommonWorkManager.<init>(CommonWorkManager.java:108)
at com.sun.enterprise.connectors.work.WorkManagerFactory.createWorkManager(WorkManagerFactory.java:125)
at com.sun.enterprise.connectors.work.WorkManagerFactory.getWorkManagerProxy(WorkManagerFactory.java:196)
at com.sun.enterprise.connectors.ConnectorRuntime.getWorkManagerProxy(ConnectorRuntime.java:1121)
at com.sun.enterprise.connectors.BootstrapContextImpl.initializeWorkManager(BootstrapContextImpl.java:161)
at com.sun.enterprise.connectors.BootstrapContextImpl.<init>(BootstrapContextImpl.java:103)
at com.sun.enterprise.connectors.ActiveOutboundResourceAdapter.init(ActiveOutboundResourceAdapter.java:126)
at com.sun.enterprise.connectors.inbound.ActiveInboundResourceAdapterImpl.init(ActiveInboundResourceAdapterImpl.java:90)
at com.sun.enterprise.connectors.ActiveRAFactory.instantiateActiveResourceAdapter(ActiveRAFactory.java:135)
at com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:106)
at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:210)
at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:344)
at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:352)
at com.sun.enterprise.connectors.jms.system.JmsProviderLifecycle.initializeBroker(JmsProviderLifecycle.java:110)
at com.sun.enterprise.connectors.jms.system.JmsProviderLifecycle.postConstruct(JmsProviderLifecycle.java:93)
at com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:128)
at com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:88)
at com.sun.hk2.component.AbstractWombImpl.get(AbstractWombImpl.java:79)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:64)
at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:136)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:73)
at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:326)
at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:135)
at com.sun.enterprise.v3.server.UpgradeStartup.start(UpgradeStartup.java:171)
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
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 com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)

#]

[#|2010-12-03T09:16:45.670+0530|SEVERE|glassfish3.1|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.work|_ThreadID=22;_ThreadName=Thread-1;|Thread-pool [ default thread-pool of server ] not found|#]

[#|2010-12-03T09:16:45.670+0530|SEVERE|glassfish3.1|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.work|_ThreadID=22;_ThreadName=Thread-1;|An error occurred during instantiation of the work manager for resource-adapter [ jmsra ]
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Thread-pool [ default thread-pool of server ] not found
at com.sun.enterprise.connectors.work.CommonWorkManager.<init>(CommonWorkManager.java:131)
at com.sun.enterprise.connectors.work.WorkManagerFactory.createWorkManager(WorkManagerFactory.java:125)
at com.sun.enterprise.connectors.work.WorkManagerFactory.getWorkManagerProxy(WorkManagerFactory.java:196)
at com.sun.enterprise.connectors.ConnectorRuntime.getWorkManagerProxy(ConnectorRuntime.java:1121)
at com.sun.enterprise.connectors.BootstrapContextImpl.initializeWorkManager(BootstrapContextImpl.java:161)
at com.sun.enterprise.connectors.BootstrapContextImpl.<init>(BootstrapContextImpl.java:103)
at com.sun.enterprise.connectors.ActiveOutboundResourceAdapter.init(ActiveOutboundResourceAdapter.java:126)
at com.sun.enterprise.connectors.inbound.ActiveInboundResourceAdapterImpl.init(ActiveInboundResourceAdapterImpl.java:90)
at com.sun.enterprise.connectors.ActiveRAFactory.instantiateActiveResourceAdapter(ActiveRAFactory.java:135)
at com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:106)
at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:210)
at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:344)
at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:352)
at com.sun.enterprise.connectors.jms.system.JmsProviderLifecycle.initializeBroker(JmsProviderLifecycle.java:110)
at com.sun.enterprise.connectors.jms.system.JmsProviderLifecycle.postConstruct(JmsProviderLifecycle.java:93)
at com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:128)
at com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:88)
at com.sun.hk2.component.AbstractWombImpl.get(AbstractWombImpl.java:79)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:64)
at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:136)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:73)
at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:326)
at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:135)
at com.sun.enterprise.v3.server.UpgradeStartup.start(UpgradeStartup.java:171)
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
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 com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)

#]

sss150302 added a comment - 02/Dec/10 07:58 PM

server.log for the "asadmin start-domain --upgrade domain1"


sss150302 added a comment - 02/Dec/10 09:57 PM

server.log with new upgrade-too.jar and " asadmin start-domain --upgrade domain1"


Bobby Bissett added a comment - 03/Dec/10 06:50 AM

"Domain is not started with "asadmin start-domain --upgrade domain1" command "

That's right. Doing this performs the upgrade and then the server is shut down. Server log looked normal to me, but you haven't tried the new upgrade-tool.jar file I attached.

You need to run asupgrade to run the upgrade tool. Running asadmin manually is a workaround for if the tool has a bug. Again, the tool does NOT perform upgrades – it just collects data from the user and then runs asadmin.


sss150302 added a comment - 03/Dec/10 07:44 AM

I have tried the new upgrade-tool.jar.
I could start the domain after asadmin start-domain --upgrade domain1 normally
All the deployed applications worked fine after domain startup.


Bobby Bissett added a comment - 03/Dec/10 08:23 AM

No you DID NOT try the new upgrade tool jar if you ran "asadmin start-domain --upgrade"

If you don't believe me, delete the jar and run asadmin again.

Here's a recap of what happens:
1) you run asupgrade
2) the asupgrade script runs an upgrade tool inside upgrade-tool.jar
3) the upgrade tool runs "asadmin start-domain --upgrade" to perform the upgrade
4) asadmin exits after the upgrade
5) the upgrade tool says the upgrade is finished
6) you can then start the domain normally with asadmin

If you start with step 3 and run the upgrade manually, you are not using any code in upgrade-tool.jar. I told you how to do the upgrade manually so you wouldn't be blocked by a bug in the tool.


Bobby Bissett added a comment - 07/Dec/10 01:11 PM

I haven't recreated the original failure, but I can see how it would happen if the domain.xml file in the source domain could not be read for some reason. I've committed code in revision 43542 to handle this.

Now, if there's an error like not having the right permissions on domain.xml to parse it, the upgrade log will contain:

Could not create xml document object from file name /Users/bobby/work/gfv2/dev/glassfish/domains/domain1/config/domain.xml due to: java.io.FileNotFoundException: /Users/bobby/work/gfv2/dev/glassfish/domains/domain1/config/domain.xml (Permission denied)

If there is some problem in the xml itself, this will come out in the log:

Could not create xml document object from file name /Users/bobby/work/gfv2/dev/glassfish/domains/domain1/config/domain.xml due to: org.xml.sax.SAXParseException: Content is not allowed in prolog.

Before, any errors like these were being ignored and then an NPE resulted by trying to parse a non-existent xml Document object. Let me know if you're seeing any other troubles.