Page 1 of 2
gwt-debug : what's the right way to use it with BL
Posted: Mon Aug 27, 2012 10:12 pm
by cnadeau
Hi,
I just can't get the gwt:debug to work correctly. Isn't it supposed to be easy as 1-2-3 ? Of course not!

1-I installed GWT DevMode plugin in chrome and added 127.0.1.1 as truste site (even if not nessary)
2-Start site using jetty-demo => able to access site correctly
3-Start admin using jetty-demo => able to access the admin site with SSL error (or without if I comment
If I start gwt-debug and attach the remote application debug configuration, I see the GWT Development Mode window and get the url as:
Code: Select all
http://127.0.1.1:8888/admin/admin.html?gwt.codesvr=127.0.1.1:9997
Ok, now here is where I'm confused: do I need to start the admin before running gwt-debug ? The admin will start the jetty server, initialize the database, hibernate and persistence contenxt, but will be listening on port 8444 for https connection, not the gwt server port specified in that url...
All documentation I found was more or less the same as this short version (
http://kiahu.com/tutorial/debugging-wit ... nd-eclipse) mentionning the google eclipse plugin. Do we need to install this plugin in order to debug the admin modules in BLC?
From what I've seen from 2.0 M1-1 to M1-6, things are going great and clean, continue the great work !
Chris
Re: gwt-debug : what's the right way to use it with BL
Posted: Tue Aug 28, 2012 7:56 am
by cnadeau
After talking to a collegue, I must admin I should have figured it out:
the admin must be started in order to connect and debug it (obviously) and the the url provided by gwt development mode must be modified in order to use https and the correct ssl port:
https://127.0.1.1:8444/admin/admin.html?gwt.codesvr=127.0.1.1:9997
That's exactly what the google eclipse plugin does when starting a Debug as Web Application run configuration.
Chris
Re: gwt-debug : what's the right way to use it with BL
Posted: Tue Aug 28, 2012 8:43 am
by phillipuniverse
Yup, you got it. Just a note here, the admin by default (in development.properties) has its hibernate ddl set to "update" so it will not actually create the database for you. Currently, you have to first start up site (jetty-demo or jetty-demo-jrebel in the site project) to create all the database tables, then start up admin (jetty-demo or jetty-demo-jrebel in the admin project), then run gwt-debug.
If you find yourself having to do this a lot and you don't really need the frontend running, you can always just change the admin hibernate ddl in development.properties file to 'create' and reference the import files just like the site project does.
Re: gwt-debug : what's the right way to use it with BL
Posted: Thu Dec 20, 2012 12:49 pm
by mahendran
@phillipuniverse - I have followed instructions as mentioned and I am able to run the client side and server side hooks to run the admin application in debug mode. GWT development mode screen is also appeared, immediately after the hooks are connected. However When I hit the admin url in firefox and analyze the request via firebug I see, error message saying connection aborted. Any idea what could be the reason for this error. Appreciate your help. Thanks.
Re: gwt-debug : what's the right way to use it with BL
Posted: Thu Dec 20, 2012 4:08 pm
by phillipuniverse
What URL are you trying to hit in FF? The GWT debug url would be
https://localhost:8444/admin?gwt.codesvr=localhost:9997.
Re: gwt-debug : what's the right way to use it with BL
Posted: Thu Dec 20, 2012 4:09 pm
by phillipuniverse
@mahendran: also what version of BLC are you using? And what URL is it trying to hit in firebug when it says "connection aborted"?
Re: gwt-debug : what's the right way to use it with BL
Posted: Fri Dec 21, 2012 1:31 am
by mahendran
@phillipuniverse
Thanks for the quick response . Appreciate it.
I have used this URL
http://localhost:8065/admin/admin.html?gwt.codesvr=localhost:9997 and also tried with URL with actual IP address instead of localhost. In both the cases, connection gets aborted.
Following is the set-up,
DB being used is MYSQL. All the tables are available in there, I didn't face any issues in starting the application (jetty-demo, server side hook, gwt-debug and client side hook). Jetty server is made to listen to 8085 as 8081 is conflicting with one of the local process in my system. I didn't not run the site applicaiton during this exercise but I was successful in running the site and admin in tomcat with MySQL as DB. Hence admin related tables are already available in MYSQL db.
Here is the BLC version details.
<groupId>com.mycompany</groupId>
<artifactId>admin</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<name>admin</name>
<description>Web Module For Customized Broadleaf Commerce Admin</description>
<url>http://www.blc-archetype.com/admin</url>
<properties>
<blc.version>2.0.2-GA</blc.version>
<httpsPort>8444</httpsPort>
<gwt.version>2.4.0</gwt.version>
<webappDirectory>C:\WORK\SOLR\BROADWORKSPACE\eclipse-workspace\DemoSite\admin\target/admin</webappDirectory>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<httpPort>8065</httpPort>
</properties>
Thanks
Mahendran
Re: gwt-debug : what's the right way to use it with BL
Posted: Fri Dec 21, 2012 11:13 am
by phillipuniverse
I still don't exactly understand what you mean by "connection gets aborted". Can you elaborate on this?
Also, all of the admin URLs force SSL (https, to modify this see applicationContext-admin-security.xml) but if you try to go to the http port it should be redirecting you. Try going to https://localhost:8444/admin since that is what you have for the httpsPort property in your pom.
You mentioned you were running in Tomcat; the directions I gave there are for running with jetty-demo from the ant task. In either case you will need to ensure that you're using https and the correct SSL port defined by Tomcat in server.xml. Actually, this might be the root of your problem and the reason that you're getting connection aborted and not being properly redirected; Tomcat's SSL port is commented out by default. I suspect that uncommenting this will fix your problems.
One final note; check applicationContext-admin-security.xml and specifically the sec:port-mapping section to make sure that those are all relevant for your specific circumstances.
Re: gwt-debug : what's the right way to use it with BL
Posted: Fri Dec 21, 2012 1:52 pm
by mahendran
@phillipuniverse
Sorry, if my last post created a confusion. This is what I have done (ignore whatever I have mentioned about tomcat).
1.Ran the "jetty-demo" of /DemoSite/admin/build.xml
2.Ran the "gwt-debug" of /DemoSite/admin/build.xml
3.Ran the eclipse remote application hook to connect to port 8001
4.Ran the eclipse remote application hook to connect to port 8011.
All the above steps completed without any error/problem and able to get "GWT development mode" screen as well.
Intially I was using the URL http://localhost:8065/admin/admin.html? ... lhost:9997 and connection gets timed out. After your last reply. I tried this url in FireFox,
https://localhost:8444/admin/admin.html ... lhost:9997, request gets re-directed (302-Found) to https://localhost:8444/admin/blcadmin/login.jsp and when login.jsp is getting processed this error is resulted.
[size=150][size=50]HTTP ERROR 500Problem accessing /admin/blcadmin/login.jsp. Reason:
PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required
Caused by:
org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:92)[/size][/size]
I have tried changing the JRE that comes as part of JDK 1.6.0_35 but so far not able to resolve this error. Thanks for your help.
Regards,
Mahendran
Re: gwt-debug : what's the right way to use it with BL
Posted: Fri Dec 21, 2012 4:18 pm
by phillipuniverse
Yeah you will definitely need to ensure that all of your java tasks involve the JDK and not just the JRE. Depending on where you are running this from (Eclipse or command line) you might have to check different places. Check the build path of your Eclipse project and ensure that those are referencing the JDK (my project looks like this:
http://cl.ly/image/1d2g2c1Y0L3g). The easiest way to check what's accessible on your PATH you should be able to run 'javac'.
FYI, the reason that going to
http://localhost:8065 wasn't working is because you did not have a reference for that port in applicationContext-admin-security.xml. To change this you can modify it like so:
Code: Select all
<sec:port-mappings>
<sec:port-mapping http="80" https="443"/>
<sec:port-mapping http="8080" https="8443"/>
<sec:port-mapping http="8081" https="8444"/>
<sec:port-mapping http="8065" https="8444"/>
</sec:port-mappings>
Once you resolve your JDK problem you should be good to go.