Re: [gwt-contrib] Re: Classloader issues for server-side code in DevMode with GWT 2.6

2014-03-17 Thread Stephen Haberman
Hi Thomas,

 (or rather, it'll work too well, and won't detect that something is
 missing in WEB-INF/lib.

I'm attempting to follow along, but classloader semantics are fun, so
apologies if I'm wrong somewhere...

So, to clarify, if I have a dependency, say foo.jar, that isn't GWT, and
isn't Jetty, but my server-side code uses it, with your proposal, would
it now have to be in (say) src/main/webapp/WEB-INF/lib? Or could it
still come from the Eclipse classpath like it does today?

My two cents is that foo.jar being on the Eclipse classpath is just
fine/what I generally prefer anyway, even if it works too well, as it
means I can skip the make a war or put all jars into WEB-INF/lib
steps while just developing.

That said, you are right that it could lead to false positives, but I
would really hope that developers are not using it works on my machine
in dev mode against my exploded war as their criteria for will work in
production. Perhaps that is too optimistic.

- Stephen

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups GWT 
Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Re: Classloader issues for server-side code in DevMode with GWT 2.6

2014-03-17 Thread Thomas Broyer


On Monday, March 17, 2014 4:50:47 PM UTC+1, Stephen Haberman wrote:

 Hi Thomas, 

  (or rather, it'll work too well, and won't detect that something is 
  missing in WEB-INF/lib. 

 I'm attempting to follow along, but classloader semantics are fun, so 
 apologies if I'm wrong somewhere... 

 So, to clarify, if I have a dependency, say foo.jar, that isn't GWT, and 
 isn't Jetty, but my server-side code uses it, with your proposal, would 
 it now have to be in (say) src/main/webapp/WEB-INF/lib?


Neither one (depending on your build tool though).

Maven (or Gradle) are built on the same rule that src/ is for sources, and 
is readonly as far as the build tool is concerned.
Your dependencies coming from Maven will ultimately go to 
target/${project.build.finalName}/WEB-INF/lib, and this 
(target/$project.build.finalName} is what you should use as your -war 
directory. 
See 
http://web.archive.org/web/20130619170526/https://developers.google.com/eclipse/docs/faq#gwt_with_maven
 
(don't ask me why it has been removed from the GPE FAQ, I have no idea)
http://stackoverflow.com/q/5719118/116472 is an example of what will happen 
if you don't follow that rule.
So your foo.jar will be in target/${project.build.finalName}/WEb-INF/lib, 
put there by your build tool.
AFAIK, the gwt-gradle-plugin does the right thing too (but doesn't 
integrate with the GPE; or rather, the GPE doesn't integrate with anything 
else than Maven).

That's for managed dependencies. For manual dependencies, then yes, I'd 
argue you should put them in your WEB-INF/lib.

Or could it still come from the Eclipse classpath like it does today?


Jens proposal is to make it fail in this case.
I don't have a strong opinion though; I'd be fine just using the system 
classloader as the parent of the webapp classloader (the end result would 
be the same as if you deployed all your code and dependencies to Jetty's 
lib/ or lib/ext/ or Tomcat's shared/ ); I wonder though what newbies would 
prefer (or rather, what would be best for them, before they can even forge 
an opinion, by the principle of least surprise). I wonder whether we should 
output warnings when loading things from the classpath rather than 
WEB-INF/lib; knowing how things work and knowing what I do, I'd be fine 
leaving without warnings, I think newbies would need/prefer warnings.
 

 My two cents is that foo.jar being on the Eclipse classpath is just 
 fine/what I generally prefer anyway, even if it works too well, as it 
 means I can skip the make a war or put all jars into WEB-INF/lib 
 steps while just developing. 

 That said, you are right that it could lead to false positives, but I 
 would really hope that developers are not using it works on my machine 
 in dev mode against my exploded war as their criteria for will work in 
 production. Perhaps that is too optimistic.


As I said, we're power users, we're used to build tools assembling our 
apps, how java webapps are organized with their WEB-INF/classese and 
WEB-INF/lib, etc. We can tolerate one behavior or the other, possibly even 
having a switch to choose the one we prefer for our environment.
The problem has more to do with newbies, of the kind that download the GPE, 
create a sample app, copy/paste some code from StackOverflow, downloading 
the needed dependencies manually, and finally publishing their app to 
AppEngine; all of that without exiting Eclipse, without any build tool 
other than Eclipse and the GPE.
Maybe it's a GPE issue after all (I never tried IntelliJ IDEA for webapps; 
I tend to prefer embedded servers these days, rather than wars deployed 
into servlet containers).

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups GWT 
Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gwt-contrib] Re: Classloader issues for server-side code in DevMode with GWT 2.6

2014-03-17 Thread Jens


 Maybe it's a GPE issue after all (I never tried IntelliJ IDEA for webapps; 
 I tend to prefer embedded servers these days, rather than wars deployed 
 into servlet containers).


You have the same issue in IntelliJ. IntelliJ can create an example GWT 
project that will have src + war folder and gwt-user on class path. However 
inside that war folder there is no WEB-INF/lib folder generated. Because 
that folder does not exist by default it is maybe even more likely that a 
newbie directly adds a library to the project/module instead of creating 
WEB-INF/lib and manually put the lib folder on class path.
However if you want to export that project to a war file within IntelliJ 
you would define a Java web application artifact and while doing so, 
IntelliJ creates red error messages (along with a single click fix 
button) which say which libraries are required by the project but are 
missing in the artifact. So you get the sense that your artifact will not 
work if you ignore and don't fix all these error messages.
If you want to deploy to AppEngine from within IntelliJ you need to add the 
AppEngine facet and this will again need an artifact.


-- J.

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups GWT 
Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.