cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging Alfresco Tomcat with Eclipse

kirit
Champ on-the-rise
Champ on-the-rise
Hi,
I want to setup the Debugging for my Alfresco project with Eclipse, how can i do this?
29 REPLIES 29

jbarmash
Champ in-the-making
Champ in-the-making

kirit
Champ on-the-rise
Champ on-the-rise
Thanks for you reply.
I have followed the steps that are given in the link but somehow its not working for me it is giving me Exception like

ERROR [catalina.startup.Bootstrap] Class loader creation threw exception
java.lang.NoSuchFieldError: IS_DIR
   at org.apache.catalina.startup.Bootstrap.createClassLoader(Bootstrap.java:173)
   at org.apache.catalina.startup.Bootstrap.initClassLoaders(Bootstrap.java:98)
   at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:213)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:410)

i am using Eclipse Europa and i am running my alfresco using the Build file, so how can i dubug my Alfresco Application???

kayan
Champ in-the-making
Champ in-the-making
Hi,

Here is the simple steps to follow,

For debugging the eclipse envt…
1)   Open Catalina.bat [C:\Alfresco\tomcat\bin], find “DEBUG_OPTS=” and add following line..
   set DEBUG_OPTS= -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888

2)   Come to Eclipse ->
      a)Open debug perspective[Windows->open perspective ->Other->Debug]
      b)Run-> Open Debug Dialog -> Remote Java Application -> New configuration ->
      c)Select the project -> Enter the port number as debug port in the Catalina.bat (8888)
3)   Start Alfresco server.
4)   Put the breakpoint in the file
5)   Start debug.
6)     Use the Alfresco to get to the debug mode..

Thanks
Kayan

kirit
Champ on-the-rise
Champ on-the-rise
Hey kayan, Thanks a lot, i am now able to debug my alfresco application, its really too helpful. Thanks again Smiley Very Happy

biswajit
Champ in-the-making
Champ in-the-making
hi,
I try this thing but it is not working.It give the following error:
ERROR: JDWP unable to get necessary JVMTI capabilities. ["debugInit.c",L279]
Please help me.
Thanks

chraja
Champ in-the-making
Champ in-the-making
is there any one tried debugging Share . I tried JPDA and was able to hit my checkpoint ( LoginBean ,getUsername()) . But when I had a checkpoint at service() method of DispatcherServlet in the SHARE , its not catching it , I tried FrameworkHelper as well . Please let me know if someone tried and succesful debugging SHARE . Please direct me .

Thanks,
Raja

chraja
Champ in-the-making
Champ in-the-making
I take my question back , I am not sure why my checkpoint at service method was not hit but , I was able to hit the checkpoint at dispatch method on dispatcherservlet .

Thanks,
Raja

pp20218
Champ in-the-making
Champ in-the-making
Hi,

I am trying to debug in eclipse but I cant.
I have my code base setup in eclipse and I can build and run alfresco from eclipse.

I tried the above step  set the DEBUG as
In catalina.sh i did
# OS specific support.  $var _must_ be set to either true or false.
cygwin=false
os400=false
darwin=false
case "`uname`" in
CYGWIN*) cygwin=true;;
OS400*) os400=true;;
Darwin*) darwin=true;;
esac
set DEBUG_OPTS= -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888
# resolve links - $0 may be a softlink
PRG="$0"

(2) In eclipse I set the debug configuration i set the port 8888. but when  I debug I am getting  com.sun.jdi.connect.spi.ClosedConnectionException error message.
Also i tried with 8080 port where tomcat is running. Still it is nt working for me.

Pls share ur ideas if any.

Thanks
PP

mrogers
Star Contributor
Star Contributor
The closed connection exception generally means that alfresco has shut down while you were debugging.

Make sure alfresco is started before you start debugging and remains running.  

If you are, for example debugging a unit test that starts and stops alfresco then debug it locally not remotely.