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 187793 - Generation of Twitter OAuth service is failing.
Summary: Generation of Twitter OAuth service is failing.
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: REST (show other bugs)
Version: 6.x
Hardware: Macintosh (x86) Mac OS X
: P1 normal (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
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
Exception Reporter:


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)