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 199780 - Project won't compile when using com.sun.xml.internal.ws.server.UnsupportedMediaException + auto generated WebServiceReferences (Compile error:"package com.sun.xml.internal.ws.server does not exist")
Summary: Project won't compile when using com.sun.xml.internal.ws.server.UnsupportedMe...
Status: RESOLVED INVALID
Alias: None
Product: webservices
Classification: Unclassified
Component: JAX-WS (show other bugs)
Version: 7.0
Hardware: All All
: P2 normal with 1 vote (vote)
Assignee: Denis Anisimov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-30 12:36 UTC by s4ncho
Modified: 2013-10-20 01:29 UTC (History)
1 user (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 s4ncho 2011-06-30 12:36:12 UTC
Product Version = NetBeans IDE 7.0 (Build 201104080000)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.6.0_23
Runtime = Java HotSpot(TM) 64-Bit Server VM 19.0-b09

Compile error: "package com.sun.xml.internal.ws.server does not exist" 
(it's a package from JDK1.6 rt.jar, and it exist there)

[code]package x;
import com.sun.xml.internal.ws.server.UnsupportedMediaException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class X {
    public static void main(String[] args) {
        new X().test();
    }

    void test() {
        try {
            throw new UnsupportedMediaException();
        } catch (Exception ex) {
            Logger.getLogger(X.class.getName()).log(Level.SEVERE, null, ex);
//            System.out.println("http://www.webservicex.net/genericbarcode.asmx?WSDL");
        }
    }
}[/code]

Program works fine without adding "Web services references" 

Steps to reproduce: 
1.paste upper source code to NetBeans, 
2. run project - should compile without any problems
3.next choose menu "File"-> "new file"-> "Web Services" -> "web service client" -> choose "WSDL URL" paste e.g. "http://www.webservicex.net/genericbarcode.asmx?WSDL", choose package and click Finnish 
[this step requires some addiditional plugins installed i'm not sure if it was "SOAP web services" - i've Version: 1.10.1 Source: NetBeans IDE 7.0 (Build 201104080000) ]
3. afert 2nd step it's imposible to compile project. i get a error like below:

OUTPUT:
(...)[quote]wsimport-init:
wsimport-client-genericbarcode:
files are up to date
wsimport-client-generate:
Compiling 13 source files to C:\Users\marcin\Documents\NetBeansProjects\x\build\classes
C:\Users\marcin\Documents\NetBeansProjects\x\src\x\X.java:2: package com.sun.xml.internal.ws.server does not exist
import com.sun.xml.internal.ws.server.UnsupportedMediaException;
C:\Users\marcin\Documents\NetBeansProjects\x\src\x\X.java:13: cannot find symbol
symbol  : class UnsupportedMediaException
location: class x.X
            throw new UnsupportedMediaException();
2 errors
C:\Users\marcin\Documents\NetBeansProjects\x\nbproject\build-impl.xml:604: The following error occurred while executing this line:
C:\Users\marcin\Documents\NetBeansProjects\x\nbproject\build-impl.xml:246: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 1 second)[/quote]

there's the same error when using import for com.sun.xml.internal.ws.client.ClientTransportException class with auto generated WS-classes.
The same thing on Netbeans 6.9.1 on windows and Netbeans 7.0 on linux (jdk 1.6.0_26).

Please help because can't go any futher without that.
Regards 
Marcin
Comment 1 Petr Jiricka 2011-06-30 13:57:33 UTC
In your steps to reproduce, you did not say what kind of project this is. Can you please elaborate?
Comment 2 s4ncho 2011-06-30 14:14:16 UTC
I'm building a GUI project with Web services (SOAP).

But I've attached simplified code which is a console project (using web services) just to clarify the problem. The bug is exactly the same.

Thank you in advance for your help
Marcin
Comment 3 Denis Anisimov 2011-07-22 06:13:30 UTC
(In reply to comment #0)
> Product Version = NetBeans IDE 7.0 (Build 201104080000)
> Operating System = Windows 7 version 6.1 running on amd64
> Java; VM; Vendor = 1.6.0_23
> Runtime = Java HotSpot(TM) 64-Bit Server VM 19.0-b09
> 
> Compile error: "package com.sun.xml.internal.ws.server does not exist" 
> (it's a package from JDK1.6 rt.jar, and it exist there)
> 
> [code]package x;
> import com.sun.xml.internal.ws.server.UnsupportedMediaException;
> import java.util.logging.Level;
> import java.util.logging.Logger;
> 
> public class X {
>     public static void main(String[] args) {
>         new X().test();
>     }
> 
>     void test() {
>         try {
>             throw new UnsupportedMediaException();
>         } catch (Exception ex) {
>             Logger.getLogger(X.class.getName()).log(Level.SEVERE, null, ex);
> //           
> System.out.println("http://www.webservicex.net/genericbarcode.asmx?WSDL");
>         }
>     }
> }[/code]
> 
> Program works fine without adding "Web services references" 
> 

No, it doesn't .
This class file cannot be compiled neither inside NB nor via command line javac ( if it is SUN JDK ).
See f.e. http://andrew-haley.livejournal.com/
This is common problem and has no any relation to webservices functionality and overall NB.
Comment 4 s4ncho 2011-08-22 08:21:06 UTC
Strange thing. but with compiler option "-XDignore.symbol.file=true" program compiles. thanks for that link.
Comment 5 JEick 2011-12-23 19:04:23 UTC
Is there anyway to get this fixed upstream? If so where would the issue need to be raised?
Comment 6 Denis Anisimov 2011-12-26 07:13:40 UTC
(In reply to comment #5)
> Is there anyway to get this fixed upstream? If so where would the issue need to
> be raised?

There is nothing to fix. It is not a bug.
This behavior comes from JDK.
Please ask JDK product team why javac behaves in that way.
It will be never fixed straightforward in NB because there are 
reasons for such behavior .
The only thing that could  be done is some RFE to add java compiler 
option in the project's customizer respectively ignore.symbol.file attribute.
( I don't know details of project option and probably it is already there ).
But this is very minor issue because you are still able to add this compiler
option in the customizer manually.
Anyway this is  not a WS area issue at all.
Please address all questions to project infrastructure.
Comment 7 drchase 2013-09-17 20:53:58 UTC
The livejournal link above is now dead.  I would appreciate it if the information that used to be there could be included inline, since I am trying to figure out how to configure NetBeans to do this same thing, if that is possible.

I have tried setting "Additional Compiler Options" in Project Properties . Build . Compiling to "-XDignore.symbol.file=true" and it now builds okay, but the editor persists in claiming that the package jdk.internal.org.objectweb.asm does not exist.
Comment 8 drchase 2013-10-20 01:29:20 UTC
See: https://wiki.openjdk.java.net/display/OpenJFX/Developing+OpenJFX

In particular, modify netbeans.conf to allow access to internal symbols from within the editor: 
  Change netbeans_default_options to remove "-J-ea" and 
  add "-J-da -J-DCachingArchiveProvider.disableCtSym=true".