Re: GWT, Spring when projects are split apart (client, services, persistence)

2012-05-19 Thread Joseph Lust
Jose,

I see that you're using the *mvn* commandline param. Why not use a built in 
Eclipse *run configuration*? While I have not used your exact 
configuration, I think you should be able to achieve it with something like 
the below using the 
maven-gwt-plugin 
(or 
similar):

Goals: gwt:compile gwt:debug 




With a custom run configuration you should be able to get whatever custom 
launch steps you need at a single click from within Eclipse.

You'll also need to add all the desired parameters (I've added startupUrl 
as an example). I don't have a list on me, but use the same parameters that 
the Eclipse *Web Application* starter uses under the *Arguments* tab. 
(pictured for my GWT-Maps-V3-Api project build).


Still, I think you'll find it easier to use the *Web Application* launcher 
as it provides a nice UI for setting these parameters and generating the 
commandline string. My team uses the built-in server option of the Web 
Application configure and there is no need to startup Jetty in that case.

I hope that helps.


Sincerely,
Joseph

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/TR_F2ciOAmEJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT, Spring when projects are split apart (client, services, persistence)

2012-05-19 Thread JoseM
I didn't realize I had to still run the jetty server seperately before.  I 
got it to work now running the jetty server using mvn jetty:start -Ddev and 
I just needed to right-click Run As "Web Application (running on an 
external server)" and supply the url (something like 
http://localhost:8080/{projectName}-server-1.0-SNAPSHOT/ )and uncheck the 
"Select an HTML page" option.

Is there a way to have it all running from within in eclipse with one 
command? Maybe even with the embedded jetty? The reason I ask is to make it 
easier to use the eclipse debugger to debug both server side and client 
side code at the same time.

Or can I somehow startup the jetty server within eclipse so that I can run 
it in debug mode?

On Saturday, May 19, 2012 6:21:51 AM UTC-4, Thomas Broyer wrote:
>
>
>
> On Friday, May 18, 2012 11:37:20 PM UTC+2, JoseM wrote:
>>
>> So I am assuming I would do this on the client project right? I can't sem 
>> to get it to work though.  
>>
>> No matter what settings I put for the war I get this message:
>>
>> [WARN] No startup URLs supplied and no plausible ones found -- use 
>> -startupUrl
>>
> Oh yeah, sure, I forgot to say that you have to add or update the 
> -startupUrl argument: -startupUrl 
> http://127.0.0.1:8080/foobar/index.html(where the URL is the one of your 
> Jetty server), and uncheck "use embedded 
> server" (or add the -noserver argument).
>
>  
>
>> And when I go to the root of the jetty server the index.html file is not 
>> there.
>>
> Then you have to build your project, or whatever it takes to make your 
> webapp work (i.e. copy index.html to the folder served by your jetty 
> server); that goes beyond GWT usage though.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/1pp88EqGxDoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT, Spring when projects are split apart (client, services, persistence)

2012-05-19 Thread Thomas Broyer


On Friday, May 18, 2012 11:37:20 PM UTC+2, JoseM wrote:
>
> So I am assuming I would do this on the client project right? I can't sem 
> to get it to work though.  
>
> No matter what settings I put for the war I get this message:
>
> [WARN] No startup URLs supplied and no plausible ones found -- use 
> -startupUrl
>
Oh yeah, sure, I forgot to say that you have to add or update the 
-startupUrl argument: -startupUrl http://127.0.0.1:8080/foobar/index.html 
(where the URL is the one of your Jetty server), and uncheck "use embedded 
server" (or add the -noserver argument).

 

> And when I go to the root of the jetty server the index.html file is not 
> there.
>
Then you have to build your project, or whatever it takes to make your 
webapp work (i.e. copy index.html to the folder served by your jetty 
server); that goes beyond GWT usage though.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/_e_5I5XmUccJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT, Spring when projects are split apart (client, services, persistence)

2012-05-18 Thread JoseM
So I am assuming I would do this on the client project right? I can't sem 
to get it to work though.  

No matter what settings I put for the war I get this message:

[WARN] No startup URLs supplied and no plausible ones found -- use 
-startupUrl

And when I go to the root of the jetty server the index.html file is not 
there.  

On Friday, May 18, 2012 11:52:48 AM UTC-4, Thomas Broyer wrote:
>
>
>
> On Friday, May 18, 2012 5:32:59 PM UTC+2, JoseM wrote:
>>
>> Can you expand a bit more on how to get GWT DevMode to work by launching 
>> from within Eclipse? We are used to creating a GWT Application run 
>> configuration in eclipse but right now I am not sure how to get to work so 
>> that the HTML/webapp resources are available to the run configuration.
>
>
> The easiest is to Run as… → Web Application. It will fail because it's 
> missing the source code for your other projects, but it'll have created the 
> launcher. Edit it to add your other projects' src/main/java and 
> src/main/resources (or whatever, if you'e not using Maven) to the classpath.
> If you want to share the *.launch file with other devs (e.g. commit it to 
> your VCS), then you can replace absolute file paths in the "arguments" tab 
> with Eclipse variables.
>

On Friday, May 18, 2012 11:52:48 AM UTC-4, Thomas Broyer wrote:
>
>
>
> On Friday, May 18, 2012 5:32:59 PM UTC+2, JoseM wrote:
>>
>> Can you expand a bit more on how to get GWT DevMode to work by launching 
>> from within Eclipse? We are used to creating a GWT Application run 
>> configuration in eclipse but right now I am not sure how to get to work so 
>> that the HTML/webapp resources are available to the run configuration.
>
>
> The easiest is to Run as… → Web Application. It will fail because it's 
> missing the source code for your other projects, but it'll have created the 
> launcher. Edit it to add your other projects' src/main/java and 
> src/main/resources (or whatever, if you'e not using Maven) to the classpath.
> If you want to share the *.launch file with other devs (e.g. commit it to 
> your VCS), then you can replace absolute file paths in the "arguments" tab 
> with Eclipse variables.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/LJITfbheeNIJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT, Spring when projects are split apart (client, services, persistence)

2012-05-18 Thread Thomas Broyer


On Friday, May 18, 2012 5:32:59 PM UTC+2, JoseM wrote:
>
> Can you expand a bit more on how to get GWT DevMode to work by launching 
> from within Eclipse? We are used to creating a GWT Application run 
> configuration in eclipse but right now I am not sure how to get to work so 
> that the HTML/webapp resources are available to the run configuration.


The easiest is to Run as… → Web Application. It will fail because it's 
missing the source code for your other projects, but it'll have created the 
launcher. Edit it to add your other projects' src/main/java and 
src/main/resources (or whatever, if you'e not using Maven) to the classpath.
If you want to share the *.launch file with other devs (e.g. commit it to 
your VCS), then you can replace absolute file paths in the "arguments" tab 
with Eclipse variables.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/U0PACb476I0J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT, Spring when projects are split apart (client, services, persistence)

2012-05-18 Thread JoseM
Can you expand a bit more on how to get GWT DevMode to work by launching 
from within Eclipse? We are used to creating a GWT Application run 
configuration in eclipse but right now I am not sure how to get to work so 
that the HTML/webapp resources are available to the run configuration.

On Friday, May 11, 2012 3:48:07 AM UTC-4, Thomas Broyer wrote:
>
>
>
>
> As for GWT DevMode, you have to add the source folders of your 
> dependencies (the 'shared' project, possibly others) to the classpath in 
> your Eclipse launcher. Depending on the configuration of your servlet 
> container / deployed app, you might have to use the 'server' project's 
> project.build.outputDirectory or WTP's temporary folder as the -war folder 
> for the DevMode.
> Have a look at 
> https://developers.google.com/eclipse/docs/faq#gwt_with_maven
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/qSFTwDrXrToJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT, Spring when projects are split apart (client, services, persistence)

2012-05-11 Thread Thomas Broyer


On Friday, May 11, 2012 4:12:16 PM UTC+2, Ümit Seren wrote:
>
> Thanks for the feedback Thomas, 
> I was actually following the gwt_with_maven docs at the google developers 
> page (tough only creating one maven war project). 
> So I think it should be quite easy to split it up.
>

Yes, very easy (provided you understand what you do and what you *need* to 
do).
 

> BTW. do these 3  (or 4 respectively) modules go into separate VCS 
> repositories or do all go into one? 
> I guess they could be checked into separate VCS repositories as the 
> dependency is handled by maven anyways.
>

These are all Maven modules under a "super-module", so we use a single VCS 
repo. It depends on your modules' lifecycle management; we always release 
the whole "package", so it makes no sense to have them as separate modules 
tracked independently (in independent VCS repos, with independently 
evolving version numbers, etc.)
 

> How do you do deployment? Do you have a dedicated jetty instance on the 
> production server and package the war and deploy it?
>

We have a quite specific setup, where we have a dedicated Jetty instance 
that's quite heavily tuned and adapted to our needs (many objects 
–including an HornetQ event-bus– instantiated in Jetty's XML files, and 
some of them passed to our app via JNDI). Our deliverable includes the 
Jetty configuration and startup scripts, WARs (we have several apps, only 
one using GWT) and shared libs.

For other projects with no/less specific needs, packaging as a WAR and 
deploying in whatever servlet container (or even EAR / application server) 
would Just Work™. In Maven, you could use Cargo  
instead of jetty:start if you wanted.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/dtdrHubAQcIJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT, Spring when projects are split apart (client, services, persistence)

2012-05-11 Thread Ümit Seren
Thanks for the feedback Thomas, 
I was actually following the gwt_with_maven docs at the google developers 
page (tough only creating one maven war project). 
So I think it should be quite easy to split it up.
BTW. do these 3  (or 4 respectively) modules go into separate VCS 
repositories or do all go into one? 
I guess they could be checked into separate VCS repositories as the 
dependency is handled by maven anyways. 

How do you do deployment? Do you have a dedicated jetty instance on the 
production server and package the war and deploy it?



On Friday, May 11, 2012 9:48:07 AM UTC+2, Thomas Broyer wrote:
>
>
>
> On Friday, May 11, 2012 9:09:17 AM UTC+2, Ümit Seren wrote:
>>
>> I have  a question to the people who are using multi-module maven 
>> projects instead of one (I am currently developing a 
>> Spring/GWT/RequestFactory project as one big maven projects). 
>> I do much of the debugging in eclipse by starting a WTP jetty instance 
>> and then starting the GWT development mode. By this I can debug both 
>> backend and frontend and whenever I change something in the client code it 
>> will work without me restarting development mode and when i change 
>> something on the backend WTP should re-publish it and it should also work 
>> fine (although some stuff doesn't). 
>>
>> I am using eclipse m2eclipse for dependency management. ( I don't use mvn 
>> jetty:run or so but WTP) . 
>> Does the same workflow also work when I split up the one maven module 
>> into multiple? (shared, client, server) 
>> I guess it should as the m2 will probably make sure that everything is in 
>> the right place. 
>> But maybe somebody has already experience with debugging a multi maven 
>> module in eclipse and can give some feedback.
>>
>
> We've been doing it for more than 1½ year now, it works really well. I'd 
> never used jetty:start or gwt:run before working on the 
> gwt-maven-archetypes.
> We only used WTP for a few months, and then switched to launching Jetty 
> from a shell script, with a context dedicated to development where it reads 
> classes and resources from our different projects: 'touch' the context file 
> and Jetty redeploys the app in seconds. We had a few issues with WTP (not 
> redeploying some JARs/classes, etc.)
> As for GWT DevMode, you have to add the source folders of your 
> dependencies (the 'shared' project, possibly others) to the classpath in 
> your Eclipse launcher. Depending on the configuration of your servlet 
> container / deployed app, you might have to use the 'server' project's 
> project.build.outputDirectory or WTP's temporary folder as the -war folder 
> for the DevMode.
> Have a look at 
> https://developers.google.com/eclipse/docs/faq#gwt_with_maven
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/qS9zYo98t0gJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT, Spring when projects are split apart (client, services, persistence)

2012-05-11 Thread Thomas Broyer


On Friday, May 11, 2012 9:09:17 AM UTC+2, Ümit Seren wrote:
>
> I have  a question to the people who are using multi-module maven projects 
> instead of one (I am currently developing a Spring/GWT/RequestFactory 
> project as one big maven projects). 
> I do much of the debugging in eclipse by starting a WTP jetty instance and 
> then starting the GWT development mode. By this I can debug both backend 
> and frontend and whenever I change something in the client code it will 
> work without me restarting development mode and when i change something on 
> the backend WTP should re-publish it and it should also work fine (although 
> some stuff doesn't). 
>
> I am using eclipse m2eclipse for dependency management. ( I don't use mvn 
> jetty:run or so but WTP) . 
> Does the same workflow also work when I split up the one maven module into 
> multiple? (shared, client, server) 
> I guess it should as the m2 will probably make sure that everything is in 
> the right place. 
> But maybe somebody has already experience with debugging a multi maven 
> module in eclipse and can give some feedback.
>

We've been doing it for more than 1½ year now, it works really well. I'd 
never used jetty:start or gwt:run before working on the 
gwt-maven-archetypes.
We only used WTP for a few months, and then switched to launching Jetty 
from a shell script, with a context dedicated to development where it reads 
classes and resources from our different projects: 'touch' the context file 
and Jetty redeploys the app in seconds. We had a few issues with WTP (not 
redeploying some JARs/classes, etc.)
As for GWT DevMode, you have to add the source folders of your dependencies 
(the 'shared' project, possibly others) to the classpath in your Eclipse 
launcher. Depending on the configuration of your servlet container / 
deployed app, you might have to use the 'server' project's 
project.build.outputDirectory or WTP's temporary folder as the -war folder 
for the DevMode.
Have a look at https://developers.google.com/eclipse/docs/faq#gwt_with_maven

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/k9kLG0sva7IJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT, Spring when projects are split apart (client, services, persistence)

2012-05-11 Thread Ümit Seren
I have  a question to the people who are using multi-module maven projects 
instead of one (I am currently developing a Spring/GWT/RequestFactory 
project as one big maven projects). 
I do much of the debugging in eclipse by starting a WTP jetty instance and 
then starting the GWT development mode. By this I can debug both backend 
and frontend and whenever I change something in the client code it will 
work without me restarting development mode and when i change something on 
the backend WTP should re-publish it and it should also work fine (although 
some stuff doesn't). 

I am using eclipse m2eclipse for dependency management. ( I don't use mvn 
jetty:run or so but WTP) . 
Does the same workflow also work when I split up the one maven module into 
multiple? (shared, client, server) 
I guess it should as the m2 will probably make sure that everything is in 
the right place. 
But maybe somebody has already experience with debugging a multi maven 
module in eclipse and can give some feedback. 



On Wednesday, May 9, 2012 3:15:29 PM UTC+2, Christien Lomax wrote:
>
> Hi All,
>
> We could use a bit of insight and help if anyone has a moment.
>
> We currently have a project that is quite huge (thousands of classes) 
> including the GWT client, a spring service layer and 
> hibernate persistence layer.
>
> We are trying to split up the project into more manageable pieces 
> including:
>
>- client project (contains our GWT widgets, RequestFactories, etc, 
>Spring servlets)
>- service project (contains the spring service layer, web services 
>(REST, SOAP))
>- persistence project (contains the domain beans - hibernate mapped 
>objects, persistence code, etc)
>- shared project (classes that can be used on both the client (gwt 
>compiled) and server side.
>
> Everything compiles and works (unit tests, etc) until we hit GWT's 
> compile.  At this point, we get complaints about GWT not being able to see 
> items in the service layer (which makes sense, it is trying 
> to compile references to the beans, services, etc).
> We've tried a number of approaches, including using @ServiceName instead 
> of @Service and using the  specifications on the modules. 
>  Right now we a few errors we are unable to resolve:
>
> 1 - we get this one for every Adapte:)
>   [ERROR] Errors in 'file:/C:/workspace/client/src/main/java/com/
> mycompany/adapter/alert/AlertBeanGwtAdapter.java'
>  [ERROR] Line 14: No source code is available for type 
> com.mycompany.service.alerts.IAlertService; did you forget to inherit a 
> required module?
>
> 2 - if we omit the "-strict" parameter when compiling GWT, we get this:
>  [ERROR] An internal compiler exception occurred
>  com.google.gwt.dev.jjs.InternalCompilerException: Failed to get JNode
>  ...
>  [ERROR] : public interface com.mycompany
> .service.alerts.IAlertService
>  ...
>  org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding
>  [ERROR] at AlertBeanGwtAdapter.java(14): private IAlertService 
> getService() {
>return (IAlertService) 
> EcmLocator.getApplicationContext().getBean(IAlertService.TYPE);
>  }
>  org.eclipse.jdt.internal.compiler.ast.MethodDeclaration
>
> Can anyone shed any light on what we may be doing wrong?  When it is all 
> in one project, everything works fine, but splitting it into multiple 
> projects (that are references via maven) it fails.
>
> Example source (some code is omitted):
>
> *Client Layer:*
>
> *...client.alerts.request.**IAlertRequest.java*
> @ServiceName(value = "com.mycompany.service.alerts.IAlertService.class", 
> locator = "SpringServiceLocator.class")
> public interface IAlertRequest extends RequestContext
> {
> Request countAlerts(String eventClass, Date dateLimit);
> Request> listAlertTypes();
> Request> listUnviewedAlerts();
> }
>
> *...web.**SpringServiceLocator.java**
> *
> public class SpringServiceLocator implements ServiceLocator
> {
>  public Object getInstance(Class clazz)
> {
> ApplicationContext context = 
> WebApplicationContextUtils.getWebApplicationContext(RequestFactoryServlet
> .getThreadLocalServletContext());
> return context.getBean(clazz);
> }
> }
>
> *OurProject.gwt.xml*
> 
> 
>
> 
> 
> 
> 
> 
> 
> 
>
> 
>  
>
> 
>
>  value="true" />
>
> 
> 
> 
> 
>
> *Service Layer:*
>
> *...services.alerts.**IAlertService.java*
> public interface IAlertService
> {
> String TYPE = "AlertService";
> Long countAlerts(String eventClass, Date dateLimit);
> List listAlertTypes();
> List listUnviewedAlerts();
> }
>
> *...services.alerts.AlertService.java*
> @Service("AlertService")
> @Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
> public class AlertService extends EcmService implements IAlertService
> {
> public Long countAlerts(String eventClass, Date dateLimit) {...};
> public List listAlertTypes() {...};
> public List listUnviewedAlerts() {...}; 
> }
>
> *Persistence Layer:*
>
> *...domain.alerts.AlertBean.java*
> @Entity
> @Imm

Re: GWT, Spring when projects are split apart (client, services, persistence)

2012-05-10 Thread Thomas Broyer


On Wednesday, May 9, 2012 8:09:56 PM UTC+2, Christien Lomax wrote:
>
> Hi Thomas,
>
> First, I want to say that your examples and blogs have helped us a lot 
> over the last year!  Thanks!
>
> Secondly, thanks for the super quick reply!
>
> I added the sources generation to the POMs for the Shared, Persistence and 
> Services projects, and fixed the ".class" issues.  However, we are still 
> getting issues with GWT not being able to find classes/sources...  they (at 
> the moment) seem to be around classes specified via @ExtraTypes which we 
> have specified in our IAppRequestFactory interface.
>
> eg:
>
> @ExtraTypes({
> IAlertProxy.class, IAlertOptionsProxy.class, IAlertTypeProxy.class
> })
> public interface IOris4RequestFactory extends RequestFactory
> {
> IAlertRequest alertRequest();
>
> ...
> }
>
> The specific error is:
>Resolving com.mycompany.client.IAppRequestFactory
>   Found type 'com.mycompany.client.IApp4RequestFactory'
>  [ERROR] Annotation error: cannot resolve com.mycompany.
> client.alerts.proxy.IAlertProxy
>java.lang.ClassNotFoundException: com.mycompany.
> client.alerts.proxy.IAlertProxy
>...
>[ERROR] Annotation error: expected class java.lang.Class, got null
>
>
Just to make sure: are your classes javac'd (maven-compiler-plugin) before 
being GWT-compiled (gwt-maven-plugin)?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/PBx0XkJ6G_gJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT, Spring when projects are split apart (client, services, persistence)

2012-05-10 Thread Christien Lomax
Hi Joseph,

We are using RequestFactory for most of our calls to the services layer. 
 We do use GWT-RPC for calls to our Solr/Lucene service, but that's it. 
 Our projects seems to be setup correctly (with the changes suggested by 
Thomas), but we still have a few hiccups (highlighted in my previous post). 
 We actually have a fork of our project doing just what you said, but with 
moving the interfaces into their own package which is referenced in a 
module instead of an entirely new project.  Both projects are at the same 
point however...

It is great to know there is another big project out there though! 
 Sometimes I wonder if we are alone ;)   I don't suppose you are also using 
aspectJ instead of proxy based transactions?  We've had a hell of a time 
with aspectj and it seems to have slowed our environments down a lot 
(around compiling).  Anyway, off-topic ;)


/c

On Thursday, 10 May 2012 12:06:09 UTC-3, Joseph Lust wrote:
>
> Christien,
>
> On our project which is about the size of yours, we have an *Interfaces* 
> Maven 
> project. Our GWT project makes no direct references to the Services project 
> and visa versa. This way the issue of making the sources available is a 
> non-issue. We use Spring4GWT  to 
> wireup GWT->Service RPC calls using the interfaces in the Interfaces 
> project. Thus the build order is (1) Interfaces, (2) GWT, (3) Services.
>
> So there is an interface for the service in the Interface project
>
> @RemoteServiceRelativePath("springGwtServices/marketService")
> public interface MarketService extends RemoteService {
>
>
> MarketDTOContainer getMarketData(Date begin, Date end)
>  
>
>
> So a GWT module references an async interface seen below. Now you can 
> access your service just fine from GWT.
> This interface has all the methods of the above interface, but the return 
> value is wrapped in an async callback.
>
> public interface MarketRiskServiceAsync {
>
> void getMarketData(Date begin, Date end, AsyncCallback 
> async);
>
>  ..
>
>
> The actual service uses an annotation to tell Spring where to find it for 
> wireup with a name matching that in the interface.
>
> @Service("marketService")
> public class MarketServiceImpl implements MarketService { ...
>
>
> There is a one off config to setup the servlet mappings:
>
> 
> springGwt
> 
> org.spring4gwt.server.SpringGwtRemoteServiceServlet
> 
> 
> springGwt
> springGwtServices/*
> 
>
>
> Clearly your project is well along, but you might find this pattern 
> useful. While it looks like a lot of interfaces, in many cases we just add 
> another method to a service interface and we're done. We also like the 
> DTOContainer patter since we can pass another parameter along with an 
> existing request by just adding it to the container class. 
>
> Hope this helps you or others with similar issues.
>
> Sincerely,
> Joseph
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/wY8TLghbv8cJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT, Spring when projects are split apart (client, services, persistence)

2012-05-10 Thread Joseph Lust
Christien,

On our project which is about the size of yours, we have an *Interfaces* Maven 
project. Our GWT project makes no direct references to the Services project 
and visa versa. This way the issue of making the sources available is a 
non-issue. We use Spring4GWT  to 
wireup GWT->Service RPC calls using the interfaces in the Interfaces 
project. Thus the build order is (1) Interfaces, (2) GWT, (3) Services.

So there is an interface for the service in the Interface project

@RemoteServiceRelativePath("springGwtServices/marketService")
public interface MarketService extends RemoteService {


MarketDTOContainer getMarketData(Date begin, Date end)
 


So a GWT module references an async interface seen below. Now you can 
access your service just fine from GWT.
This interface has all the methods of the above interface, but the return 
value is wrapped in an async callback.

public interface MarketRiskServiceAsync {

void getMarketData(Date begin, Date end, AsyncCallback 
async);

 ..


The actual service uses an annotation to tell Spring where to find it for 
wireup with a name matching that in the interface.

@Service("marketService")
public class MarketServiceImpl implements MarketService { ...


There is a one off config to setup the servlet mappings:


springGwt

org.spring4gwt.server.SpringGwtRemoteServiceServlet


springGwt
springGwtServices/*



Clearly your project is well along, but you might find this pattern useful. 
While it looks like a lot of interfaces, in many cases we just add another 
method to a service interface and we're done. We also like the DTOContainer 
patter since we can pass another parameter along with an existing request 
by just adding it to the container class. 

Hope this helps you or others with similar issues.

Sincerely,
Joseph

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/WhKIPo9g4koJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT, Spring when projects are split apart (client, services, persistence)

2012-05-09 Thread Christien Lomax
Eclipse, using m2e.  All our projects are maven based.  Source is specified 
as Thomas has outlined (source-jars added to POM).

/c

On Wednesday, 9 May 2012 10:46:37 UTC-3, Jens wrote:
>
> How do you compile your app? Maven? Ant? In Eclipse using GPE?
>
> You have to make sure that the GWT compiler's classpath contains all 
> needed source files (= add src/main/java of all projects that need to be 
> compiled by GWT to the compilers classpath).
>
> -- J.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/qD057MLVFCAJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT, Spring when projects are split apart (client, services, persistence)

2012-05-09 Thread Christien Lomax
Hi Thomas,

First, I want to say that your examples and blogs have helped us a lot over 
the last year!  Thanks!

Secondly, thanks for the super quick reply!

I added the sources generation to the POMs for the Shared, Persistence and 
Services projects, and fixed the ".class" issues.  However, we are still 
getting issues with GWT not being able to find classes/sources...  they (at 
the moment) seem to be around classes specified via @ExtraTypes which we 
have specified in our IAppRequestFactory interface.

eg:

@ExtraTypes({
IAlertProxy.class, IAlertOptionsProxy.class, IAlertTypeProxy.class
})
public interface IOris4RequestFactory extends RequestFactory
{
IAlertRequest alertRequest();

...
}

The specific error is:
   Resolving com.mycompany.client.IAppRequestFactory
  Found type 'com.mycompany.client.IApp4RequestFactory'
 [ERROR] Annotation error: cannot resolve com.mycompany.
client.alerts.proxy.IAlertProxy
   java.lang.ClassNotFoundException: com.mycompany.
client.alerts.proxy.IAlertProxy
   ...
   [ERROR] Annotation error: expected class java.lang.Class, got null

It then eventually down the list starts complaining about the Adapters

Resolving com.mycompany.client.alerts.proxy.IAlertProxy
  Found type 'com.mycompany.client.alerts.proxy.IAlertProxy'
 [ERROR] Annotation error: cannot resolve com.mycompany
.adapter.alert.AlertGwtAdapter
  java.lang.ClassNotFoundException: com.mycompany
.adapter.alert.AlertGwtAdapter

The proxy classes are specified in the main client project, and the adapter 
classes are in the same project, but outside the client package (referenced 
via )

Sorry to bother you again about this, but its had us stuck for a while now.

/c
 

On Wednesday, 9 May 2012 11:02:08 UTC-3, Thomas Broyer wrote:
>
>
>
> On Wednesday, May 9, 2012 3:15:29 PM UTC+2, Christien Lomax wrote:
>>
>> Hi All,
>>
>> We could use a bit of insight and help if anyone has a moment.
>>
>> We currently have a project that is quite huge (thousands of classes) 
>> including the GWT client, a spring service layer and 
>> hibernate persistence layer.
>>
>> We are trying to split up the project into more manageable pieces 
>> including:
>>
>>- client project (contains our GWT widgets, RequestFactories, etc, 
>>Spring servlets)
>>- service project (contains the spring service layer, web services 
>>(REST, SOAP))
>>- persistence project (contains the domain beans - hibernate mapped 
>>objects, persistence code, etc)
>>- shared project (classes that can be used on both the client (gwt 
>>compiled) and server side.
>>
>> Everything compiles and works (unit tests, etc) until we hit GWT's 
>> compile.  At this point, we get complaints about GWT not being able to see 
>> items in the service layer (which makes sense, it is trying 
>> to compile references to the beans, services, etc).
>> We've tried a number of approaches, including using @ServiceName instead 
>> of @Service and using the  specifications on the modules. 
>>  Right now we a few errors we are unable to resolve:
>>
>> 1 - we get this one for every Adapte:)
>>   [ERROR] Errors in 'file:/C:/workspace/client/src/main/java/com/
>> mycompany/adapter/alert/AlertBeanGwtAdapter.java'
>>  [ERROR] Line 14: No source code is available for type 
>> com.mycompany.service.alerts.IAlertService; did you forget to inherit a 
>> required module?
>>
>
> You ahve to produce a source JAR for your artifacts, and then reference 
> them as dependencies in your GWT project.
> See 
> https://github.com/tbroyer/gwt-maven-archetypes/tree/master/modular-requestfactory/src/test/resources/projects/basic-rf/reference
>  for 
> an example (here, the GWT client-side, server-side, and shared code 
> –RequestFactory interfaces– are separated into 3 distinct modules; the 
> client module depends on the shared module's 
> sources to bring its sources in the GWT compiler 
> classpath.
>  
>
>> 2 - if we omit the "-strict" parameter when compiling GWT, we get this:
>>  [ERROR] An internal compiler exception occurred
>>  com.google.gwt.dev.jjs.InternalCompilerException: Failed to get 
>> JNode
>>  ...
>>  [ERROR] : public interface com.mycompany
>> .service.alerts.IAlertService
>>  ...
>>  org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding
>>  [ERROR] at AlertBeanGwtAdapter.java(14): private IAlertService 
>> getService() {
>>return (IAlertService) 
>> EcmLocator.getApplicationContext().getBean(IAlertService.TYPE);
>>  }
>>  org.eclipse.jdt.internal.compiler.ast.MethodDeclaration
>>
>> Can anyone shed any light on what we may be doing wrong?  When it is all 
>> in one project, everything works fine, but splitting it into multiple 
>> projects (that are references via maven) it fails.
>>
>> Example source (some code is omitted):
>>
>> *Client Layer:*
>>
>> *...client.alerts.request.**IAlertRequest.java*
>> @ServiceName(value = "com.mycompany.service.alerts.IAlertService.class", 

Re: GWT, Spring when projects are split apart (client, services, persistence)

2012-05-09 Thread Thomas Broyer


On Wednesday, May 9, 2012 3:15:29 PM UTC+2, Christien Lomax wrote:
>
> Hi All,
>
> We could use a bit of insight and help if anyone has a moment.
>
> We currently have a project that is quite huge (thousands of classes) 
> including the GWT client, a spring service layer and 
> hibernate persistence layer.
>
> We are trying to split up the project into more manageable pieces 
> including:
>
>- client project (contains our GWT widgets, RequestFactories, etc, 
>Spring servlets)
>- service project (contains the spring service layer, web services 
>(REST, SOAP))
>- persistence project (contains the domain beans - hibernate mapped 
>objects, persistence code, etc)
>- shared project (classes that can be used on both the client (gwt 
>compiled) and server side.
>
> Everything compiles and works (unit tests, etc) until we hit GWT's 
> compile.  At this point, we get complaints about GWT not being able to see 
> items in the service layer (which makes sense, it is trying 
> to compile references to the beans, services, etc).
> We've tried a number of approaches, including using @ServiceName instead 
> of @Service and using the  specifications on the modules. 
>  Right now we a few errors we are unable to resolve:
>
> 1 - we get this one for every Adapte:)
>   [ERROR] Errors in 'file:/C:/workspace/client/src/main/java/com/
> mycompany/adapter/alert/AlertBeanGwtAdapter.java'
>  [ERROR] Line 14: No source code is available for type 
> com.mycompany.service.alerts.IAlertService; did you forget to inherit a 
> required module?
>

You ahve to produce a source JAR for your artifacts, and then reference 
them as dependencies in your GWT project.
See 
https://github.com/tbroyer/gwt-maven-archetypes/tree/master/modular-requestfactory/src/test/resources/projects/basic-rf/reference
 for 
an example (here, the GWT client-side, server-side, and shared code 
–RequestFactory interfaces– are separated into 3 distinct modules; the 
client module depends on the shared module's 
sources to bring its sources in the GWT compiler 
classpath.
 

> 2 - if we omit the "-strict" parameter when compiling GWT, we get this:
>  [ERROR] An internal compiler exception occurred
>  com.google.gwt.dev.jjs.InternalCompilerException: Failed to get JNode
>  ...
>  [ERROR] : public interface com.mycompany
> .service.alerts.IAlertService
>  ...
>  org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding
>  [ERROR] at AlertBeanGwtAdapter.java(14): private IAlertService 
> getService() {
>return (IAlertService) 
> EcmLocator.getApplicationContext().getBean(IAlertService.TYPE);
>  }
>  org.eclipse.jdt.internal.compiler.ast.MethodDeclaration
>
> Can anyone shed any light on what we may be doing wrong?  When it is all 
> in one project, everything works fine, but splitting it into multiple 
> projects (that are references via maven) it fails.
>
> Example source (some code is omitted):
>
> *Client Layer:*
>
> *...client.alerts.request.**IAlertRequest.java*
> @ServiceName(value = "com.mycompany.service.alerts.IAlertService.class", 
> locator = "SpringServiceLocator.class")
>

Don't include the ".class", it's not part of the name of the class.
 

> public interface IAlertRequest extends RequestContext
> {
> Request countAlerts(String eventClass, Date dateLimit);
> Request> listAlertTypes();
> Request> listUnviewedAlerts();
> }
>
> *...web.**SpringServiceLocator.java**
> *
> public class SpringServiceLocator implements ServiceLocator
> {
>  public Object getInstance(Class clazz)
> {
> ApplicationContext context = 
> WebApplicationContextUtils.getWebApplicationContext(RequestFactoryServlet
> .getThreadLocalServletContext());
> return context.getBean(clazz);
> }
> }
>
> *OurProject.gwt.xml*
> 
> 
>
> 
> 
> 
> 
> 
> 
> 
>
> 
>  
>
> 
>
>  value="true" />
>

This is the default in GWT 2.4 AFAIK (or will it only be starting with 2.5?)
 

>
> 
> 
> 
> 
>
> *Service Layer:*
>
> *...services.alerts.**IAlertService.java*
> public interface IAlertService
> {
> String TYPE = "AlertService";
> Long countAlerts(String eventClass, Date dateLimit);
> List listAlertTypes();
> List listUnviewedAlerts();
> }
>
> *...services.alerts.AlertService.java*
> @Service("AlertService")
> @Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
> public class AlertService extends EcmService implements IAlertService
> {
> public Long countAlerts(String eventClass, Date dateLimit) {...};
> public List listAlertTypes() {...};
> public List listUnviewedAlerts() {...}; 
> }
>
> *Persistence Layer:*
>
> *...domain.alerts.AlertBean.java*
> @Entity
> @Immutable
> @Table(name = "alertdisplayview")
> public class AlertBean implements Serializable
> {
>  ...
> }
>
> *...domain.alerts.* *AlertType.java*
> @Entity
> @Immutable
> @Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
> @Table(name = "alerttype")
> @NamedQueries({
> @NamedQuery(name = "alertType.findByName", query = "select alt from 
> Al

Re: GWT, Spring when projects are split apart (client, services, persistence)

2012-05-09 Thread Jens
How do you compile your app? Maven? Ant? In Eclipse using GPE?

You have to make sure that the GWT compiler's classpath contains all needed 
source files (= add src/main/java of all projects that need to be compiled 
by GWT to the compilers classpath).

-- J.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/HOJw0hs2s1oJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



GWT, Spring when projects are split apart (client, services, persistence)

2012-05-09 Thread Christien Lomax
Hi All,

We could use a bit of insight and help if anyone has a moment.

We currently have a project that is quite huge (thousands of classes) 
including the GWT client, a spring service layer and 
hibernate persistence layer.

We are trying to split up the project into more manageable pieces including:

   - client project (contains our GWT widgets, RequestFactories, etc, 
   Spring servlets)
   - service project (contains the spring service layer, web services 
   (REST, SOAP))
   - persistence project (contains the domain beans - hibernate mapped 
   objects, persistence code, etc)
   - shared project (classes that can be used on both the client (gwt 
   compiled) and server side.

Everything compiles and works (unit tests, etc) until we hit GWT's compile. 
 At this point, we get complaints about GWT not being able to see items 
in the service layer (which makes sense, it is trying to compile references 
to the beans, services, etc).
We've tried a number of approaches, including using @ServiceName instead of 
@Service and using the  specifications on the modules.  Right 
now we a few errors we are unable to resolve:

1 - we get this one for every Adapte:)
  [ERROR] Errors in 'file:/C:/workspace/client/src/main/java/com/
mycompany/adapter/alert/AlertBeanGwtAdapter.java'
 [ERROR] Line 14: No source code is available for type 
com.mycompany.service.alerts.IAlertService; did you forget to inherit a 
required module?

2 - if we omit the "-strict" parameter when compiling GWT, we get this:
 [ERROR] An internal compiler exception occurred
 com.google.gwt.dev.jjs.InternalCompilerException: Failed to get JNode
 ...
 [ERROR] : public interface com.mycompany
.service.alerts.IAlertService
 ...
 org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding
 [ERROR] at AlertBeanGwtAdapter.java(14): private IAlertService 
getService() {
   return (IAlertService) 
EcmLocator.getApplicationContext().getBean(IAlertService.TYPE);
 }
 org.eclipse.jdt.internal.compiler.ast.MethodDeclaration

Can anyone shed any light on what we may be doing wrong?  When it is all in 
one project, everything works fine, but splitting it into multiple projects 
(that are references via maven) it fails.

Example source (some code is omitted):

*Client Layer:*

*...client.alerts.request.**IAlertRequest.java*
@ServiceName(value = "com.mycompany.service.alerts.IAlertService.class", 
locator = "SpringServiceLocator.class")
public interface IAlertRequest extends RequestContext
{
Request countAlerts(String eventClass, Date dateLimit);
Request> listAlertTypes();
Request> listUnviewedAlerts();
}

*...web.**SpringServiceLocator.java**
*
public class SpringServiceLocator implements ServiceLocator
{
 public Object getInstance(Class clazz)
{
ApplicationContext context = 
WebApplicationContextUtils.getWebApplicationContext(RequestFactoryServlet
.getThreadLocalServletContext());
return context.getBean(clazz);
}
}

*OurProject.gwt.xml*












 










*Service Layer:*

*...services.alerts.**IAlertService.java*
public interface IAlertService
{
String TYPE = "AlertService";
Long countAlerts(String eventClass, Date dateLimit);
List listAlertTypes();
List listUnviewedAlerts();
}

*...services.alerts.AlertService.java*
@Service("AlertService")
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public class AlertService extends EcmService implements IAlertService
{
public Long countAlerts(String eventClass, Date dateLimit) {...};
public List listAlertTypes() {...};
public List listUnviewedAlerts() {...}; 
}

*Persistence Layer:*

*...domain.alerts.AlertBean.java*
@Entity
@Immutable
@Table(name = "alertdisplayview")
public class AlertBean implements Serializable
{
 ...
}

*...domain.alerts.* *AlertType.java*
@Entity
@Immutable
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
@Table(name = "alerttype")
@NamedQueries({
@NamedQuery(name = "alertType.findByName", query = "select alt from 
AlertType alt where alt.name =:name or alt.internalName =:name")
})
public class AlertType implements Serializable
{
 ...
}

*Persistence.gwt.xml*





-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/FemRek3N5IUJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.