Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 187793 - Generation of Twitter OAuth service is failing.
Generation of Twitter OAuth service is failing.
Status: VERIFIED FIXED
Product: webservices
Classification: Unclassified
Component: REST
6.x
Macintosh (x86) Mac OS X
: P1 (vote)
: 6.x
Assigned To: Milan Kuchtiak
issues@webservices
69patch1-verified
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-18 14:43 UTC by JimClarke
Modified: 2011-11-16 16:41 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JimClarke 2010-06-18 14:43:48 UTC
When generating a Twitter OAuth service, an empty Class is all that is generated.
We have also duplicated this on Windows XP.

The following exception is in the Netbeans Log.

===================
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.modules.websvc.rest.client.JerseyClientWizardIterator$1
java.lang.ClassCastException: com.sun.tools.javac.tree.JCTree$JCFieldAccess cannot be cast to com.sun.source.tree.IdentifierTree
        at org.netbeans.modules.websvc.rest.client.ClientJavaSourceHelper.generateClassArtifacts(ClientJavaSourceHelper.java:526)
        at org.netbeans.modules.websvc.rest.client.ClientJavaSourceHelper.modifyJerseyClientClass(ClientJavaSourceHelper.java:306)
        at org.netbeans.modules.websvc.rest.client.ClientJavaSourceHelper.access$000(ClientJavaSourceHelper.java:120)
        at org.netbeans.modules.websvc.rest.client.ClientJavaSourceHelper$1.run(ClientJavaSourceHelper.java:282)
        at org.netbeans.modules.websvc.rest.client.ClientJavaSourceHelper$1.run(ClientJavaSourceHelper.java:273)
        at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:665)
        at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:154)
        at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:138)
        at org.netbeans.modules.parsing.impl.TaskProcessor$1.call(TaskProcessor.java:200)
        at org.netbeans.modules.parsing.impl.TaskProcessor$1.call(TaskProcessor.java:197)
        at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:160)
        at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:227)
        at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:66)
        at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:197)
        at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:106)
        at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:681)
        at org.netbeans.modules.websvc.rest.client.ClientJavaSourceHelper.addJerseyClient(ClientJavaSourceHelper.java:273)
        at org.netbeans.modules.websvc.rest.client.ClientJavaSourceHelper.generateJerseyClient(ClientJavaSourceHelper.java:229)
[catch] at org.netbeans.modules.websvc.rest.client.JerseyClientWizardIterator$1.run(JerseyClientWizardIterator.java:123)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1957)
=================
Comment 1 Milan Kuchtiak 2010-06-21 09:02:54 UTC
Casting packageName (ExpressionTree) to IdentifierTree fails on Mac/Windows probably.

The following usage is incorrect:
String packageName = ((IdentifierTree)workingCopy.getCompilationUnit().getPackageName()).getName().toString();

Consulting the proper fix with Java Source team.

The workaround (for now) is to create OAuth client in Java EE 6 web project, or in J2SE project (any project without deployment descriptor).
Comment 2 Milan Kuchtiak 2010-06-21 09:17:09 UTC
I got it. 

The problem occurs when the package name consists of more entries, e.g.
package name = org.netbeans.twitter

The workaround for now is to use simple package name, e.g. "twitter".

Stupid bug. Thank You.
Comment 3 Milan Kuchtiak 2010-06-21 09:55:23 UTC
Fixed:
http://hg.netbeans.org/web-main/rev/8cc23415b1d1
Comment 4 rbalada 2010-06-21 16:01:19 UTC
Please verify bugfix for this bug, so it can be integrated into release691 repository.

Thanks,
-R
Comment 5 JimClarke 2010-06-21 17:35:30 UTC
Release 6.9 works when only one word is used in the package name as in "twitter".
Comment 6 Quality Engineering 2010-06-22 03:19:30 UTC
Integrated into 'main-golden', will be available in build *201006220001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/8cc23415b1d1
User: mkuchtiak@netbeans.org
Log: #187793: fixed invalid way of package name computation
Comment 7 rbalada 2010-06-22 07:34:27 UTC
main #8cc23415b1d1 transplanted to release691 #0a3a8d168528
Comment 8 Jan Horvath 2010-07-08 09:52:38 UTC
verified in NetBeans IDE 6.9.1 Dev (Build 201007072301)


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo