attach mode failed

645 views
Skip to first unread message

Pierrick MOLERA

unread,
Jun 20, 2014, 12:27:46 PM6/20/14
to crash...@googlegroups.com
Hi,
thankyou very much  Julien for this great Jug at Montpellier. :)
Now I want to try CRaSH with my desktop application.

I've started my application and get the pid with the jps command.
So when I run crash.bat pid : I get the following exception :

java.util.ServiceConfigurationError: com.sun.tools.attach.spi.AttachProvider: Provider sun.tools.attach.WindowsAttachProvider could not be instantiated: java.lang.UnsatisfiedLinkError: no attach in java.library.path
java.util.ServiceConfigurationError: com.sun.tools.attach.spi.AttachProvider: Provider sun.tools.attach.WindowsAttachProvider could not be instantiated: java.lang.NoClassDefFoundError: Could not initialize class sun.tools.attach.WindowsAttachProvider
Exception in thread "main" org.crsh.cli.impl.invocation.InvocationException: com.sun.tools.attach.AttachNotSupportedException: no providers installed
        at org.crsh.cli.impl.lang.MethodDescriptor$1.invoke(MethodDescriptor.java:172)
        at org.crsh.cli.impl.lang.MethodDescriptor$1.invoke(MethodDescriptor.java:106)
        at org.crsh.cli.impl.invocation.InvocationMatch.invoke(InvocationMatch.java:101)
        at org.crsh.cli.impl.bootstrap.Main.handle(Main.java:64)
        at org.crsh.cli.impl.bootstrap.Main.main(Main.java:54)
Caused by: com.sun.tools.attach.AttachNotSupportedException: no providers installed
        at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
        at org.crsh.standalone.CRaSH.main(CRaSH.java:276)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.crsh.cli.impl.lang.MethodDescriptor$1.invoke(MethodDescriptor.java:164)
        ... 4 more

What step I've missed for this attache mode ?

If I want embedded CRaSH in a desktop application, what do I need to do exactly ?
thank you in advance for your help.

Regards,
Pierrick

Julien Viet

unread,
Jun 20, 2014, 12:44:09 PM6/20/14
to Pierrick MOLERA, crash...@googlegroups.com
On 20 Jun 2014 at 18:27:47, Pierrick MOLERA (pierric...@gmail.com) wrote:
Hi,
thankyou very much  Julien for this great Jug at Montpellier. :)


Glad you liked it!

I have to confess attaching has not been tested enough on Windows platform. You are not running into a CRaSH issue per se but instead a “crash.bat” issue.

Henri Tremblay at Devoxx Hackergarten provided a pull request to improve that but I had no time to merge / verify it.

Can you try to apply this patch to crash.bat and see if it improves things ?

https://github.com/crashub/crash/pull/90




If I want embedded CRaSH in a desktop application, what do I need to do exactly ?
thank you in advance for your help.

Basically three choices:

1/ use the org.crsh.standalone.Bootstrap class like the org.crsh.standalone.CRaSH does (https://github.com/crashub/crash/blob/master/shell/src/main/java/org/crsh/standalone/CRaSH.java)

2/ use org.crsh.standalone.CRaSH class . 

3/ embed CRaSH in Spring and bootstrap Spring : http://www.crashub.org/1.3/reference.html#_embedding_in_spring

I think some people have done that recently in this list, perhaps they can share their experience too!



Regards,
Pierrick
--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "CRaSH User Group".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse crash-users...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

Pierrick MOLERA

unread,
Jun 20, 2014, 5:25:29 PM6/20/14
to crash...@googlegroups.com, pierric...@gmail.com
Thank you very much again,
I will check your links, and I will post if I find an attach mode solution
For the embedded mode I will try this bootstrap class.

Regards,

Pierrick
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse crash-users+unsub...@googlegroups.com.

Pierrick MOLERA

unread,
Jun 24, 2014, 4:43:49 AM6/24/14
to crash...@googlegroups.com, pierric...@gmail.com
Hi Julien,

I've fixed my system path and I've put my jvm path in first.

So, now I've got a new error with the attach mode under Windows :

Exception in thread "main" org.crsh.cli.impl.invocation.InvocationException: com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize

        at org.crsh.cli.impl.lang.MethodDescriptor$1.invoke(MethodDescriptor.java:172)
        at org.crsh.cli.impl.lang.MethodDescriptor$1.invoke(MethodDescriptor.java:106)
        at org.crsh.cli.impl.invocation.InvocationMatch.invoke(InvocationMatch.java:101)
        at org.crsh.cli.impl.bootstrap.Main.handle(Main.java:64)
        at org.crsh.cli.impl.bootstrap.Main.main(Main.java:54)
Caused by: com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize
        at sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:103)
        at org.crsh.standalone.CRaSH.main(CRaSH.java:278)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.crsh.cli.impl.lang.MethodDescriptor$1.invoke(MethodDescriptor.java:164)
        ... 4 more

Thanks

Pierrick


Julien Viet

unread,
Jun 27, 2014, 11:59:06 AM6/27/14
to Pierrick MOLERA, crash...@googlegroups.com, pierric...@gmail.com
thanks, I think I need to bootup a windows OS and figure out by myself (with my limited windows skills :-) )

I will try to spend some time on that during the week end!

--
Julien Viet
www.julienviet.com
> --
> Vous recevez ce message, car vous êtes abonné au groupe Google Groupes CRaSH User Group.
> Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez
> un e-mail à l'adresse crash-users...@googlegroups.com.
> Pour plus d'options, visitez le site https://groups.google.com/d/optout .
>

Reply all
Reply to author
Forward
0 new messages