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 229946 - expanding Services > Web Services node throws exception
Summary: expanding Services > Web Services node throws exception
Status: RESOLVED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.4
Hardware: All All
: P2 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on: 229426
Blocks:
  Show dependency tree
 
Reported: 2013-05-18 16:56 UTC by Maksim Khramov
Modified: 2013-06-14 06:44 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 200728


Attachments
stacktrace (1.65 KB, text/plain)
2013-05-18 16:56 UTC, Maksim Khramov
Details
stacktrace (1.65 KB, text/plain)
2013-05-26 07:07 UTC, pwade
Details
stacktrace (1.65 KB, text/plain)
2013-05-29 03:10 UTC, David Konecny
Details
stacktrace (1.63 KB, text/plain)
2013-06-06 08:01 UTC, Marian Mirilovic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maksim Khramov 2013-05-18 16:56:18 UTC
Build: NetBeans IDE Dev (Build 201305152300)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.21-b01, Java(TM) SE Runtime Environment, 1.7.0_21-b11
OS: Windows 7

User Comments:
GUEST: Clic on Services > Webservices

mkhramov: Expand some nodes in Services panel




Stacktrace: 
java.lang.NullPointerException
   at javax.xml.bind.ContextFinder.handleClassCastException(ContextFinder.java:129)
   at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:201)
   at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:146)
   at javax.xml.bind.ContextFinder.find(ContextFinder.java:361)
   at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:446)
   at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:409)
Comment 1 Maksim Khramov 2013-05-18 16:56:19 UTC
Created attachment 134592 [details]
stacktrace
Comment 2 Exceptions Reporter 2013-05-24 00:08:15 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=200728
Comment 3 pwade 2013-05-26 07:07:14 UTC
Created attachment 134904 [details]
stacktrace

Trying to load the web project this build borked.
Comment 4 David Konecny 2013-05-29 03:10:19 UTC
Created attachment 135038 [details]
stacktrace

start Java REST Client wizard and open IDE Web Services browser
Comment 5 David Konecny 2013-05-30 01:41:49 UTC
I tracked down the cause of this issue and it caused by the fix of issue 229426 - reverting #f22c7660c05f resolves this problem. The problem is that javax.xml.bind.ContextFinder calls around line 330 classLoader.getResourceAsStream("META-INF/services/javax.xml.bind.JAXBContext") which returns incorrectly null because of #f22c7660c05f. That causes ContextFinder to fallback on a default factory and that fails because the default factory comes from JDK's jar while API is from jar bundled with the IDE which results into class cast exception.

The problem is easy to reproduce: start the IDE and expand "Web Services" node in Services panel.

Considering the cause is in the lookup/classloader this is likely P1 as impact might be big.

Separately I filed an issue to evaluate whether we still need JAXB library and impl module: issue 230494 - "is dependency on JAXB 2.2 library still needed?"
Comment 6 Jaroslav Tulach 2013-05-31 08:41:10 UTC
Thanks for the investigation.
Comment 7 Exceptions Reporter 2013-06-04 18:40:28 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=200728
Comment 8 David Konecny 2013-06-05 21:03:53 UTC
This should to be fixed for 7.4 Beta.
Comment 9 Marian Mirilovic 2013-06-06 08:01:28 UTC
Created attachment 135419 [details]
stacktrace

First attempt to open 'Add Web Service' on Web Services node in Services tab
Comment 10 Jaroslav Tulach 2013-06-06 08:51:48 UTC
javax.xml.bind.ContextFinder seems to be hard to debug. Can't find sources to match the code in NetBeans (maybe result of bug 230494?). Anyway it seems that ContextFinder is using getResource call, and not getResources. Issue 229426 seems to only support (incorrectly) getResources.
Comment 11 Jaroslav Tulach 2013-06-06 09:37:12 UTC
ergonomics#3c770e3ddb4d
Comment 12 David Konecny 2013-06-06 20:28:55 UTC
(In reply to comment #10)
> javax.xml.bind.ContextFinder seems to be hard to debug. Can't find sources to
> match the code in NetBeans

Yeah, I had the same problem. By default JDK's sources are available for JAXB API but in runtime NetBeans is using instead JAXB from xml.jaxb.api module which is 2.2.6. I had to download 2.2.6 sources (they easiest way was to download it from Maven cenntral repo) and during debugging in Debugger's Sources view disable JDK sources and add downloaded 2.2.6. Then it worked well. 

> (maybe result of bug 230494?).

Removing JAXB 2.2.6 and relying on JDK's JABX will make this easier.

Thanks for fixing it Jarda. I will test it on next build.
Comment 13 Quality Engineering 2013-06-14 02:00:31 UTC
Integrated into 'main-golden', will be available in build *201306132301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/3c770e3ddb4d
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: Additional fix to #229426 discovered as bug #229946: Use the same logic as in getResources also for getResource
Comment 14 Marian Mirilovic 2013-06-14 06:18:29 UTC
(In reply to comment #13)
> Integrated into 'main-golden', will be available in build *201306132301* on
> http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
> Changeset: http://hg.netbeans.org/main-golden/rev/3c770e3ddb4d
> User: Jaroslav Tulach <jtulach@netbeans.org>
> Log: Additional fix to #229426 discovered as bug #229946: Use the same logic as
> in getResources also for getResource

So it means : this isn't fixed in Beta !!!???
Comment 15 Petr Jiricka 2013-06-14 06:39:15 UTC
Fortunately I think it is, see http://bertram2.netbeans.org:8080/job/web-main/changes. It arrived in the web-main repository yesterday (Thursday) at 1am Prague time, i.e. before the beta branching.
Comment 16 Marian Mirilovic 2013-06-14 06:44:21 UTC
(In reply to comment #15)
> Fortunately I think it is, see
> http://bertram2.netbeans.org:8080/job/web-main/changes. It arrived in the
> web-main repository yesterday (Thursday) at 1am Prague time, i.e. before the
> beta branching.

7 days after actual fix in ergonomics ? :(