[JBoss Tools] - Use JBoss Tools with Google GWT Plugin
by Andre Dietishei
Andre Dietishei [http://community.jboss.org/people/adietish] modified the document:
"Use JBoss Tools with Google GWT Plugin"
To view the document, visit: http://community.jboss.org/docs/DOC-15593
--------------------------------------------------------------
h1. A few simple steps
If you develop web applications with GWT you most likely end up using Eclipse and the Google Plugins for Eclipse. These Plugins offer to run your application on a jetty instance. If you want to use JBoss instead, JBoss Tools allows you to define a war project archive and make sure it gets published to the JBoss instance of your choice. This allows you to use Google GWT plugins proprietary project layout and Eclipse integration together with JBoss servers.
Note: We are working on getting Google GWT Plugin to be a better Eclipse citizen, but for now this will have to do ;)
h2. *Premise*
The google web toolkit, GWT is a nice framework to develop web applications. Google even delivers a plugin for Eclipse so that developing with GWT is a very pleasant experience. The GWT plugin uses an embedded jetty to run the application that you develop. Google unfortunately did not use standard Eclipse project structure for web projects. So if you want to use JBoss instead of jetty, the approach to take is not as intuitive as it could be. This article shows you what steps to take so that you can develop your GWT application seamlessly with JBoss Tools while running on JBoss.
h1. Solution
This How-To shows all the steps to install the plugins and how to configure it with Project Archives.
h2. Install Google Plugin for Eclipse
Install the Google plugin for Eclipse in your Eclipse or JBoss Developer Studio (3.x) by adding the following update site:
> http://dl.google.com/eclipse/plugin/3.5 http://dl.google.com/eclipse/plugin/3.5
You can use the Google GWT plugin i http://code.google.com/eclipse/docs/getting_started.html#installing nstallation guide to see the exact instructions.
h2. Create a Web Application Project
In order to get the support you need for GWT projects, you'll need to create a new *Web Application Project*. You may do so with the toolbar or with entries in the file menu.
http://community.jboss.org/servlet/JiveServlet/showImage/4286/create-web-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4286/create-...
http://community.jboss.org/servlet/JiveServlet/showImage/102-15593-3-4320... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15593-3-...
Notice that here we deselect "Use Google App Engine" since that is not needed for this example.
h2. Create a new WAR with Project Archives
We'll work with a JBoss application server instead of the embedded jetty that's provided with the Google plugins. We therefore need to provide JBoss with a *War Archive* that bundles your project resources. The *Project archives* view allows you to do so. Select your GWT project and go to the *Project archives* view. You can now define a new war archive by right clicking on the project name.
http://community.jboss.org/servlet/JiveServlet/showImage/4289/create-new-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4289/create-...
The wizard that pops up allows you pick an archive name, the path at which it'll be created and the type (packed or unpacked). Choose the settings that fit your needs.
http://community.jboss.org/servlet/JiveServlet/showImage/4290/create-new-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4290/create-...
The wizard created a default fileset, that determines what project files shall be included in the war. We'll replace it by a fileset that includes all files within the *war* directory. This is the location the google plugins compile and package the code to.
http://community.jboss.org/servlet/JiveServlet/showImage/4291/create-new-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4291/create-...
Your war archive shows up in the *Project archives* as soon you hit *finish*.
http://community.jboss.org/servlet/JiveServlet/showImage/4292/create-new-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4292/create-...
h1. Build and publish your war
We now need to publish the War to the JBoss instance. Choose the appropriate entry in the context-menu of your war-archive and hit *Edit publish settings*.
http://community.jboss.org/servlet/JiveServlet/showImage/4293/adjust-war-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4293/adjust-...
JBoss Developer Studio comes with a preconfigured server named jboss-eap. You therefore already get that server in the list of the available servers.
If you use plain JBoss Tools you would need to setup the server manually.
Select the server and choose to publish to it in the way that fits your needs:
http://community.jboss.org/servlet/JiveServlet/showImage/4294/adjust-war-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4294/adjust-...
Your war now's assiociated to your server and will be published to it if your GWT project's been built. The *Servers* view show you the state of the publishing:
http://community.jboss.org/servlet/JiveServlet/showImage/4295/war-on-serv... http://community.jboss.org/servlet/JiveServlet/downloadImage/4295/war-on-...
h2. Cross compile
GWT allows you to write your client code in (almost) plain java instead of funky javascript. GWT ships a cross compiler that generates javascript out of your java classes. You need to start that cross compiler so that the client codes gets into your war. (We show later how you can use the hosted mode too with JBoss)
http://community.jboss.org/servlet/JiveServlet/showImage/4319/cross-compi... http://community.jboss.org/servlet/JiveServlet/downloadImage/4319/cross-c...
The Google cross compiler will inform you in the console view whether's he succeeded in his job. Check the output and wait until it terminated its compilation task.
h2. *Launch your Browser*
The project archive we created was deployed to the base url *gwt-jboss*. The jBoss server that's included in the JBoss developer studio is configured (by default) to run on port *8080*. Your application's therefore accessible at the url:
**
> http://127.0.0.1:8080/gwt-jboss/Gwt_jboss.html http://127.0.0.1:8080/gwt-jboss/Gwt_jboss.html
*http://community.jboss.org/servlet/JiveServlet/showImage/4317/browser.png http://community.jboss.org/servlet/JiveServlet/downloadImage/4317/browser...
h2. Speed up my development cycle!
The approach we've choosen so far uses an extra cross compile step to deploy the application after each change. That's very reliable but it gets tedious at development time. Google delivers a so called hosted mode. Its major benefit is that your java classes dont get cross-compiled but interpreted to javascript at runtime. Changing, testing, changing, testing etc. gets much faster and pleasant, the cross-compilation step's not needed any more. You need a browser plugin, a slightly different url for your application and a google runtime to achieve that.
h2.
h2. Launch Google
If you start this launch configuration you wont have to cross compile your java client classes to javascript. It will get interpreted by the google browser plugin. On the other hand the browser plugin needs access to your java classes. The google runtime you just launched allows it to get your java code. The url parameter you add when you access your application tells the plugin at what host and port the hosted mode runs.
Create a *Web Application* launch configuration for that matter.
http://community.jboss.org/servlet/JiveServlet/showImage/102-15593-3-4321... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15593-3-...
We want to use our JBoss instance, we therefore disable the embedded jetty that's provided by the GWT plugins.
http://community.jboss.org/servlet/JiveServlet/showImage/4297/new-run-con... http://community.jboss.org/servlet/JiveServlet/downloadImage/4297/new-run...
Now that we want not to cross-compile on each change, we'll need to tell the google browser-plugin where to fetch the code from. We do that by adding an url parameter:
**
> http://127.0.0.1:8080/gwt-jboss/Gwt_jboss.html http://127.0.0.1:8080/gwt-jboss/Gwt_jboss.html*?gwt.codesvr=127.0.0.1:9997*
To convince yourself that there's no cross compilation needed any more, go to the client-package and change any java class that's in there. You may for instance change the label of a button and reload your browser (without launching the google cross-compiler).
http://community.jboss.org/servlet/JiveServlet/showImage/4311/button-labe... http://community.jboss.org/servlet/JiveServlet/downloadImage/4311/button-...
http://community.jboss.org/servlet/JiveServlet/showImage/4312/button-labe... http://community.jboss.org/servlet/JiveServlet/downloadImage/4312/button-...
h1. Conclusion
There you go, now you can use JBoss Tools and JBoss Developer Studio together with Google GWT plugin to do full deployment (with Cross Compile) or development mode via the hosted mode option.
All enabled by utilizing the Project Archives view.
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-15593]
Create a new document in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
14 years, 4 months
Re: [jboss-user] [jBPM] - How to start/spawn 'n' subprocesses for 'n' users using JBPM-4.3.
by Felix Jose
Felix Jose [http://community.jboss.org/people/FelixKJose] replied to the discussion
"How to start/spawn 'n' subprocesses for 'n' users using JBPM-4.3."
To view the discussion, visit: http://community.jboss.org/message/552767#552767
--------------------------------------------------------------
Hi All,
I have write a JBPM main process (Request.jpdl.xml) for starting "n" subprocess depending upon the input(number of users) and is given below
<java class=+"com.felix.poc.TestActivity" method=+"decreaseForkCounter"+ name=+"decreaseForkCounter" var=+"request" g=+"570,94,149,40"> <arg> <object expr=+"#{request}" /> </arg>
<transition g=+"-71,-18" name=+"sendToAssist" to=+"sendToAssist" />++++++</java>
<decision g=+"250,208,48,48" name=+"decideForkAgain"> <handler class="com.felix.poc.ForkAgainHandler" /> <transition g="274,113:78,-18" name="FORK_AGAIN" to="decreaseForkCounter" /> <transition g="280,556:172,-23" name="FORK_NOT_AGAIN" to="join1" /> </decision> <fork g="623,207,80,40" name="sendToAssist"> <transition name="assist" to="assist" g="-16,-16" /> <transition g="-39,-18" name="decideForkAgain" to="decideForkAgain" /> </fork> <sub-process g="753,210,80,40" name="assist" sub-process-key="Assist"> <ransition g="14,16" name="join1" to="join1" /> </sub-process> <join g="777,529,80,40" name="join1"> <transition g="-31,-18" name="end" to="theEnd" /> </join> I have atttached the same application with this. But when I am trying to start multiple sub processes I am getting the following exception: Drecreased fork counter to:22796 [main] INFO com.felix.poc.TestActivity - Drecreased fork counter to:12796 [main] INFO org.hibernate.event.def.DefaultDeleteEventListener - handling transient entity in delete processingFork counter is 12827 [main] INFO com.felix.poc.ForkAgainHandler - Fork counter is 1fork again2827 [main] INFO com.felix.poc.ForkAgainHandler - fork againDrecreased fork counter to:12827 [main] INFO com.felix.poc.TestActivity - Drecreased fork counter to:0Fork counter is 02843 [main] INFO com.felix.poc.ForkAgainHandler - Fork counter is 02843 [main] INFO com.felix.poc.ForkAgainHandler - fork finished2874 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: -104, SQLState: 230002874 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Violation of unique constraint $$: duplicate value(s) for column(s) $$: SYS_CT_50 in statement [update JBPM4_EXECUTION set DBVERSION_=?, ACTIVITYNAME_=?, PROCDEFID_=?, HASVARS_=?, NAME_=?, KEY_=?, ID_=?, STATE_=?, SUSPHISTSTATE_=?, PRIORITY_=?, HISACTINST_=?, PARENT_=?, INSTANCE_=?, SUPEREXEC_=?, SUBPROCINST_=? where DBID_=? and DBVERSION_=?]2874 [main] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with sessionorg.hibernate.exception.ConstraintViolationException : could not update: [org.jbpm.pvm.internal.model.ExecutionImpl#26]at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2453)at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2335)at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2635)at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115)at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)at org.jbpm.pvm.internal.tx.HibernateSessionResource.prepare(HibernateSessionResource.java:56)at org.jbpm.pvm.internal.tx.StandardTransaction.commit(StandardTransaction.java:107)at org.jbpm.pvm.internal.tx.StandardTransaction.complete(StandardTransaction.java:64)at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:61)at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServiceImpl.java:70)at com.felix.poc.Starter.main(Starter.java:31)Caused by:java.sql.SQLException: Violation of unique constraint $$: duplicate value(s) for column(s) $$: SYS_CT_50 in statement [update JBPM4_EXECUTION set DBVERSION_=?, ACTIVITYNAME_=?, PROCDEFID_=?, HASVARS_=?, NAME_=?, KEY_=?, ID_=?, STATE_=?, SUSPHISTSTATE_=?, PRIORITY_=?, HISACTINST_=?, PARENT_=?, INSTANCE_=?, SUPEREXEC_=?, SUBPROCINST_=? where DBID_=? and DBVERSION_=?]at org.hsqldb.jdbc.Util.throwError(Unknown Source)at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2435)... 19 more So how can I start the multiple suprocesses? How can I get rid from this exception.I am attching the test application with this. Please help me. Thank you,With Regards,Felix K Jose So how can I start the multiple suprocesses? How can I get rid from this exception.I am attching the test application with this. Please help me. Thank you,With Regards,Felix K Jose ++++++++++++++
++
+++
+
+++
+++
++++++++++
+++
+
+++
+++
+++++++++++++
+++
+
+++
+++
+++++++
+
+++
+++
++++++++
+
+++
+++
++++++
+++
+++
+++
++++++
+++
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/552767#552767]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 4 months
[JBoss AOP] - Dynamic AOP + Hot Swap + Not able to get it work
by Vivek Nandavanam
Vivek Nandavanam [http://community.jboss.org/people/VivekNandavanam] created the discussion
"Dynamic AOP + Hot Swap + Not able to get it work"
To view the discussion, visit: http://community.jboss.org/message/552766#552766
--------------------------------------------------------------
Hello,
I am very new to JBoss and AOP. I have been trying to implement dynamic aop and i am using jboss-4.2.3-GA and JDK 1.6.0_01.
Jboss aop in use is the one that comes with 4.2.3 by default.
An interceptor that i created is getting invoke from an application.
>From this interceptor i am calling a session bean which has a method to return a string.
I have deployed the session bean along with the home and remote interface in one jar, and the interceptor in a plain jar.
The extract from the *-aop.xml is as below:
<aop>
<prepare expr="all(com.test.interceptor.InterceptorClass)"/>
<typedef name="Transform" expr="class(com.other.test.Bean)"/>
<bind pointcut="execution(* $typedef{Transform}->someMethod(..))">
<interceptor class="com.test.interceptor.InterceptorClass"/>
</bind>
</aop>
I am making a change in the session bean and redeploying it so that it returns a different string without starting jboss.
But i see that the changes are not reflected.
The 'EnableLoadtimeWeaving' attribute is set to true in jboss-service.xml and i have added -javaagent:pluggable-instrumentor.jar in run.bat file.
The example ear and wars created using jboss aop1.5 seem to work fine.
I read about enabling the hot swap feature, but how is that done in jboss.
Since i am compiling the session beans outside of jboss and then redeploying them.
So all i want to do is to redeploy my session bean without restarting jboss in runtime.
Please point me in the right direction.
-Regards,
Vivek
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/552766#552766]
Start a new discussion in JBoss AOP at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 4 months
[JBoss Tools] - Use JBoss Tools with Google GWT Plugin
by Andre Dietishei
Andre Dietishei [http://community.jboss.org/people/adietish] modified the document:
"Use JBoss Tools with Google GWT Plugin"
To view the document, visit: http://community.jboss.org/docs/DOC-15593
--------------------------------------------------------------
h1. A few simple steps
If you develop web applications with GWT you most likely end up using Eclipse and the Google Plugins for Eclipse. These Plugins offer to run your application on a jetty instance. If you want to use JBoss instead, JBoss Tools allows you to define a war project archive and make sure it gets published to the JBoss instance of your choice. This allows you to use Google GWT plugins proprietary project layout and Eclipse integration together with JBoss servers.
Note: We are working on getting Google GWT Plugin to be a better Eclipse citizen, but for now this will have to do ;)
h2. *Premise*
The google web toolkit, GWT is a nice framework to develop web applications. Google even delivers a plugin for Eclipse so that developing with GWT is a very pleasant experience. The GWT plugin uses an embedded jetty to run the application that you develop. Google unfortunately did not use standard Eclipse project structure for web projects. So if you want to use JBoss instead of jetty, the approach to take is not as intuitive as it could be. This article shows you what steps to take so that you can develop your GWT application seamlessly with JBoss Tools while running on JBoss.
h1. Solution
This How-To shows all the steps to install the plugins and how to configure it with Project Archives.
h2. Install Google Plugin for Eclipse
Install the Google plugin for Eclipse in your Eclipse or JBoss Developer Studio (3.x) by adding the following update site:
> http://dl.google.com/eclipse/plugin/3.5 http://dl.google.com/eclipse/plugin/3.5
You can use the Google GWT plugin i http://code.google.com/eclipse/docs/getting_started.html#installing nstallation guide to see the exact instructions.
h2. Create a Web Application Project
In order to get the support you need for GWT projects, you'll need to create a new *Web Application Project*. You may do so with the toolbar or with entries in the file menu.
http://community.jboss.org/servlet/JiveServlet/showImage/4286/create-web-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4286/create-...
http://community.jboss.org/servlet/JiveServlet/showImage/102-15593-2-4320... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15593-2-...
Notice that here we deselect "Use Google App Engine" since that is not needed for this example.
h2. Create a new WAR with Project Archives
We'll work with a JBoss application server instead of the embedded jetty that's provided with the Google plugins. We therefore need to provide JBoss with a *War Archive* that bundles your project resources. The *Project archives* view allows you to do so. Select your GWT project and go to the *Project archives* view. You can now define a new war archive by right clicking on the project name.
http://community.jboss.org/servlet/JiveServlet/showImage/4289/create-new-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4289/create-...
The wizard that pops up allows you pick an archive name, the path at which it'll be created and the type (packed or unpacked). Choose the settings that fit your needs.
http://community.jboss.org/servlet/JiveServlet/showImage/4290/create-new-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4290/create-...
The wizard created a default fileset, that determines what project files shall be included in the war. We'll replace it by a fileset that includes all files within the *war* directory. This is the location the google plugins compile and package the code to.
http://community.jboss.org/servlet/JiveServlet/showImage/4291/create-new-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4291/create-...
Your war archive shows up in the *Project archives* as soon you hit *finish*.
http://community.jboss.org/servlet/JiveServlet/showImage/4292/create-new-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4292/create-...
h1. Build and publish your war
We now need to publish the War to the JBoss instance. Choose the appropriate entry in the context-menu of your war-archive and hit *Edit publish settings*.
http://community.jboss.org/servlet/JiveServlet/showImage/4293/adjust-war-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4293/adjust-...
JBoss Developer Studio comes with a preconfigured server named jboss-eap. You therefore already get that server in the list of the available servers.
If you use plain JBoss Tools you would need to setup the server manually.
Select the server and choose to publish to it in the way that fits your needs:
http://community.jboss.org/servlet/JiveServlet/showImage/4294/adjust-war-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4294/adjust-...
Your war now's assiociated to your server and will be published to it if your GWT project's been built. The *Servers* view show you the state of the publishing:
http://community.jboss.org/servlet/JiveServlet/showImage/4295/war-on-serv... http://community.jboss.org/servlet/JiveServlet/downloadImage/4295/war-on-...
h2. Cross compile
GWT allows you to write your client code in (almost) plain java instead of funky javascript. GWT ships a cross compiler that generates javascript out of your java classes. You need to start that cross compiler so that the client codes gets into your war. (We show later how you can use the hosted mode too with JBoss)
http://community.jboss.org/servlet/JiveServlet/showImage/4319/cross-compi... http://community.jboss.org/servlet/JiveServlet/downloadImage/4319/cross-c...
The Google cross compiler will inform you in the console view whether's he succeeded in his job. Check the output and wait until it terminated its compilation task.
h2. *Launch your Browser*
The project archive we created was deployed to the base url *gwt-jboss*. The jBoss server that's included in the JBoss developer studio is configured (by default) to run on port *8080*. Your application's therefore accessible at the url:
**
> http://127.0.0.1:8080/gwt-jboss/Gwt_jboss.html http://127.0.0.1:8080/gwt-jboss/Gwt_jboss.html
*http://community.jboss.org/servlet/JiveServlet/showImage/4317/browser.png http://community.jboss.org/servlet/JiveServlet/downloadImage/4317/browser...
h2. Speed up my development cycle!
The approach we've choosen so far uses an extra cross compile step to deploy the application after each change. That's very reliable but it gets tedious at development time. Google delivers a so called hosted mode. Its major benefit is that your java classes dont get cross-compiled but interpreted to javascript at runtime. Changing, testing, changing, testing etc. gets much faster and pleasant, the cross-compilation step's not needed any more. You need a browser plugin, a slightly different url for your application and a google runtime to achieve that.
h2.
h2. Launch Google
If you start this launch configuration you wont have to cross compile your java client classes to javascript. It will get interpreted by the google browser plugin. On the other hand the browser plugin needs access to your java classes. The google runtime you just launched allows it to get your java code. The url parameter you add when you access your application tells the plugin at what host and port the hosted mode runs.
Create a *Web Application* launch configuration for that matter.
http://community.jboss.org/servlet/JiveServlet/showImage/4296/new-run-con... http://community.jboss.org/servlet/JiveServlet/downloadImage/4296/new-run...
We want to use our JBoss instance, we therefore disable the embedded jetty that's provided by the GWT plugins.
http://community.jboss.org/servlet/JiveServlet/showImage/4297/new-run-con... http://community.jboss.org/servlet/JiveServlet/downloadImage/4297/new-run...
Now that we want not to cross-compile on each change, we'll need to tell the google browser-plugin where to fetch the code from. We do that by adding an url parameter:
**
> http://127.0.0.1:8080/gwt-jboss/Gwt_jboss.html http://127.0.0.1:8080/gwt-jboss/Gwt_jboss.html*?gwt.codesvr=127.0.0.1:9997*
To convince yourself that there's no cross compilation needed any more, go to the client-package and change any java class that's in there. You may for instance change the label of a button and reload your browser (without launching the google cross-compiler).
http://community.jboss.org/servlet/JiveServlet/showImage/4311/button-labe... http://community.jboss.org/servlet/JiveServlet/downloadImage/4311/button-...
http://community.jboss.org/servlet/JiveServlet/showImage/4312/button-labe... http://community.jboss.org/servlet/JiveServlet/downloadImage/4312/button-...
h1. Conclusion
There you go, now you can use JBoss Tools and JBoss Developer Studio together with Google GWT plugin to do full deployment (with Cross Compile) or development mode via the hosted mode option.
All enabled by utilizing the Project Archives view.
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-15593]
Create a new document in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
14 years, 4 months
[EJB 3.0] - Problem running ejb3 tutorial examples
by eivind hognestad
eivind hognestad [http://community.jboss.org/people/ehognestad] created the discussion
"Problem running ejb3 tutorial examples"
To view the discussion, visit: http://community.jboss.org/message/552753#552753
--------------------------------------------------------------
Hi guys.
I have just downloaded jboss5 and maven 2.0.9 and I'm trying to run the stateless example. It fails with this error:
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Could not deploy D:\development\tutorials\ejb3\source\stateless\target\jboss-ejb3-tutorial-stateless.jar
no protocol: and
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Could not deploy D:\development\tutorials\ejb3\source\stateless\target\jboss-ejb3-tutorial-stateless.jar
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
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:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Could not deploy D:\development\tutorials\ejb3\source\stateless\target\jboss-ejb3-tutorial-stateless.jar
at org.jboss.maven.plugins.as.control.mojo.JbossAsControlDeployMojo.execute(JbossAsControlDeployMojo.java:95)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
... 16 more
Caused by: javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.net.MalformedURLException: no protocol: and]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:782)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org.jboss.jbossas.servermanager.Server.getServerConnection(Server.java:646)
at org.jboss.jbossas.servermanager.Server.invoke(Server.java:861)
at org.jboss.jbossas.servermanager.Server.deploy(Server.java:808)
at org.jboss.maven.plugins.as.control.mojo.JbossAsControlDeployMojo.execute(JbossAsControlDeployMojo.java:90)
... 18 more
Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.net.MalformedURLException: no protocol: and
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
... 24 more
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.net.MalformedURLException: no protocol: and
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.net.MalformedURLException: no protocol: and
at java.net.URL.<init>(URL.java:567)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:91)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1544)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at javax.naming.CompoundName.readObject(CompoundName.java:554)
at sun.reflect.GeneratedMethodAccessor263.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
... 6 more
[INFO] ------------------------------------------------------------------------
I have followed the tutorial instructions, and I am not able to find where the error might be.
Anyone else experienced this problem?
Best regards,
Eivind
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/552753#552753]
Start a new discussion in EJB 3.0 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 4 months
[JBoss Tools] - Use JBoss Tools with Google GWT Plugin
by Andre Dietishei
Andre Dietishei [http://community.jboss.org/people/adietish] modified the document:
"Use JBoss Tools with Google GWT Plugin"
To view the document, visit: http://community.jboss.org/docs/DOC-15593
--------------------------------------------------------------
h1. A few simple steps to have GWT running on JBoss
If you develop web applications with GWT you most likely end up using Eclipse and the Google Plugins for Eclipse. These Plugins offer to run your application on a jetty instance. If you want to use JBoss instead, you'll have to define a war project archive and make sure it gets published to the JBoss instance of your choice. This article shows you the simple steps you'll have to take to achieve this.
h1. Premise
The google web toolkit, GWT is a pretty nice framework to develop web applications. Google even delivers a plugin for Eclipse so that developing with GWT is a very pleasant experience. The GWT plugin uses an embedded jetty to run the application that you develop. The authors unfortunately did not use standard connectors. So if you want to use Jboss instead of jetty the approach to take is not as intuitive as it could be. This article shall show you how what steps to take so that you can run develop your GWT application while running on JBoss.
h1. Solution
Either you already have a project or you want to start from scratch. So that the howto here's complete, we'll show you the step to create a new GWT project, too.
h2. Install Google Plugin for Eclipse
Install the Google plugin for Eclipse in your JBDS by adding the following update site:
> http://dl.google.com/eclipse/plugin/3.5 http://dl.google.com/eclipse/plugin/3.5
Choose and install the Google Plugin for Eclilpse among the availble ones.
http://community.jboss.org/servlet/JiveServlet/showImage/4313/install-gwt... http://community.jboss.org/servlet/JiveServlet/downloadImage/4313/install...
h2. Create a Web Application Project
In order to get the support you need for GWT projects, you'll need to create a new *Web Application Project*. You may do so with the toolbar or with entries in the file menu.
http://community.jboss.org/servlet/JiveServlet/showImage/4286/create-web-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4286/create-...
We will call it
> *gwt-jboss*.
http://community.jboss.org/servlet/JiveServlet/showImage/4318/new-wizard-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4318/new-wiz...
h2. Create a new Project WAR
We'll work with a JBoss application server instead of the embedded jetty that's provided with the google plugins. We therefore need to provide JBoss with a *War Archive* that bundles your project resources. The JBDS *Project archives* view allows you to do so. Select your GWT project and go to the *Project archives* view. You can now define a new war archive.
http://community.jboss.org/servlet/JiveServlet/showImage/4289/create-new-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4289/create-...
The wizard that pops up allows you pick an archive name, the path at which it'll be created and the type (packed or unpacked). Choose the settings that fit your needs.
http://community.jboss.org/servlet/JiveServlet/showImage/4290/create-new-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4290/create-...
The wizard created a default fileset, that determines what project files shall be included in the war. We'll replace it by a fileset that includes all files within the *war directory*. This is the location the google plugins compile and package the code to.
http://community.jboss.org/servlet/JiveServlet/showImage/4291/create-new-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4291/create-...
Your war archive shows up in the *Project archives* soon as you hit *finish*.
http://community.jboss.org/servlet/JiveServlet/showImage/4292/create-new-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4292/create-...
h1. Build and publish your war
We now have to make sure the war gets published to our JBoss instance. Choose the appropriate entry in the context-menu of your war-archive and hit *Edit publish settings*.
http://community.jboss.org/servlet/JiveServlet/showImage/4293/adjust-war-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4293/adjust-...
The developer studio comes with a preconfigured jboss-eap. You therefore already get that server in the list of the available servers. Select it and choose to publish to it in the way that fits your needs:
http://community.jboss.org/servlet/JiveServlet/showImage/4294/adjust-war-... http://community.jboss.org/servlet/JiveServlet/downloadImage/4294/adjust-...
Your war now's assiociated to your server and will be published to it if your GWT project's been built. The *Servers* view show you that:
http://community.jboss.org/servlet/JiveServlet/showImage/4295/war-on-serv... http://community.jboss.org/servlet/JiveServlet/downloadImage/4295/war-on-...
h2. Cross compile
GWT allows you to write your client code in (almost) plain java instead of funky javascript. GWT ships a cross compiler that generates javascript out of your java classes. You need to start that cross compiler so that the client codes gets into your war.
http://community.jboss.org/servlet/JiveServlet/showImage/4319/cross-compi... http://community.jboss.org/servlet/JiveServlet/downloadImage/4319/cross-c...
The Google cross compiler will inform you in the console view whether's he succeeded in his job. Check the output and wait until it terminated its compilation task.
Now you're almost done, the archive has all it needs. *B**uild* and *publish* your war.
http://community.jboss.org/servlet/JiveServlet/showImage/4298/build-archi... http://community.jboss.org/servlet/JiveServlet/downloadImage/4298/build-a...
http://community.jboss.org/servlet/JiveServlet/showImage/4299/publish-arc... http://community.jboss.org/servlet/JiveServlet/downloadImage/4299/publish...
h2. *Launch your Browser*
The project archive we created was deployed to the base url *gwt-jboss*. The jBoss server that's included in the JBoss developer studio is configured (by default) to run on port *8080*. Your application's therefore accessible at the url:
**
> http://127.0.0.1:8080/gwt-jboss/Gwt_jboss.html http://127.0.0.1:8080/gwt-jboss/Gwt_jboss.html
*http://community.jboss.org/servlet/JiveServlet/showImage/4317/browser.png http://community.jboss.org/servlet/JiveServlet/downloadImage/4317/browser...
h2. Speed up my development cycle!
The approach we've choosen so far uses an extra step to deploy the application after each change. That's very reliable but it get tedious at development time. Google delivers a so called hosted mode. Its major benefit is that your java classes dont get cross-compiled but interpreted to javascript at runtime. Changing, testing, changing, testing etc. gets much faster and pleasant, the cross-compilation step's not needed any more. You need a browser plugin, a slightly different url for your application and a google runtime to achieve that.
h2.
h2. Launch Google
If you start this launch configuration you wont have to cross compile your java client classes to javascript. It will get interpreted by the google browser plugin. On the other hand the browser plugin needs access to your java classes. The google runtime you just launched allows it to get your java code. The url parameter you add when you access your application tells the plugin at what ip and port he may get served.
Create a *Web Application* launch configuration for that matter.
http://community.jboss.org/servlet/JiveServlet/showImage/4296/new-run-con... http://community.jboss.org/servlet/JiveServlet/downloadImage/4296/new-run...
We want to use our JBoss instance, we therefore disable the embedded jetty that's provided by the GWT plugins.
http://community.jboss.org/servlet/JiveServlet/showImage/4297/new-run-con... http://community.jboss.org/servlet/JiveServlet/downloadImage/4297/new-run...
Now that we want not to cross-compile on each change, we'll need to tell the google browser-plugin where to fetch the code from. We do that by adding an url parameter:
**
> http://127.0.0.1:8080/gwt-jboss/Gwt_jboss.html http://127.0.0.1:8080/gwt-jboss/Gwt_jboss.html*?gwt.codesvr=127.0.0.1:9997*
Convince yourself that there's no cross compilation needed any more. Go to the client-package and chage any java directive that's in there. You may for instance change the label of a button and reload your browser (without launching the google cross-compiler).
http://community.jboss.org/servlet/JiveServlet/showImage/4311/button-labe... http://community.jboss.org/servlet/JiveServlet/downloadImage/4311/button-...
http://community.jboss.org/servlet/JiveServlet/showImage/4312/button-labe... http://community.jboss.org/servlet/JiveServlet/downloadImage/4312/button-...
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-15593]
Create a new document in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
14 years, 4 months