I am trying to use JRebel and having problem while publishing the files like xhtml under src/main/webapp folder. I can do hot replacement of classes, it is working.
I am using Eclipse Helios, Tomcat 7 and JRebel Eclipse plug-in. Also i am using WTP.
I checked the tmp0\wtpwebapps\myapp-web directory. rebel.xml exists at WEB-INF/classes folder. So it should be ok.
Here is my rebel.xml
<classpath>
<dir name="C:/Users/user/workspace/myapp/myapp-web/target/test-classes">
</dir>
<dir name="C:/Users/user/workspace/myapp/myapp-web/target/classes">
</dir>
</classpath>
<web>
<link target="/">
<dir name="C:/Users/user/workspace/myapp/myapp-web/src/main/webapp">
</dir>
</link>
</web>
I tried a lot but could not understand why JRebel does not hot deploy webapp folder. I could not find anything useful at jrebel.log file.
First of all, remote the test-classes folder from rebel.xml classpath definition - you may have strage effects with that one.
When the application server starts, do you see JRebel: the directory 'blah' is being monitored" messages at the console?
Send the jrebel.log to support - they will help. It can be some minor version difference of the Tomcat instance.
Related
As specified in the gwt maven mojo plugin documentation, I have selected src/main/webapp folder as my war directory in eclipse->project properties->Google->Web application. Then, when I tried to run my gwt project in dev mode from eclipse, the html files in webapp folder was getting deleted. After some investigation, I was able to fix this by modifiying -war value in run configuration to the target folder of the project. But the problem I am facing now is that, after running the project in dev mode, I have to manually copy the html files to the target directory each time for the dev mode to work. Can anyone please help me to identify what I am missing here. How can I set the webapp folder as war directory and prevent the files from getting deleted? Please help.
The correct way to configure the Google Plugin for Eclipse (using M2Eclipse) and run DevMode is explained in the FAQ: http://web.archive.org/web/20130619170526/https://developers.google.com/eclipse/docs/faq#gwt_with_maven
May be you have to set the copyWebapp parameter to true?
<configuration>
<style>PRETTY</style>
<strict>true</strict>
<runTarget>index.html</runTarget>
...
<copyWebapp>true</copyWebapp>
</configuration>
Our .pom uses this:
<properties>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<gwt.war.directory>${project.build.directory}/war</gwt.war.directory>
</properties>
In the Arguments tab of the debug configuration we use:
-remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -startupUrl appname.jsp -logLevel INFO -port 8888 -codeServerPort 9997 -war
"${workspace_loc:appname/target/war}" com.yourcompany.app
Seems to work without the problem you are having.
I am not sure if this is a problem faced only by me, but even after following the steps specified in the maven plugin configuration the issue had occurred to me randomly. But nowadays its not happening and this is what I did differently.
Use the gwt only in eclipse java perspective, not in j2ee perspective.
In eclipse->project properties->Google->Web application, check the Launch and deploy from this directory option.
I was caught out by this too. If you put your static files for the webapp into the "src/main/webapp" folder, they will be copied over to the target folder if the tickbox in Settings->Web Application is unchecked (as it would be by default if it's an M2eclipse project).
I set my target folder to be the "war" folder on the project and ignored it in version control.
I'm using Eclipse WTP plugin for my java web project. I am deploying project via Servers view. Now, I'd like to know whether it is possible to specify name of the deploy folder, by default all files are being placed into a folder that has same name as project has. Is this configurable? Can this be done without modifying project name?
For instance: I have project name in Eclipse MyCompanyProject and when it is being deployed, I get folder with binaries and other resources in webapps\MyCompanyProject. But I'd like to have it deployed to webapps\projectA
Okay, file org.eclipse.wst.common.component should be modified in order to achieve that.
Lines:
<wb-module deploy-name="projectA">
...
<property name="context-root" value="projectA"/>
This change will be reflected inside server.xml:
<Context docBase="MyCompanyProject" path="/projectA" reloadable="true"/>
Resolved...
I have apache-tomcat-7.0.16 and jdk1.6.0.25 on my window xp server. I install eclipse and copy the programer of stockwatcher from google site. I compile the program and run under eclipse development mode it is running fine. The eclipse create the war folder i copy this war folder under apache-tomcat-7.0.16/webapps.. then i check my tomcat server by enter http://localhost:8080: it is working and run example of servlet of tomcat as well. Then i enter the http://localhost:8080/war/stockwatcher.html. It give some java error. Then is move and copy again now give the error page not found.
Content of the war folder is
images
stockwatcher
web-inf
stockwatcher.css
stockwatcher.html
i think i copy the file on wrong location or i have to configure the tomcat
What is this java error you speak of?
Are you sure GWT libs are located inside WEB-INF/lib folder? Those are required for the GWT-RPC mechanism to operate.
Please visit the following sites for reference:
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/3408c38464c57d4a?pli=1
GWT app - deploying on Tomcat or any other servlet container
do not use that war folder to deploy a gwt application to tomcat. it will not work. the procedure is:
1) gwt Compile the project first.
2) create a webbuilder.xml file and put the code under in it.
<project name="ExceptionReport" basedir="." default="default">
<target name="default" depends="buildwar,deploy"></target>
<target name="buildwar">
<war basedir="war" destfile="
ExceptionReport.war" webxml="war/WEB-INF/web.xml">
<exclude name="WEB-INF/**" />
<webinf dir="war/WEB-INF/">
<include name="**/*.jar" />
</webinf>
</war>
</target>
<target name="deploy">
<copy file="ExceptionReport.war" todir="." />
</target>
</project>
ExceptionReportis my project name.
3) export the src folder as JAR file and save it in war>webinf>lib.
4) right click on web builder file and choose ant build option. it will generate a war file in your project.
5) put that war file on tomcat. and restart yout tomcat.
I've got a GWT 1.6 project in Eclipse 3.4 and am trying to reference source from another (non-GWT) project in my workspace. I've added the project to my build path, but I can't run the application in hosted mode. When I do, I get a "no source code is available" error.
I've done some searching and reading and have tried a few things that others have suggested (including creating a jar from the dependent project and linking to it), but frankly nothing has worked.
If you're actually doing this, could you please help me out with a simple step-by-step setup? I'd really appreciate it, thanks!
I have 2 Eclipse Projects. One is gwt project and one is not. Here's the directory structure that works for me:
workspace
-- gwt-project
-- src/main/java
-- com.gwt.GwtProjectModule
-- GwtProjectModule.gwt.xml
-- non-gwt-project
-- src/main/java
-- com.nongwt.package.that.contains.source.you.need
-- nongwt.gwt.xml
-- com.nongwt.package.that.contains.source.you.need.client
nongwt.gwt.xml tells gwt to look inside "client" package, here's what it looks like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='nongwt'>
<inherits name='com.google.gwt.user.User' />
<source path="client" />
</module>
GwtProjectModule.gwt.xml can then inherit source code from nongwt. Here's the relevant line from inside GwtProjectModule.gwt.xml:
<inherits name="com.nongwt.package.that.contains.source.you.need.nongwt" />
Make sure you include non-gwt-project inside gwt-project's classpath in eclipse. It's the normal drill; right click on gwt-project, choose properties, choose "Java Build Path", click "Projects" tab, and "non-gwt-project"
Or, instead of including non-gwt-project in gwt-project's classpath as a project reference, you can also jar the contents of non-gwt--project, ensure that you include the source in the jar, and then include the jar in gwt-project's classpath.
Good Luck!
I know this post is quite old but as I spent quite a lot of time on this issue and finally found the way to do it, I thought I might share the answer :
once you've created your launch configuration, open it run>run configurations...
go to classpath tab and select user entries. add advanced>folder and select the source folder of your other module project. If as me you've separated the module conf file in a src/main/resources folder you have to add it as well.
should work.
The client-side code in your GWT project (the classes under the client package) can't reference any classes that aren't in a GWT module.
If you've got code in another project that you want to reference from client code in your GWT project, you need to:
Make sure it's all "GWT safe", which means it doesn't reference any JRE classes that aren't emulated by GWT (http://code.google.com/webtoolkit/doc/1.6/RefJreEmulation.html), or reference any classes that reference JRE classes not emulated
Make sure all referenced classes are within a GWT module. This means putting a MyOtherProject.gwt.xml file in your other project, and all the referenced classes must be under a client subpackage
Make your GWT project inherit from the other project. So add the following to your GWT project's gwt.xml module file:
<inherits name='com.yourCompany.otherProject.MyOtherProject' />
Boden: add the following to your module file
<source path=""></source>
in addition to your other sources, eg:
<source path=""></source>
<source path="com.acme.otherpackage"></source>
then the compiler won't complain.
Atleast that's how I solved it. Not sure if using path="" allows inclusion of everything, I'm assuming it's the default value when no sources are specified.
This is a fantastic solution of your problem proposed by Sven Buschbeck (must a norwegian, lol!), worked for me!
When working on several large scale projects (in Eclipse), it’s convenient and of course more efficient to share and reuse code via common libraries. While those are in an early stage they need to be changed a lot and therefore it’s handy to link projects in instead of creating new jars each time the library has been updated.
Unfortunately, this standard approach for Java development in Eclipse does not work that straight forward as with plain old Java projects, it requires three steps in total:
Link the library project to all relevant projects (“Project
Preferences” -> “Java Build Path” -> “Projects” -> “Add…”)
Then, add the client-side code of the library (by adding it as a
module.) Therefore, edit the gwt.xml of your application and add
for example
where SuperLib is the file name of the gwt.xml file in you library
project and before that is the package it lies in.
Add the code to the project by linking a source folder.
Unfortunately, this is required if you do not want to write an Ant
script to compile your application. (If you prefer Ant check
this out) I don’t like the idea of using such a script because if
you forget to run it each time you make changes, you will end up in
confusion—let’s go for the convenient, automatic way then.
Add a folder to your application project; open the “advanced” section in the folder creation dialog, select “Link to alternate location” and pick the source folder (usually “src”) of your library project. (Hint: if you work within a team using a versioning system, you can create a variable for that folder and use this instead. This way, each of your colleagues can put the library project in a different folder and accommodate for that by adjusting the variable :) )
Right click the folder, “Build Path” -> “Use as Source Folder”. Done.
Surprisingly, the GWT plugin for Eclipse does not honor the project linking, thus all the references need to be made explicit or you will end up with lots of the following: ClassNotFoundException.
GWT doesn't know about that other code because it is not in the client directory of your project. You need to add the source path for the other code to the .gwt.xml file. Just added it to the xml as follows
<source path="common" />
common is the directory where the extra code is for this example.
Check out the XML Element Reference section of this doc
In your gwt project, go to properties, Java build path, source, click "link source" and point to your non-gwt project source package that you wish to include.
Edit: Found a eclipse fix. Run config > Classpath > Advanced > Add folder > otherproject/src .
Reason: Eclipse adds the bin folders of exported projects. GWT needs the src folders.
Elaborating on my comment.
I am using gwt 2.8 on Eclipse Neon, Java 1.8.0_92. Referring to another project in eclipse fails to launch devmode, because it cannot find the source for referred files from the other project.
What worked:
Switched to 'ant devmode' completely. Made the following changes to build.xml:
<target name="gwtc" ...>
<java ...>
<classpath>
<pathelement location="src"/>
<pathelement location="../otherproject/src"/><!-- Added -->
...
...
<target name="devmode" ...>
<java ...>
<classpath>
<pathelement location="src"/>
<pathelement location="../otherproject/src"/><!-- Added -->
Now do a production build with 'ant' or start devmode with 'ant devmode'.
Other things I noticed
Using the method in the accepted answer, otherproject/src/foo.gwt.xml is picked up (complains if not available), and static values from classes are picked up. Nothing else is. Very weird.
I understand that the DevMode/gwtc executables pick up sources from their class path. So all that is needed is for eclipse to add referred projects to their class path. I was not able to achieve this but this seems possible. FIXED see top.
I am running JBoss 4.3 on Ubuntu under /usr/local/jboss-4.3/. I have deployed my application as a WAR file i.e. myapp.war, to /usr/local/jboss-4.3/server/myserver/deploy. However, there doesn't seem to be an 'exploded' /myapp directory under the deploy folder, how come?
I am used to Tomcat running on Windows so I am a bit new to JBoss. When you deply WAR to Tomcat, the physical contents of this WAR will be exploded to a /myapp directory. With this it is then possible to modify files under the web app, such as config settings etc.
How can I do this in JBoss?
You can unzip your .war contents in a "myapp.war" folder, which JBoss will consider a deployed application just as if it was a zipped war.
Even better, most IDEs (Eclipse for sure, but i guess other IDEs such as Netbeans) allow you to deploy the exploded package instead of the zipped .war, allowing you to change just the single files you modify instead of the whole .war package
This link can be useful:
http://community.jboss.org/wiki/DeployTipsAndBuildSampleScripts
Quick Summary of what the article concerns: When it comes application builds/deployments in JBoss, there are a plethora of viable approaches. This wiki highlights several build/deploy scenerios, along with steps and pertinent build script samples. The following approaches are covered:
Point/click deployment using JBossIDE - For users that don't like ANT build scripts
Exploded EAR, JAR, SAR, WAR deployment (Option 1) - Maximize development productivity by eliminating ANT copy tasks
Exploded EAR, JAR, SAR, WAR deployment (Option 2) - Separate IDE from the compile, build and deploy process
Normal EAR, JAR, SAR, WAR deployment - Deploy a zipped archive (Necessary when using Clustering/Farm Deployment
Same problem facing, when I export as .war file from Eclipse and copy it into (UAT or Prod) JBOSS Server 7.1.1 Final AS deployement directory, And Start Windows JBOSS Service
.war file deployed sucessfully but .war file not unpacked or exploded into deployment folder.
For This solution is copy example.war exploded folder (name of folder) into deployment folder and then start. And mentions auto-deploye-exploded=true in standalon.xml
it does this in a tmp folder......
but you can explode the file in the deploy directoy just name it "app.war"
I had exactly the same problem with JBoss 7. My ant script would copy the .war file to the JBoss deployments folder (jboss-as-7.1.1.Final/standalone/deployments in my system) but the .war wouldn't explode. The .war was perfectly deployable through the administration CLI so it wasn't an unsatisfied dependency or anything. It was solved when I instructed my Ant war task to not compress the war (set the property compress to false) as in:
...
<target name="war" depends="build">
<mkdir dir="${build.dir}"/>
<war
compress="false"
needxmlfile="false"
basedir="${webroot.dir}"
warfile="${build.dir}/${project.distname}.war">
<exclude name="WEB-INF/${build.dir}/**"/>
<exclude name="WEB-INF/src/**"/>
</war>
</target>
In the standalone.xml I do see only this part of the code:
<subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
I do not see the deployment-scanner parameters like:
auto-deploy-exploded" => false,
"auto-deploy-zipped" => true,
"deployment-timeout" => 60L,
and so on.