This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 219799 - Glassfish fails to start
Summary: Glassfish fails to start
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P1 normal with 1 vote (vote)
Assignee: TomasKraus
URL:
Keywords:
: 219816 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-10-10 08:44 UTC by tim_sa
Modified: 2012-10-15 14:30 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tim_sa 2012-10-10 08:44:47 UTC
[ BUILD # : 201210100002 ]
[ JDK VERSION : <1.7.6 ]

I'm gettting the following error in the GlassFish tab when I try to launch my
web or EAR applications

Error: Could not find or load main class Files\Java\jdk1.7.0_05

The following stacktrace was found in the IDE Log:
org.netbeans.modules.j2ee.deployment.impl.ServerException: Could not connect to
admin listener for GlassFish Server 3.1.1.
Verify that NetBeans can make outbound connections to localhost:4848
	at
org.netbeans.modules.j2ee.deployment.impl.ServerInstance._start(ServerInstance.j
ava:1453)
	at
org.netbeans.modules.j2ee.deployment.impl.ServerInstance.startTarget(ServerInsta
nce.java:1400)
	at
org.netbeans.modules.j2ee.deployment.impl.ServerInstance.startTarget(ServerInsta
nce.java:1205)
	at
org.netbeans.modules.j2ee.deployment.impl.ServerInstance.start(ServerInstance.ja
va:1083)
	at
org.netbeans.modules.j2ee.deployment.impl.TargetServer.startTargets(TargetServer
.java:548)
[catch] at
org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment
.java:186)
	at
org.netbeans.modules.maven.j2ee.ExecutionChecker.performDeploy(ExecutionChecker.
java:178)
	at
org.netbeans.modules.maven.j2ee.ExecutionChecker.executionResult(ExecutionChecke
r.java:130)
	at
org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLine
Executor.java:212)
	at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)


When I open the same projects with my NetBeans 7.2 installation the projects
run correctly.
I've also tried this with build 201210090002
Comment 1 TomasKraus 2012-10-10 09:50:44 UTC
This is just another bug that I can't reproduce in my development environment. :(
Comment 2 tim_sa 2012-10-10 11:28:58 UTC
I can reproduce it - Is there any data that I can send you to help pin down the issue?
Comment 3 Jiri Skrivanek 2012-10-10 14:19:35 UTC
Reproduced on windows:

- install java to default location (e.g. C:\Program Files\Java\jdk1.7.0_10)
- install NetBeans using installer to default location and during installation select previously installed JDK
- run IDE and try to start GlassFish
Error: Could not find or load main class Files\Java\jdk1.7.0_10

Product Version: NetBeans IDE Dev (Build 201210100002)
Java: 1.7.0_10-ea; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
Comment 4 Jiri Skrivanek 2012-10-10 14:19:48 UTC
*** Bug 219816 has been marked as a duplicate of this bug. ***
Comment 5 TomasKraus 2012-10-10 14:24:02 UTC
GlassFish is being started in org.netbeans.modules.glassfish.common.StartTask.startDASAndClusterOrInstance(...) method. Because StartTask constructor is always called with null value of jdkRoot   
argument, in
            if (null == jdkHome) {
                jdkHome = getJavaPlatformRoot(support);
            }
getJavaPlatformRoot() is always executed.

It's trying to get JDK from GlassfishModule.JAVA_PLATFORM_ATTR first - it's the If there wasn't any JDK in JAVA_PLATFORM_ATTR, it's trying to get JDK from java.home system property.

This code seems to exist in NetBeans for a long time and it should be there also in 7.2

I did some changes in this code to not rely on java.home system property but to retrieve NetBeans default platform using
JavaPlatformManager.getDefault().getDefaultPlatform()
Also added additional checks to make sure that there is java executable in this platform.

Next change is in JAVA_PLATFORM_ATTR. Now there is a verification that passed attribute is executable and is not a directory.

Both getJavaPlatformRoot() and getJdkHome() methods in StartTask now contains extended logging to trace Java platform evaluation and results.

To see what's happening during server startup just add                      
"-J-Dglassfish.level=0 -J-Dorg.glassfish.tools.ide.level=0"
into netbeans_default_options in netbeans.conf

If you still see this issue after this change, please attach NetBeans logs with finest logging settings (above) to this bug.
Comment 6 TomasKraus 2012-10-10 14:24:39 UTC
changeset:   235600:bbc940bb4b79
summary:     #219799 - Java VM home directory detection rewritten. Added
             extended finest logging.
Comment 7 TomasKraus 2012-10-10 14:27:23 UTC
Now I see reproduction scenario from Jiri. Thanks!
Looks lime my patch won't solve this. There is "Windows space in path" problem again.
Comment 8 TomasKraus 2012-10-11 13:26:36 UTC
Java option that was causing this problem is quoted now. It's fixed in glassfish-tooling-sdk-0.3-b011.jar which was already pushed into web-main.
Comment 9 TomasKraus 2012-10-15 14:30:44 UTC
Jiri, please verify this fix. It should be in web-main now.