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 <source .../> 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] <no source info>: 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<Long> countAlerts(String eventClass, Date dateLimit);
> Request<List<IAlertTypeProxy>> listAlertTypes();
> Request<List<IAlertBeanProxy>> 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*
> <?xml version="1.0" encoding="UTF-8"?>
> <module rename-to='Oris4'>
>
> <inherits name='com.google.gwt.editor.Editor' />
> <inherits name='com.google.gwt.json.JSON' />
> <inherits name='com.google.gwt.logging.Logging' />
> <inherits name='com.google.gwt.resources.Resources' />
> <inherits name='com.google.web.bindery.requestfactory.RequestFactory' />
> <inherits name='com.google.gwt.user.User' />
> <inherits name="com.google.gwt.i18n.I18N" />
>
> <inherits name='com.mycompany.theme.clean.Clean' />
> <inherits name='com.mycompany.Persistence' />
>
> <entry-point class='com.mycompany.client.OurEntryPoint' />
>
> <set-configuration-property name="UiBinder.useSafeHtmlTemplates"
> value="true" />
>
> <source path='client' />
> <source path='web' />
> <source path='adapter' />
> </module>
>
> *Service Layer:*
>
> *...services.alerts.**IAlertService.java*
> public interface IAlertService
> {
> String TYPE = "AlertService";
> Long countAlerts(String eventClass, Date dateLimit);
> List<AlertType> listAlertTypes();
> List<AlertBean> 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<AlertType> listAlertTypes() {...};
> public List<AlertBean> 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*
> <?xml version="1.0" encoding="UTF-8"?>
> <module rename-to='Persistence'>
> <source path="domain" />
> </module>
>
>
--
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/-/bZ_Ytr-pAfYJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.