No Class Def found and other issues I get with my own plugin in 8.2

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

No Class Def found and other issues I get with my own plugin in 8.2

Volodymyr Babin
Hi,

I am getting the same error for my own plugin as these are: http://statistics.netbeans.org/exceptions/detail.do?id=215797. 33 duplicates. How do I know if it has been fixed?

Here is what I get when doing an autocomplete:
===========
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.spi.editor.completion.support.AsyncCompletionTask
java.lang.NoClassDefFoundError: com/forcenb/editor/vf/completion/VfCompleter
    at com.forcenb.editor.vf.completion.vfCompletionProvider$1.query(VfCompletionProvider.java:51)
    at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:223)
===========

Another issue is that I get strange error:
java.lang.ClassCastException: com.forcenb.project.ForceProject cannot be cast to com.forcenb.project.ForceProject

in a code like this:

                    FileObject file = Utilities.actionsGlobalContext().lookup(FileObject.class);
                    ForceProject project = null;
                    if (file != null) {
                        project = (ForceProject) FileOwnerQuery.getOwner(file);
                    }

Any clue why would this be happening?

Thanks.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No Class Def found and other issues I get with my own plugin in 8.2

Geertjan Wielenga-3


com.forcenb.project.ForceProject comes from the Force.com Netbeans plugin, I guess.

https://success.salesforce.com/ideaView?id=08730000000Br76

Gj


On 3-7-2017 17:14, Volodymyr wrote:
Hi,

I am getting the same error for my own plugin as these are: http://statistics.netbeans.org/exceptions/detail.do?id=215797. 33 duplicates. How do I know if it has been fixed?

Here is what I get when doing an autocomplete:
===========
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.spi.editor.completion.support.AsyncCompletionTask
java.lang.NoClassDefFoundError: com/forcenb/editor/vf/completion/VfCompleter
    at com.forcenb.editor.vf.completion.vfCompletionProvider$1.query(VfCompletionProvider.java:51)
    at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:223)
===========

Another issue is that I get strange error:
java.lang.ClassCastException: com.forcenb.project.ForceProject cannot be cast to com.forcenb.project.ForceProject

in a code like this:

                    FileObject file = Utilities.actionsGlobalContext().lookup(FileObject.class);
                    ForceProject project = null;
                    if (file != null) {
                        project = (ForceProject) FileOwnerQuery.getOwner(file);
                    }

Any clue why would this be happening?

Thanks.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No Class Def found and other issues I get with my own plugin in 8.2

Volodymyr Babin
Yes, Geertjan,

I am developing it, we've spoke about it two years ago).

The issue here is that it is all good when it runs in debug/run mode, this is only happens when I run it as an installed nbm.

Any idea why this would happen?

Regards,
Vova.

--- Оригінальне повідомлення ---
Від кого: "geertjan wielenga" <[hidden email]>
Дата: 3 липня 2017, 18:18:57


com.forcenb.project.ForceProject comes from the Force.com Netbeans plugin, I guess.

https://success.salesforce.com/ideaView?id=08730000000Br76

Gj


On 3-7-2017 17:14, Volodymyr wrote:
Hi,

I am getting the same error for my own plugin as these are: http://statistics.netbeans.org/exceptions/detail.do?id=215797. 33 duplicates. How do I know if it has been fixed?

Here is what I get when doing an autocomplete:
===========
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.spi.editor.completion.support.AsyncCompletionTask
java.lang.NoClassDefFoundError: com/forcenb/editor/vf/completion/VfCompleter
    at com.forcenb.editor.vf.completion.vfCompletionProvider$1.query(VfCompletionProvider.java:51)
    at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:223)
===========

Another issue is that I get strange error:
java.lang.ClassCastException: com.forcenb.project.ForceProject cannot be cast to com.forcenb.project.ForceProject

in a code like this:

                    FileObject file = Utilities.actionsGlobalContext().lookup(FileObject.class);
                    ForceProject project = null;
                    if (file != null) {
                        project = (ForceProject) FileOwnerQuery.getOwner(file);
                    }

Any clue why would this be happening?

Thanks.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No Class Def found and other issues I get with my own plugin in 8.2

Volodymyr Babin
In reply to this post by Volodymyr Babin
  Hi,

Anyone, please help, when install the plugin in NetBeans, I get the strange error below. But when run/debug it from my dev environment, so it starts another NetBeans instance, it works just fine in the instance. Maybe someone ran into such issue, or maybe has at least an idea why it might be happening and what are the possible ways to fix it?

java.lang.ClassCastException: com.forcenb.project.ForceProject cannot be cast to com.forcenb.project.ForceProject

In a code like this:

                    FileObject file = Utilities.actionsGlobalContext().lookup(FileObject.class);
                    ForceProject project = null;
                    if (file != null) {
                        project = (ForceProject) FileOwnerQuery.getOwner(file);
                    }


Any help appreciated.

Thanks.

--- Оригінальне повідомлення ---
Від кого: "Volodymyr" <[hidden email]>
Дата: 3 липня 2017, 18:15:00

Hi,

I am getting the same error for my own plugin as these are: http://statistics.netbeans.org/exceptions/detail.do?id=215797. 33 duplicates. How do I know if it has been fixed?

Here is what I get when doing an autocomplete:
===========
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.spi.editor.completion.support.AsyncCompletionTask
java.lang.NoClassDefFoundError: com/forcenb/editor/vf/completion/VfCompleter
    at com.forcenb.editor.vf.completion.vfCompletionProvider$1.query(VfCompletionProvider.java:51)
    at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:223)
===========

Another issue is that I get strange error:
java.lang.ClassCastException: com.forcenb.project.ForceProject cannot be cast to com.forcenb.project.ForceProject

in a code like this:

                    FileObject file = Utilities.actionsGlobalContext().lookup(FileObject.class);
                    ForceProject project = null;
                    if (file != null) {
                        project = (ForceProject) FileOwnerQuery.getOwner(file);
                    }

Any clue why would this be happening?

Thanks.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No Class Def found and other issues I get with my own plugin in 8.2

Geertjan Wielenga-3


Without a way to reproduce it, no one can help.

Gj


On 4-7-2017 16:54, Volodymyr wrote:
  Hi,

Anyone, please help, when install the plugin in NetBeans, I get the strange error below. But when run/debug it from my dev environment, so it starts another NetBeans instance, it works just fine in the instance. Maybe someone ran into such issue, or maybe has at least an idea why it might be happening and what are the possible ways to fix it?

java.lang.ClassCastException: com.forcenb.project.ForceProject cannot be cast to com.forcenb.project.ForceProject

In a code like this:

                    FileObject file = Utilities.actionsGlobalContext().lookup(FileObject.class);
                    ForceProject project = null;
                    if (file != null) {
                        project = (ForceProject) FileOwnerQuery.getOwner(file);
                    }


Any help appreciated.

Thanks.

--- Оригінальне повідомлення ---
Від кого: "Volodymyr" [hidden email]
Дата: 3 липня 2017, 18:15:00

Hi,

I am getting the same error for my own plugin as these are: http://statistics.netbeans.org/exceptions/detail.do?id=215797. 33 duplicates. How do I know if it has been fixed?

Here is what I get when doing an autocomplete:
===========
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.spi.editor.completion.support.AsyncCompletionTask
java.lang.NoClassDefFoundError: com/forcenb/editor/vf/completion/VfCompleter
    at com.forcenb.editor.vf.completion.vfCompletionProvider$1.query(VfCompletionProvider.java:51)
    at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:223)
===========

Another issue is that I get strange error:
java.lang.ClassCastException: com.forcenb.project.ForceProject cannot be cast to com.forcenb.project.ForceProject

in a code like this:

                    FileObject file = Utilities.actionsGlobalContext().lookup(FileObject.class);
                    ForceProject project = null;
                    if (file != null) {
                        project = (ForceProject) FileOwnerQuery.getOwner(file);
                    }

Any clue why would this be happening?

Thanks.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No Class Def found and other issues I get with my own plugin in 8.2

Neil C Smith-2
In reply to this post by Volodymyr Babin
Hi,

On Tue, Jul 4, 2017 at 3:54 PM Volodymyr <[hidden email]> wrote:
Anyone, please help, when install the plugin in NetBeans, I get the strange error below. But when run/debug it from my dev environment, so it starts another NetBeans instance, it works just fine in the instance. Maybe someone ran into such issue, or maybe has at least an idea why it might be happening and what are the possible ways to fix it?


Long shot, but have you ever used Install / reload in development IDE?  It sounds like you have that class coming from two different classloaders?

Also, although not sure it's your problem, the Javadoc from Project says never to cast to a subclass as the project infrastructure is free to wrap in a proxy.  Use lookup instead.

Best wishes,

Neil
--
Neil C Smith
Artist & Technologist

Praxis LIVE - hybrid visual IDE for creative coding - www.praxislive.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No Class Def found and other issues I get with my own plugin in 8.2

Eduard
In reply to this post by Volodymyr Babin
Hello

The runtime type of  Java class instance is formed by combining the name of the type, the class name, and the instance of the class loader that created the instance.  So when an error like this shows up, claiming a type with a class name cannot be cast to a type with the same class name it invariably means there are different class loaders involved.

As I understand it, in NB the classes in a module are loaded by a module specific class loader, except for the classes (interfaces) in the packages marked as exported.

How this error appears in your case, I don't really know as it seems to be related to how the instance of your module gets introduced into the NB application. I may be wrong about this, too.

I hope this gives you a pointer in the right direction to solve this.

Good luck.
Eduard

Volodymyr wrote:
  Hi,

Anyone, please help, when install the plugin in NetBeans, I get the strange error below. But when run/debug it from my dev environment, so it starts another NetBeans instance, it works just fine in the instance. Maybe someone ran into such issue, or maybe has at least an idea why it might be happening and what are the possible ways to fix it?

java.lang.ClassCastException: com.forcenb.project.ForceProject cannot be cast to com.forcenb.project.ForceProject

In a code like this:

                    FileObject file = Utilities.actionsGlobalContext().lookup(FileObject.class);
                    ForceProject project = null;
                    if (file != null) {
                        project = (ForceProject) FileOwnerQuery.getOwner(file);
                    }


Any help appreciated.

Thanks.

--- Оригінальне повідомлення ---
Від кого: "Volodymyr" [hidden email]
Дата: 3 липня 2017, 18:15:00

Hi,

I am getting the same error for my own plugin as these are: http://statistics.netbeans.org/exceptions/detail.do?id=215797. 33 duplicates. How do I know if it has been fixed?

Here is what I get when doing an autocomplete:
===========
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.spi.editor.completion.support.AsyncCompletionTask
java.lang.NoClassDefFoundError: com/forcenb/editor/vf/completion/VfCompleter
    at com.forcenb.editor.vf.completion.vfCompletionProvider$1.query(VfCompletionProvider.java:51)
    at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:223)
===========

Another issue is that I get strange error:
java.lang.ClassCastException: com.forcenb.project.ForceProject cannot be cast to com.forcenb.project.ForceProject

in a code like this:

                    FileObject file = Utilities.actionsGlobalContext().lookup(FileObject.class);
                    ForceProject project = null;
                    if (file != null) {
                        project = (ForceProject) FileOwnerQuery.getOwner(file);
                    }

Any clue why would this be happening?

Thanks.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No Class Def found and other issues I get with my own plugin in 8.2

Volodymyr Babin
In reply to this post by Neil C Smith-2
Thanks Neil,

Yes I tried to install / reload and that is when it stops working. Only works correctly in the Netbeans instance which has being created on Run/Debug.

If I had a File object, and I would need to determine which projects it is related to, how would I use lookups for this? FileOwnerQuery.getOwner returns the Project object.

Thanks.

--
Volodymyr

--- Оригінальне повідомлення ---
Від кого: "Neil C Smith" <[hidden email]>
Дата: 4 липня 2017, 18:45:28

Hi,

On Tue, Jul 4, 2017 at 3:54 PM Volodymyr <[hidden email]> wrote:
Anyone, please help, when install the plugin in NetBeans, I get the strange error below. But when run/debug it from my dev environment, so it starts another NetBeans instance, it works just fine in the instance. Maybe someone ran into such issue, or maybe has at least an idea why it might be happening and what are the possible ways to fix it?


Long shot, but have you ever used Install / reload in development IDE?  It sounds like you have that class coming from two different classloaders?

Also, although not sure it's your problem, the Javadoc from Project says never to cast to a subclass as the project infrastructure is free to wrap in a proxy.  Use lookup instead.

Best wishes,

Neil
--
Neil C Smith
Artist & Technologist

Praxis LIVE - hybrid visual IDE for creative coding - www.praxislive.org
Loading...