Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 98603 - netbeans crashs if creating a new java class
Summary: netbeans crashs if creating a new java class
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2005-07-10 15:20 UTC by Thomas, Berlinghoff
Modified: 2005-07-20 12:36 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas, Berlinghoff 2005-07-10 15:20:38 UTC
Netbeans-3.X works great for me so I decided to upgrade to 4.0-r1 (available
through portage). The program shows error messages in the lower left corner when
starting ("java.lang.NullPointerException" and "Metamodel XMI malformed"). If
creating a new project and after that creating a new java-class, the program
shows in the lower left corner "java.lang.NullPointerException" and locks up.
I've also tried version 4.1 (Got ebuild from "bugs.gentoo.org") but there's
still a problem. There's no error message in the lower left corner, but when
creating a new project, a window pops up (showing "scanning source  for
classpaths" (or similiar))  which closes imediately and pops up again .. and so
on. I've tried using different java-vm but it makes no different.
First I thought about any package making problems, but in the end I've tried
using the version which comes with sun-jdk-1.5 (available  here
"http://java.sun.com/j2se/1.5.0/download.jsp") and it works without problems. So
perhaps there's any dependency missing (or to old) in the ebuild ?

Mfg

Sino

Reproducible: Always
Steps to Reproduce:
1.emerge =dev-util/netbeans-4.0-r1 (or 4.1)
2.Start netbeans
3a.Create a new project ("java application") and select "create Main class" in
the wizard

or

3b. Deselect "create Main class" in the wizard and create a java class at a
later time


Actual Results:  
netbeans-4.0-r1:
The program locks up (Doesn't react on user inputs and must be killed)

netbeans-4.1:
Same as above (If selecting "create Main class" in the projects wizard)
or
A after creating the project, a window pops up, ide, pops up, ... (If DE-select
"create Main class" in the projects wizard).

Expected Results:  
- Creae a new project and a java file
Comment 1 Petteri Räty (RETIRED) gentoo-dev 2005-07-10 15:29:59 UTC
Could you please run netbeans-4.0 from command line and post if it outputs
something. I can reproduce this with 4.1 but not with 4.0.
Comment 2 Thomas, Berlinghoff 2005-07-10 15:55:38 UTC
(In reply to comment #1)
> Could you please run netbeans-4.0 from command line and post if it outputs
> something. I can reproduce this with 4.1 but not with 4.0.

Sorry, but there's no output :(

Mfg

Sino
Comment 3 Thomas, Berlinghoff 2005-07-11 07:07:42 UTC
Ok, I've currently downloaded the sources (Same as emerge does) and compiled it
by myself. I mostly do the same as the ebuild does, except the following:

209: unset DISPLAY
215: export ANT_OPTS="${ANT_OPTS} -Xmx1g -Djava.awt.headless=true"

sun-jdk-1.4.2_08 ismy system wide JVM.

After the compilation was done, netbeans works fine for me. Perhaps the exported
ANT_OPTS makes trouble ?
Anyway, I am currently on my laptop (Had the problem mentioned above on two
machines (my laptop and my normal computer)) but I'll apply the changes to the
ebuild and try it again on my normal computer.
Hope that helps.
Comment 4 Petteri Räty (RETIRED) gentoo-dev 2005-07-11 09:56:34 UTC
(In reply to comment #3)
> 
> After the compilation was done, netbeans works fine for me. Perhaps the exported
> ANT_OPTS makes trouble ?

The environment is reset after the ebuild is done. So ANT_OPTS is not left to
the environment. You can check this by running env | grep ANT_OPTS. Could you
please try my improved ebuild in the experimental tree:
https://gentooexperimental.org/svn/java/gentoo-java-experimental/dev-util/netbeans
It has fixes to other issues. At least with this version I am unable to
reproduce your problem. I will be testing with the 4.1 ebuild to find out more.
Comment 5 Thomas, Berlinghoff 2005-07-11 10:49:52 UTC
I've currently tried both ebuilds contained on your page, unfortunatelly none of
them works.

1. Start netbeans (4.0 shows Error messages in the lower left corner, 4.1 doesn't)
2. When creating a java class, the program locks up and must be killed (4.0 as
well as 4.1)

Mfg

Sino
Comment 6 Thomas, Berlinghoff 2005-07-11 12:08:29 UTC
Well, got netbeans-4.1 working when comment out some function calls in the ebuild

156 fool_scrambler
202 symlink_extjars ${D}/${DESTINATION}
245 make_desktop_entry netbeans-${SLOT} Netbeans netbeans Development

So 4.1 works well for me now. Haven't had time to take a closer look on the
called functions (So I didn't really now what they are good for), but I'll do it
if I got some spare time.

[url]http://sinotech.dyndns.org/netbeans-4.1.ebuild[/url]

Mfg

Sino
Comment 7 Thomas, Berlinghoff 2005-07-11 15:00:10 UTC
Ok, here are my next results. I've activated the following lines again

245 make_desktop_entry netbeans-${SLOT} Netbeans netbeans Development

and it still works. After that I reactivated the following line:

202 symlink_extjars ${D}/${DESTINATION}

and the program locks (And must be killed) when creating a new project. Then
I've deactivated it again, and tried to activate some part of the
"fool_scrambler" function. After that, when creating a project, a window
appears, disappears, appears again and so on. So there must be a problem in
"symlink_extjars" as well as in the first part of "fool_scrambler". Here's the
build I've tried:

http://sinotech.dyndns.org/netbeans-4.1.ebuild

I've put the line "# HERE HERE HERE HERE" into "fool_scrambler". Things above
the line caused the problem I described above, the things aren't tested yet
(Will do that tomorrow).

Anyway, since I've got no ebuild for tomcat-5.5, I've changed the dependency to
"tomcat-5.0.28". But since I've just tried to create a simple "Java
apllication"-project, it shouldn't matter, should it ?

Mfg

Sino
Comment 8 Thomas, Berlinghoff 2005-07-11 15:02:52 UTC
HAVE CHANGED:
the things aren't tested yet (Will do that tomorrow).
TO:
the things below aren't tested yet (Will do that tomorrow).




Ok, here are my next results. I've activated the following lines again

245 make_desktop_entry netbeans-${SLOT} Netbeans netbeans Development

and it still works. After that I reactivated the following line:

202 symlink_extjars ${D}/${DESTINATION}

and the program locks (And must be killed) when creating a new project. Then
I've deactivated it again, and tried to activate some part of the
"fool_scrambler" function. After that, when creating a project, a window
appears, disappears, appears again and so on. So there must be a problem in
"symlink_extjars" as well as in the first part of "fool_scrambler". Here's the
build I've tried:

http://sinotech.dyndns.org/netbeans-4.1.ebuild

I've put the line "# HERE HERE HERE HERE" into "fool_scrambler". Things above
the line caused the problem I described above, the things below aren't tested
yet (Will do that tomorrow).

Anyway, since I've got no ebuild for tomcat-5.5, I've changed the dependency to
"tomcat-5.0.28". But since I've just tried to create a simple "Java
apllication"-project, it shouldn't matter, should it ?

Mfg

Sino
Comment 9 Petteri Räty (RETIRED) gentoo-dev 2005-07-11 15:11:56 UTC
See the following link to check out the whole experimental tree. 
http://gentoo-wiki.com/Experimental_Java_tree
It seems that there are problems with the linking to the system jars. I have
already fixed some issues with 4.1 and will continue tomorrow. I will post here
after I have committed my stuff to the experimental tree. 
Comment 10 Thomas, Berlinghoff 2005-07-12 04:42:24 UTC
OK, I've already downloaded that experimental tree and installed the
"tomcat-5.5" package. I've also done some little testings (Try and error ;) )
with my current netbeans-4.1 ebuild. Therefore I figured out two little parts
which will cause the problems:


In function "fool_scrambler()" the following lines:
283 cd ${S}/mdr/external/
284 unscramble_and_empty 
285 java-pkg_jar-from ${JMI}
286 java-pkg_jar-from ${MOF}


and in function "symlink_extjars()" the following lines
cd ${1}/ide${IDE_VERSION}/modules/ext
366 java-pkg_jar-from ${COMMONS_LOGGING}
367 java-pkg_jar-from flute
368 java-pkg_jar-from ${JMI}
369 java-pkg_jar-from ${JUNIT}
370 java-pkg_jar-from ${MOF}
371 java-pkg_jar-from sac


One of them causes the program locks up when creating a new project, the other
one caused a little window to appear, disappear, ... (Like described above).

I've also put the ebuild file again on my little webserver:
file:///usr/local/portage_over/dev-util/netbeans/netbeans-4.1.ebuild

Mfg

Sino
Comment 11 Thomas, Berlinghoff 2005-07-12 04:44:52 UTC
Here the right URL:
http://sinotech.dyndns.org/netbeans-4.1.ebuild

(Lines I've deactivated, are enclose by "# BUG BUG BUG BUG"
Comment 12 Thomas, Berlinghoff 2005-07-12 05:28:05 UTC
Ok, think the problem is caused by ${JMI} and ${MOF} variables. I've deactived
the lines where they're used, and then netbeans-4.1 run fine. So these are the
lines I've deactivated:

function fool_scrambler:
285 java-pkg_jar-from ${JMI}
286 java-pkg_jar-from ${MOF}

function symlink_extjars:
370 java-pkg_jar-from ${JMI}
372 java-pkg_jar-from ${MOF}

Updated ebuild can be found here:
http://sinotech.dyndns.org/netbeans-4.1.ebuild

Mfg

Sino


Comment 13 Thomas, Berlinghoff 2005-07-12 09:00:11 UTC
I've tried re-merging "dev-java/jmi-interface" ("jmi.jar" and "mof.jar" are part
of this package) but it doesn't change anything.
Anyway, just seen that netbeans-4.1 shows up error messages (I said it doesn't 
a few posts above). Haven't seen it since it wasn't in the lower left corner as
in version 4.0 (Now it's a little red icon in the lower right corner). It also
says that there's a log file in "~/.netbeans/4.1/var/log". If you need to see
it, it is here:

http://sinotech.dyndns.org/messages.log

Mfg

Sino
Comment 14 Petteri Räty (RETIRED) gentoo-dev 2005-07-14 13:08:55 UTC
Found the reason. mof.jar in jmi-interface doesn't include mof.xml which is
included in the Netbeans version of mof.jar. Updates for Netbeans and
jmi-interface are coming soon. 
Comment 15 Petteri Räty (RETIRED) gentoo-dev 2005-07-14 13:59:47 UTC
Ok. The ebuilds in the experimental should now be fixed. We will be looking at
moving them to the main tree tomorrow. 
Comment 16 Thomas, Berlinghoff 2005-07-16 01:06:43 UTC
(In reply to comment #15)
> Ok. The ebuilds in the experimental should now be fixed. We will be looking at
> moving them to the main tree tomorrow. 

Nice to hear. I'll wait for that.

Mfg

Sino
Comment 17 Petteri Räty (RETIRED) gentoo-dev 2005-07-20 02:48:59 UTC
4.0-r2 is now in the tree. Please, update all the dependencies and test. Reopen
if the problem still exists.
Comment 18 James McCarthy 2005-07-20 12:36:46 UTC
Excellent job all around!  Had this bug until I updated to 4.0-r2.  Now
everything works perfectly.  Just follow the tutorial for converting from 3.6 to
4.0 to create projects and there are no problems.  I'm even able to define
external JAR files that are necessary and use them properly.