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 131327 - [saas][google] adsenseforsearch generates uncompilable code
Summary: [saas][google] adsenseforsearch generates uncompilable code
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: Manager (show other bugs)
Version: 6.x
Hardware: All Windows Vista
: P2 blocker (vote)
Assignee: Ayub Khan
URL:
Keywords:
: 131498 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-27 19:11 UTC by Lukas Jungmann
Modified: 2008-03-30 21:04 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
wsdl exception (6.87 KB, text/plain)
2008-03-27 23:06 UTC, Ayub Khan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Jungmann 2008-03-27 19:11:30 UTC
-drop adsenseforsearch into a RESTful ws
-build a project

=>
...
Compiling 7 source files to C:\NetBeansProjects\HelloWorld\HelloWorld\build\web\WEB-INF\classes
C:\NetBeansProjects\HelloWorld\HelloWorld\src\java\helloworld\HelloWorldResource.java:135: cannot find symbol

symbol  : variable siteProperties
location: class helloworld.HelloWorldResource
   java.lang.String result = port.generateSearchBoxCode(synServiceId, country, searchType, siteProperties,
searchOptions, domains, selectedDomain, searchBoxStyle, channelName);
C:\NetBeansProjects\HelloWorld\HelloWorld\src\java\helloworld\HelloWorldResource.java:135: cannot find symbol

symbol  : variable searchOptions
location: class helloworld.HelloWorldResource
   java.lang.String result = port.generateSearchBoxCode(synServiceId, country, searchType, siteProperties,
searchOptions, domains, selectedDomain, searchBoxStyle, channelName);
C:\NetBeansProjects\HelloWorld\HelloWorld\src\java\helloworld\HelloWorldResource.java:135: cannot find symbol

symbol  : variable domains
location: class helloworld.HelloWorldResource
   java.lang.String result = port.generateSearchBoxCode(synServiceId, country, searchType, siteProperties,
searchOptions, domains, selectedDomain, searchBoxStyle, channelName);
C:\NetBeansProjects\HelloWorld\HelloWorld\src\java\helloworld\HelloWorldResource.java:135: cannot find symbol

symbol  : variable searchBoxStyle
location: class helloworld.HelloWorldResource
   java.lang.String result = port.generateSearchBoxCode(synServiceId, country, searchType, siteProperties,
searchOptions, domains, selectedDomain, searchBoxStyle, channelName);
Note: C:\NetBeansProjects\HelloWorld\HelloWorld\src\java\org\netbeans\saas\RestResponse.java uses unchecked or unsafe
operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
C:\NetBeansProjects\HelloWorld\HelloWorld\nbproject\build-impl.xml:392: The following error occurred while executing
this line:
C:\NetBeansProjects\HelloWorld\HelloWorld\nbproject\build-impl.xml:213: Compile failed; see the compiler error output
for details.
BUILD FAILED (total time: 1 second)
Comment 1 Ayub Khan 2008-03-27 23:06:02 UTC
The issue is that wsdl for "Google Adsense for Search" has changed, there are additional
parameters that do not conform to our code generator. ie we expect the parameter types to be

type.isPrimitive() || 
type.equals(String.class) ||
Util.getValueOfMethod(type) != null || 
Util.getConstructorWithStringParam(type) != null;

but following parameters do not conform to this.

com.google.api.adsense.v2.SiteProperties siteProperties = null;
com.google.api.adsense.v2.SearchOptions searchOptions = null;
java.util.List domains = null;
com.google.api.adsense.v2.SearchBoxStyle searchBoxStyle = null;

If we relax this requirement and add the initialization statement and invoke the jaxws method there will be 
other exception (see attachment)
Comment 2 Ayub Khan 2008-03-27 23:06:38 UTC
Created attachment 59257 [details]
wsdl exception
Comment 3 Ayub Khan 2008-03-27 23:18:17 UTC
Assigning to Rico, since this is JaxWS specific.
Comment 4 Roderico Cruz 2008-03-28 09:09:56 UTC
I tried generating JAXWS artifacts based on the wsdl. Service and client generation works fine, so I am convinced this
has nothing to do with JAXWS. 
From the stack trace, it looks like an attempt to instantiate WsdlService using Class.newInstace() fails because
WsdlService does not have a no-arg constructor. WsdlService is a member of the WebServiceDescriptor of the web service
manager module. When the encoder.writeObject() is called on the descriptor, the exception is thrown because of this.
Comment 5 Nam Nguyen 2008-03-28 16:17:51 UTC
True, the exception stack has nothing to do with jaxws generation.  Its internal saving of webservice manager
descriptor.  The exception has been handled properly should not be causing any problem.

About the parameters siteProperties, searchOptions, domains... they are existings parameters.  Only that they should not
be part of query param list because of restriction in Jersey.  So the issue should be fixed by uncheck and disable their
query parem checkbox in the parameters dialog.  I guess this is a regression from the same functionality provided by old
REST plugin.
Comment 6 Nam Nguyen 2008-03-28 16:50:24 UTC
The stack is useful, now that i can see a possible fix for the exception (not related to this bug, though).
Ayub/Peter, please try remove the method getModel() from WsdlServiceProxyDescriptor in websvc.saas.api.  I believe it is
not used.  We might alse need to refactor rename setModel to setWsdlService.
Comment 7 Ayub Khan 2008-03-29 02:51:12 UTC
*** Issue 131498 has been marked as a duplicate of this issue. ***
Comment 8 Ayub Khan 2008-03-29 03:23:38 UTC
Fixed for 6.1
Comment 9 Lukas Jungmann 2008-03-30 21:04:42 UTC
v.