Discussion:
[jboss-user] [JBoss Tools] - Can not debug OSGI Bundles deployed in JBoss EAP 6.1 with JBossTools 4.0.1/ JBoss Developer Studio 6&7
Thomas Wiesner
2013-04-19 13:03:11 UTC
Permalink
Thomas Wiesner [https://community.jboss.org/people/Arakasi69] created the discussion

"Can not debug OSGI Bundles deployed in JBoss EAP 6.1 with JBossTools 4.0.1/ JBoss Developer Studio 6&7"

To view the discussion, visit: https://community.jboss.org/message/809280#809280

--------------------------------------------------------------
Hello All,

while migrating from JBoss 7.1.1 to JBoss EAP 6.1 Alpha1, i've evaluated JBoss Tools 4.0.1, JBoss Developer Studio 6 & 7 Alpha1 with following issue.

Our application consist of some osgi bundles and an osgi WAR which i can successfully publish and start with all named tools above. The only trick is, i've always to clean the data and tmp subdirectory in JBoss before start.

After that i tried to start the JBoss in debug mode with the named tools and deploying/starting the bundles fails with the following exception:

[0m [31m14:33:49,853 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.unit."de.xxx.yyy.data.services.jar".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."de.xxx.yyy.data.services.jar".PARSE: JBAS018733: Failed to process phase PARSE of deployment "de.xxx.yyy.data.services.jar"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA.jar:1.0.4.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA.jar:1.0.4.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_05]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_05]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]
Caused by: java.lang.NullPointerException
    at org.jboss.as.osgi.service.FrameworkActivator.activate(FrameworkActivator.java:76)
    at org.jboss.as.osgi.deployment.FrameworkActivateProcessor.deploy(FrameworkActivateProcessor.java:72)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4]
    ... 5 more

The same exception occurs for the other bundles.

With all tools i've tried the jboss eap runtime 6.1 (tech preview) adapter, and also jboss eap runtime 6.0 adapter with the known work around to symlink the jboss-modules. I've got always the same exception.

Can anybody give me a hint how to debug our application with jboss tools !? Or is it more a jboss eap 6.1 / jboss osgi issue !? But starting the jboss eap with standalone.sh and jboss tools "start" works fine with the deployed bundles.

Please let me know if you need further information.

Kind regards, Thomas
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/809280#809280]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]
Max Rydahl Andersen
2013-04-19 14:47:56 UTC
Permalink
Max Rydahl Andersen [https://community.jboss.org/people/maxandersen] created the discussion

"Re: Can not debug OSGI Bundles deployed in JBoss EAP 6.1 with JBossTools 4.0.1/ JBoss Developer Studio 6&7"

To view the discussion, visit: https://community.jboss.org/message/809312#809312

--------------------------------------------------------------
Hi,

Does it start without problems when you launch it from command line ?

i.e. is it a tool specific problem ?

p.s. When using EAP 6.1 adapter you should not be doing nor need any "symlink workarounds".
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/809312#809312]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]
Thomas Wiesner
2013-04-19 15:02:32 UTC
Permalink
Thomas Wiesner [https://community.jboss.org/people/Arakasi69] created the discussion

"Re: Can not debug OSGI Bundles deployed in JBoss EAP 6.1 with JBossTools 4.0.1/ JBoss Developer Studio 6&7"

To view the discussion, visit: https://community.jboss.org/message/809318#809318

--------------------------------------------------------------
Hi Max,

thanx for your answer.

Yes if i start jboss with standalone.sh from commandline it works fine, but i've not tried to enable the remote debugger in the standalone.conf, because this ist not what we want. Also starting the jboss from server view of jboss tools with "start" works fine.

I know, i've used the "symlink workaround" only if i've tested the eap 6.0 runtime adapter, because i thought this adapter would be more stable.

Kind regards, Thomas
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/809318#809318]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]
Max Rydahl Andersen
2013-04-22 07:46:53 UTC
Permalink
Max Rydahl Andersen [https://community.jboss.org/people/maxandersen] created the discussion

"Re: Can not debug OSGI Bundles deployed in JBoss EAP 6.1 with JBossTools 4.0.1/ JBoss Developer Studio 6&7"

To view the discussion, visit: https://community.jboss.org/message/809502#809502

--------------------------------------------------------------
I do not have an osgi AS7 setup available thus hard for me to reproduce this.

Can you try enabling debugging via standalone.sh ?

You can do that by uncommenting

#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

in standalone.conf or standalone.conf.bat if you are on windows.

then it should be running under similar circumstances as from the tools.

If that does not fail then do please open a bug at https://jira.jboss.org/jira/browse/JBIDE https://jira.jboss.org/jira/browse/JBIDE with steps to reproduce
(mini osgi app that reproduces it would be great!)

thanks,
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/809502#809502]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]
Thomas Wiesner
2013-04-22 08:34:20 UTC
Permalink
Thomas Wiesner [https://community.jboss.org/people/Arakasi69] created the discussion

"Re: Can not debug OSGI Bundles deployed in JBoss EAP 6.1 with JBossTools 4.0.1/ JBoss Developer Studio 6&7"

To view the discussion, visit: https://community.jboss.org/message/809509#809509

--------------------------------------------------------------
Hi Max,

enabling debugging in standalone.conf works fine.

After that i tried the debug mode with jboss tools, cleaning data and temp before, and now it works here too !!
Today the issue is not reproduceable, but last thursday/friday always. I haven't change the deployed bundles since friday also. Very strange !

So i'll come back here if i've further information to reproduce it.

It would be hard to roll out this environment in our team :-)

Kind regards, Thomas
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/809509#809509]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]
Thomas Wiesner
2013-04-22 08:49:54 UTC
Permalink
Thomas Wiesner [https://community.jboss.org/people/Arakasi69] created the discussion

"Re: Can not debug OSGI Bundles deployed in JBoss EAP 6.1 with JBossTools 4.0.1/ JBoss Developer Studio 6&7"

To view the discussion, visit: https://community.jboss.org/message/809511#809511

--------------------------------------------------------------
Ok, the debug mode in jboss tolls worked only once. The second and third time, always cleaning data and temp, it doesn't work.

Enabling debugging in standalone.conf seems to work stable.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/809511#809511]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]
Max Rydahl Andersen
2013-04-22 11:52:31 UTC
Permalink
Max Rydahl Andersen [https://community.jboss.org/people/maxandersen] created the discussion

"Re: Can not debug OSGI Bundles deployed in JBoss EAP 6.1 with JBossTools 4.0.1/ JBoss Developer Studio 6&7"

To view the discussion, visit: https://community.jboss.org/message/809549#809549

--------------------------------------------------------------
Hi Thomas,

sorry for it being unstable/not working for you.

It is very weird why enabling debug should cause a difference in behavior for your application; also I cannot reproduce this on my side thus I would really
appreciate if you could open a bug at https://jira.jboss.org/jira/browse/JBIDE https://jira.jboss.org/jira/browse/JBIDE explaining how to reproduce this problem so we can look at it and figure out
what triggers it.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/809549#809549]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]
Max Rydahl Andersen
2013-04-22 11:53:32 UTC
Permalink
Max Rydahl Andersen [https://community.jboss.org/people/maxandersen] created the discussion

"Re: Can not debug OSGI Bundles deployed in JBoss EAP 6.1 with JBossTools 4.0.1/ JBoss Developer Studio 6&7"

To view the discussion, visit: https://community.jboss.org/message/809550#809550

--------------------------------------------------------------
note, did you try to connect  a debugger when using standalone.conf approach ?

it is a long shot but it might be this issue only triggers when a debugger is actually connected to the jvm.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/809550#809550]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]
Thomas Wiesner
2013-04-22 12:07:35 UTC
Permalink
Thomas Wiesner [https://community.jboss.org/people/Arakasi69] created the discussion

"Re: Can not debug OSGI Bundles deployed in JBoss EAP 6.1 with JBossTools 4.0.1/ JBoss Developer Studio 6&7"

To view the discussion, visit: https://community.jboss.org/message/809553#809553

--------------------------------------------------------------
Hi Max, thanx for your note.

I haven't connected a debugger when using the standalone.conf approach, because i was to focused on the start and did not thougth about this. I'll try this.
I will open an bug as soon as possible. It will take a little bit time, because of other i've to do.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/809553#809553]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]
Thomas Wiesner
2013-04-22 13:40:08 UTC
Permalink
Thomas Wiesner [https://community.jboss.org/people/Arakasi69] created the discussion

"Re: Can not debug OSGI Bundles deployed in JBoss EAP 6.1 with JBossTools 4.0.1/ JBoss Developer Studio 6&7"

To view the discussion, visit: https://community.jboss.org/message/809578#809578

--------------------------------------------------------------
While trying to provide a reproducable example for you, i gather following detailed informations:

First, our app needs 6 bundles. 5 bundles are simple OSGI-Jars the sixth is an OSGI-WAR.

a) starting debug mode in jboss tools with one OSGI-Jar, i can hot deploy all OSGI-Bundles incl. OSGI-WAR one by one with "Add and Remove.."
b) i can publish all OSGI-Jars and then start the jboss with jboss tools in debug mode
c) if i publish the OSGI-WAR and then start the jboss with jboss tools in debug mode --> the exceptions above occur

So to reproduce this issue we'll need one OSGI-War and one dependent OSGI-Jar.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/809578#809578]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]
Thomas Wiesner
2013-04-22 15:17:34 UTC
Permalink
Thomas Wiesner [https://community.jboss.org/people/Arakasi69] created the discussion

"Re: Can not debug OSGI Bundles deployed in JBoss EAP 6.1 with JBossTools 4.0.1/ JBoss Developer Studio 6&7"

To view the discussion, visit: https://community.jboss.org/message/809617#809617

--------------------------------------------------------------
Hi Max,

issue is created: https://issues.jboss.org/browse/JBIDE-14120 https://issues.jboss.org/browse/JBIDE-14120

Good luck and kind regards
Thomas
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/809617#809617]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]
Thomas Wiesner
2013-04-26 07:42:33 UTC
Permalink
Thomas Wiesner [https://community.jboss.org/people/Arakasi69] created the discussion

"Re: Can not debug OSGI Bundles deployed in JBoss EAP 6.1 with JBossTools 4.0.1/ JBoss Developer Studio 6&7"

To view the discussion, visit: https://community.jboss.org/message/810468#810468

--------------------------------------------------------------
For all which are interested in a workaround for this issue.

In my case starting the jboss in debug mode works if i start the jboss with empty deployments and hot delpoy my artifacts one after the other.

After this experience, i decided to write a little wrapper class, which wraps the start of jboss with

h5. org.jboss.modules.Main

Before the start i clean subdirectories data and tmp of jboss, and move all artifacts from deployments to a temporay directory. After the start and waiting a few seconds, i move the artifacts from the temporary folder back to the deployments directory in the required order.

The wrapper class must be copied in the jboss-modules.jar, because changing the classpath of the launch configuration didn't work too. In the launch configuration in the main tab now change the class to your wrapper class.

Hope, this helps to analyze the issue.

Kind regards
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/810468#810468]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]
Loading...