Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » can't seem to move from myeclipse to WTP???
can't seem to move from myeclipse to WTP??? [message #485233] Thu, 10 September 2009 21:05 Go to next message
Dean Hiller is currently offline Dean HillerFriend
Messages: 46
Registered: July 2009
Member
We have a seam project and currently love that server view they have where
we can deploy our application and debug it, and it hot swaps code changes
and xhtml changes(annotation changes and pages.xml file changes don't work
and require a restart but that is alright considering the other two work).

Our directory structure is so...

project
---input
------javasrc - our src code (gets put in WEB-INF/classes)
------libinclude - jsf libs, libs we need, seam libs
- basically everything that gets put in WEB-INF/lib
------libexclude - jars we don't deploy like servlet-api.jar
------webroot - all our xhtml files
---------WEB-INF - the web-inf stuff excluding classes and libs
---output - our generation directory

We would LOVE to setup WTP so it does not generate anything in input dir
on down and only uses output if that is even needed. Currently we use
myeclipse and it basicaly deploys our app to tomcat moving the above files
into the correct places. Is there a way to do this with WTP and use the
server view to start the server and debug our seam app(keeping xhtml hot
deploy and class file hot deploy intact)???

thanks for any help on this!!!
thanks,
Dean
Re: can't seem to move from myeclipse to WTP??? [message #485244 is a reply to message #485233] Thu, 10 September 2009 22:21 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
This is definitely possible. You have full control over web content directory, java source directory and all the output directories.

To get started, make sure that you've specified web content and java source directories correctly on project creation. Alternatively, you can manipulate all of these settings in project properties.

- Konstantin
changing project to dynamic web project fails miserbly??? [message #485391 is a reply to message #485244] Fri, 11 September 2009 15:19 Go to previous messageGo to next message
Dean Hiller is currently offline Dean HillerFriend
Messages: 46
Registered: July 2009
Member
I just downloaded the latest eclipse EE two days ago. I check out my seam
project from CVS(with no .project or .classpath files). I look for
convert to dynamic web project but I don't see that in the list when I
right click on project. How does one convert a project to a dynamic web
project?

I could have sworn I managed to do this two days ago(hmmm, maybe that was
with jboss tools that I could do it). The configure submenu only has
convert to JPA and convert to plugin projects :(.

How does one mount an existing dynamic web project?

Here is my second try with a workaround that also doesn't work but gets
farther.......
1. checkout and then delete the project from eclipse(but not delete source
off drive)
2. now, create a new dynamic web project and uncheck Use default for
directory and choose the directory I just checked out
3. as I go, choose /input/javasrc, input/webroot, uncheck generate
web.xml, click finish
4. Now add my EJB3 project as a dependency(ie. we add the project so we
can change code and it will hot deploy)...hmmm, does that work in WTP if
you have a subproject of a war project, will it get deployed to tomcat and
do hot swap of code like MyEclipse does? It appears not to work.
RESULT: There was no choice for where it should get my jar files from????
and now my project does not compile.

5. I try to go to build path and there is this Web App Libraries thing but
I can't seem to add jars to that at all.

Any ideas how to get this to work?

thanks,
Dean
Re: changing project to dynamic web project fails miserbly??? [message #485427 is a reply to message #485391] Fri, 11 September 2009 17:19 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Dean Hiller wrote:
> I just downloaded the latest eclipse EE two days ago. I check out my
> seam project from CVS(with no .project or .classpath files). I look for
> convert to dynamic web project but I don't see that in the list when I
> right click on project. How does one convert a project to a dynamic web
> project?
>
> I could have sworn I managed to do this two days ago(hmmm, maybe that
> was with jboss tools that I could do it). The configure submenu only
> has convert to JPA and convert to plugin projects :(.
>
> How does one mount an existing dynamic web project?
>
> Here is my second try with a workaround that also doesn't work but gets
> farther.......
> 1. checkout and then delete the project from eclipse(but not delete
> source off drive)
> 2. now, create a new dynamic web project and uncheck Use default for
> directory and choose the directory I just checked out
> 3. as I go, choose /input/javasrc, input/webroot, uncheck generate
> web.xml, click finish

Dynamic Web Projects have a certain "structure". The "structure" of
other "web" type projects can be so varied that it's not practical to
automate conversion in general. It is much more practical for plug-ins
that support a particular build framework, such as maven, to implement
this conversion since the "structure" of the original project is well
known. If what you have is a general "web" type project, then what you
have done seems reasonable.

> 4. Now add my EJB3 project as a dependency(ie. we add the project so we
> can change code and it will hot deploy)...hmmm, does that work in WTP if
> you have a subproject of a war project, will it get deployed to tomcat
> and do hot swap of code like MyEclipse does? It appears not to work.

In WTP, adding a Java project as a dependency of a Dynamic Web Project
implies building that Java project into a jar and including that jar in
the webapp's WEB-INF/lib. This won't work with hot code replacement.
However, the WTP Tomcat supports an option to "Server modules without
publishing". Double-click the server in the Servers view and enable
this option in the Server Options section. This "installs" a custom
classloader in Tomcat that would allow the classes in the Java project
to be accessed directly, without being built into a jar.

> RESULT: There was no choice for where it should get my jar files
> from???? and now my project does not compile.
>
> 5. I try to go to build path and there is this Web App Libraries thing
> but I can't seem to add jars to that at all.

Use the Java EE Module Dependencies page to manage such jars. What you
configure there will often appear under the Web App Libraries. Web App
Libraries isn't something you interact with directly in the Java Build
Path properties page. The Web App Libraries would also automatically
pickup any jar under "input/webroot/WEB-INF/lib", if such a folder existed.

Cheers,
Larry

> Any ideas how to get this to work?
>
> thanks,
> Dean
>
>
Re: changing project to dynamic web project fails miserbly??? [message #485452 is a reply to message #485427] Fri, 11 September 2009 18:45 Go to previous messageGo to next message
Dean Hiller is currently offline Dean HillerFriend
Messages: 46
Registered: July 2009
Member
wow! that was my missing link on the web app libs thing!! thanks!!!

Now, I just can't seem to get my EJB3 project that the war project depends
on to be in the classpath for some reason. I checked the xcore3 project
on the J2EE Module Depend window, but it is still not getting included.
Usually this is so automatic on straight java projects...I must be missing
one more simple step???

Also, very strangely, I don't see the web app in tomcat/webapps like
MyEclipse would do. Where does it put the web app files? That has been a
great MyEclipse feature as I could go look and figure stuff out and see
what files were missing from the final deployment. Where is the webapp
assembled to so I can view it? Sometimes there is a file missing or
whatnot and just looking at the structure tells me my bug right away.

thanks much,
Dean
Re: changing project to dynamic web project fails miserbly??? [message #485464 is a reply to message #485452] Fri, 11 September 2009 19:49 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Dean Hiller wrote:
> wow! that was my missing link on the web app libs thing!! thanks!!!
>
> Now, I just can't seem to get my EJB3 project that the war project
> depends on to be in the classpath for some reason. I checked the xcore3
> project on the J2EE Module Depend window, but it is still not getting
> included. Usually this is so automatic on straight java projects...I
> must be missing one more simple step???

Adding a Java project as a dependency of a Dynamic Web Project will
convert the Java project to a WTP type project, i.e. one that contains a
"module". The Java project should now contain a "components" file like
the Dynamic Web Project. You might check that file to make sure it's
pulling from the correct Java source directories. In this case the
deploy-path is relative to the implied jar that will contain the
project's classes.

>
> Also, very strangely, I don't see the web app in tomcat/webapps like
> MyEclipse would do.

When creating a new Tomcat server, the default is to create a separate
Tomcat instance, i.e. catalina.base != catalina.home. In addition, the
default is to deploy to "wtpwebapps" to avoid various auto-deployment
issues. For details about the WTP Tomcat support, see the Tomcat FAQ:

http://wiki.eclipse.org/WTP_Tomcat_FAQ

Cheers,
Larry

> Where does it put the web app files? That has been
> a great MyEclipse feature as I could go look and figure stuff out and
> see what files were missing from the final deployment. Where is the
> webapp assembled to so I can view it? Sometimes there is a file missing
> or whatnot and just looking at the structure tells me my bug right away.
>
> thanks much, Dean
>
Re: changing project to dynamic web project fails miserbly??? [message #485469 is a reply to message #485464] Fri, 11 September 2009 20:55 Go to previous messageGo to next message
Dean Hiller is currently offline Dean HillerFriend
Messages: 46
Registered: July 2009
Member
yes, that file does exist....

<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="xcore3">
<wb-resource deploy-path="/" source-path="/"/>
<wb-resource deploy-path="/" source-path="/input/javasrc"/>
</wb-module>
</project-modules>

and the source path is correct..not sure why there is two source paths
though. Not sure why this is not working.

I look at the tomcat folders that were created and in the config files, I
see
<!-- Define the default virtual host
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host appBase="webapps" autoDeploy="true" name="localhost"
unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">

which is saying webapps but I can't find this nor the wtpwebapps folder.
I then do a search on my harddrive and found this...

D:\AAROOT\areas\voicelog5\.metadata\.plugins\org.eclipse.wst .server.core\tmp0\wtpwebapps

but there is nothing in there but ROOT/WEB-INF/web.xml. No other files
exist.

I guess I will try to start from scratch again and see if that helps but
not sure why I don't see anything deployed yet it is finding all the
web-app libs and just not my EJB3's project's classes.

If you see anything above that doesn't look right though, let me know.

thanks,
Dean
Re: changing project to dynamic web project fails miserbly??? [message #485478 is a reply to message #485469] Fri, 11 September 2009 21:19 Go to previous messageGo to next message
Dean Hiller is currently offline Dean HillerFriend
Messages: 46
Registered: July 2009
Member
oh, hmmm, not so good.... I deleted and redownloaded from cvs my EJB3
project and noticed it already had a .settings folder....I then deleted
that folder and .project and .classpath and mounted it with eclipse as a
normal java project. Then in my onlineReporting project, I added xcore3
as a dependency to J2EE Module Depends and there is no .settings created
in xcore3. It did "not" change my project to a WTP project....any ideas
why this doesn't work for me?

Is there a way to manually create it as a WTP project?

ps. Should I file a bug on the usability of this? I mean it took my 2
hours or so to setup myeclipse and it was tough to setup(I admit that and
maybe I was lucky), but I have spent 2 days fiddling with WTP and trying
to get it setup and have still not succeeded. it is not that
intuitive...the wizard should help alot more than it does I think. I am
beginning to think it may not be possible still(I tried to set it up 6
months ago and failed then too).

sorry, I am just used to our company culture...if it takes anyone a long
time to do something with our software, we write a bug report and mark it
as a usability bug to either add help, or add a better wizard, etc. etc.
Re: changing project to dynamic web project fails miserbly??? [message #485485 is a reply to message #485478] Fri, 11 September 2009 22:18 Go to previous messageGo to next message
Dean Hiller is currently offline Dean HillerFriend
Messages: 46
Registered: July 2009
Member
yeah, yeah, yeah, I finally got it working without the hotswap on EJB3 jar
but works on everything else. That was the biggest unusable wizard ever.

Bug #1. After checkout from CVS, there was no way for me to convert to
Dynamic Web Project

Bug #2 I then delete the project and keep it on disk. When I create
dynamic web project and uncheck default target to mount existing source
and choose the project on the filesystem, it says project alrady
exists...well, yes, I know it exists, I want to mount existing source just
like I can with java projects.

I am sooooo happy though that I got this working...it just took forever.

Usability Bug #3 In the dynamic web project wizard, there should be a J2EE
Module Depends page in the wizard where you add the jars so that a user
knows after he is done with the wizard, he would automatically look for
that tab.

I think if the above 3 bugs were solved, this thing would rock and be very
very usable for a beginner to come in and mount an existing web project.

thanks,
Dean
Re: changing project to dynamic web project fails miserbly??? [message #485695 is a reply to message #485485] Mon, 14 September 2009 14:14 Go to previous message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Dean Hiller wrote:
> yeah, yeah, yeah, I finally got it working without the hotswap on EJB3
> jar but works on everything else. That was the biggest unusable wizard
> ever.
>
> Bug #1. After checkout from CVS, there was no way for me to convert to
> Dynamic Web Project
>
> Bug #2 I then delete the project and keep it on disk. When I create
> dynamic web project and uncheck default target to mount existing source
> and choose the project on the filesystem, it says project alrady
> exists...well, yes, I know it exists, I want to mount existing source
> just like I can with java projects.
>
> I am sooooo happy though that I got this working...it just took forever.
>
> Usability Bug #3 In the dynamic web project wizard, there should be a
> J2EE Module Depends page in the wizard where you add the jars so that a
> user knows after he is done with the wizard, he would automatically look
> for that tab.
>
> I think if the above 3 bugs were solved, this thing would rock and be
> very very usable for a beginner to come in and mount an existing web
> project.
>
> thanks,
> Dean
>
>
>

Feel free to add your comments to Bug 168538[1]. However, I believe
there are enough other issues being worked on by those responsible for
this area of WTP, that it's hard to say when there would be enough extra
cycles to deal with that Bug. It's marked "helpwanted" if you feel
motivated.

Cheers,
Larry

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=168538
Previous Topic:Re: web page editor
Next Topic:problem flag on "return confirm(...)"
Goto Forum:
  


Current Time: Tue Apr 16 17:55:29 GMT 2024

Powered by FUDForum. Page generated in 0.56235 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top