Rpc calls problem

65 views
Skip to first unread message

_panic_

unread,
May 7, 2008, 4:19:44 AM5/7/08
to Google Web Toolkit
Hi all,
I've made a sample app that uses gwt, gwt-ext, spring, hibernate (with
annotations), gwt-server library and hibernate4gwt.
I've made a simple interface with gwt-ext (a simpoe form with two
input fields: the request and the response field).
In the first field (request) i type an id person, then call a service
(hibernate) thats returns (a single string) on response field the
surname of that id. All works.
But now i've a doubt: if i want an entire record:
1) on server side what must i return? a List object?
2) on client side how i read the object?

Any help will be appreciated.
Regards.

noon

unread,
May 7, 2008, 4:57:58 AM5/7/08
to Google Web Toolkit
Hi,

Your RPC service can return the entire object without problem.
You just have to do the correct cast on client side.

Regards
Bruno

_panic_

unread,
May 7, 2008, 5:00:36 AM5/7/08
to Google Web Toolkit
Hi Bruno, tanks for quick annswer.
Can u post me a little sample?
Can i return a list, for example?
An how i cast it on client side?

_panic_

unread,
May 7, 2008, 5:00:45 AM5/7/08
to Google Web Toolkit
Hi Bruno, tanks for quick annswer.
Can u post me a little sample?
Can i return a list, for example?
An how i cast it on client side?

On 7 Mag, 10:57, noon <bruno.marches...@gmail.com> wrote:

noon

unread,
May 7, 2008, 11:06:35 AM5/7/08
to Google Web Toolkit
Better : hibernate4gwt provides (simple) sample application, available
on download page.
It is quite easy to understand (I hope so) and it has all the answers
you need to startup.

Hope this helps
Bruno

EugeneS

unread,
May 7, 2008, 4:40:19 AM5/7/08
to Google Web Toolkit
Hello.
In your example you should return a String object (on server side).
You should use a List object (on server side and on client side) if
you want to work with lists.
You said that you use hibernate4gwt. So you can simplify you work:
look at http://hibernate4gwt.sourceforge.net/getting_started.html

_panic_

unread,
May 7, 2008, 4:54:29 PM5/7/08
to Google Web Toolkit
I've beenthe proof but ... nothing.
I've made needed changes in order to return a List, but i received
always
"Type '[Ljava.lang.Object;' was not included in the set of types which
can be serialized by this SerializationPolicy or its Class object
could not be loaded. For security purposes, this type will not be
serialized.".

My scenario:
1) GWT 1.5 MILESTONE 1
2) GWT SERVER LIBRARY
3) GWT-EXT (not important)
3) SPRING 2.52
4) Hibernate (as spring - dependency)
5) Hibernate annotation
6) Hibernate4gwt

I run the app in hosted-mode, but in a external tomcat server (it's
very helpful in debug).
In my web-xml i splitted my conf, and the relevant file are follows:

1) Contents of applicationContextDataSource.xml:

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property
name="driverClassName"><value>oracle.jdbc.driver.OracleDriver</value></
property>
<property name="url"><value>jdbc:oracle:thin:@localhost:1521:MYSID</
value></property>
<property name="username" value="myuser" />
<property name="password" value="mypass" />
<property name="initialSize" value="5" />
<property name="maxActive" value="10" />
</bean>

<bean id = "hibernateTemplate" class =
"org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory" ref="sessionFactory" />
</bean>



<bean id = "sessionFactory" class =
"org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref = "dataSource" />
<property name="configLocation">
<value>/WEB-INF/hibernate.cfg.xml</value>
</property>
<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration</value>
</property>
<property name = "hibernateProperties">
<props>
<prop
key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
</props>
</property>
</bean>


2) Contents of applicationContextDomain.xml:
<bean id="anagraficheService" class =
"com.mycompany.students.AnagraficheServiceImpl">
<property name="sessionFactory">
<ref bean = "sessionFactory" />
</property>
<property name="hibernateManager">
<ref bean="hibernateBeanManager" />
</property>
</bean>


<bean id="hibernateBeanManager"
class="net.sf.hibernate4gwt.core.HibernateBeanManager">
<property name="pojoStore" ref="pojoStore" />
<property name="sessionFactory" ref="sessionFactory" />
</bean>

<bean id="pojoStore"
class="net.sf.hibernate4gwt.core.store.stateless.StatelessPojoStore" /
>

3) My hibernate.cfg.xml looks like this:
<hibernate-configuration>
<session-factory>
<mapping class="com.mycompany.students.domain.Anagrafiche"/>
</session-factory>
</hibernate-configuration>



Next, my hibernate pojo class Anagrafiche (located in domain package)
extends LazyGwtPojo.
In the client package, i've AnagraficheService interface thats look
like this:

public interface AnagraficheService extends RemoteService {

public static final String SERVICE_URI = "../../MyService/
AnagraficheService";
//public String findByCodiceFiscale(String codicefiscale);

List <Anagrafiche> findAllByCodIstatRes(String codistatres);

public static class Util {

public static AnagraficheServiceAsync getInstance() {

AnagraficheServiceAsync instance = (AnagraficheServiceAsync)
GWT.create(AnagraficheService.class);
ServiceDefTarget target = (ServiceDefTarget) instance;
target.setServiceEntryPoint(GWT.getModuleBaseURL() + SERVICE_URI);
return instance;
}
}

}

I've vrited a simple method findAllByCodIstatRes thats return a list
of type <Anagrafiche> (hib. pojo);

In the implementation, under server package, i've:


public class AnagraficheServiceImpl extends HibernateRemoteService
implements AnagraficheService

/*

...

*/
public List<Anagrafiche> findAllByCodIstatRes(String codistatres)
{

Query qry =
this.sessionFactory.openSession().createSQLQuery("SELECT * FROM
Anagrafiche WHERE COD_ISTAT_RES='" + codistatres + "'");




return qry.list();


}

where private local variable sessionFactory is injected at
configuration level by spring servlet, when tomcat runs; in fact
within
AnagraficheServiceImpl i've implemented a method called
setSessionFactory where spring (via IoC) sets the local variable at
startup.
I believe that follow all needed steps published under "getting
started" link at hibernate4gwt site, but i got always same error.
My full stack trace:
GRAVE: Exception while dispatching incoming RPC call
java.lang.RuntimeException:
com.google.gwt.user.client.rpc.SerializationException:
java.lang.reflect.InvocationTargetException
at
org.gwtwidgets.server.spring.GWTRPCServiceExporter.handleExporterProcessingException(GWTRPCServiceExporter.java:
368)
at
org.gwtwidgets.server.spring.GWTRPCServiceExporter.processCall(GWTRPCServiceExporter.java:
337)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:
85)
at
org.gwtwidgets.server.spring.GWTRPCServiceExporter.handleRequest(GWTRPCServiceExporter.java:
386)
at
org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:
49)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:
874)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:
808)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:
523)
at
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:
463)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
286)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
844)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:
447)
at java.lang.Thread.run(Unknown Source)
Caused by: com.google.gwt.user.client.rpc.SerializationException:
java.lang.reflect.InvocationTargetException
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeWithCustomSerializer(ServerSerializationStreamWriter.java:
660)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl(ServerSerializationStreamWriter.java:
624)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:
558)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:
82)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter
$ValueWriter$8.write(ServerSerializationStreamWriter.java:89)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:
473)
at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:573)
at
com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java:
441)
at
org.gwtwidgets.server.spring.GWTRPCServiceExporter.invokeMethodOnService(GWTRPCServiceExporter.java:
158)
at
org.gwtwidgets.server.spring.GWTRPCServiceExporter.processCall(GWTRPCServiceExporter.java:
316)
... 21 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeWithCustomSerializer(ServerSerializationStreamWriter.java:
645)
... 30 more
Caused by: com.google.gwt.user.client.rpc.SerializationException: Type
'[Ljava.lang.Object;' was not included in the set of types which can
be serialized by this SerializationPolicy or its Class object could
not be loaded. For security purposes, this type will not be
serialized.
at
com.google.gwt.user.server.rpc.impl.StandardSerializationPolicy.validateSerialize(StandardSerializationPolicy.java:
83)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:
556)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:
82)
at
com.google.gwt.user.client.rpc.core.java.util.ArrayList_CustomFieldSerializer.serialize(ArrayList_CustomFieldSerializer.java:
43)
... 35 more


Please help me!!!
Best regards












On 7 Mag, 10:40, EugeneS <Eugene.Sa...@gmail.com> wrote:
> Hello.
> In your example you should return a String object (on server side).
> You should use a List object (on server side and on client side) if
> you want to work with lists.
> You said that you use hibernate4gwt. So you can simplify you work:
> look athttp://hibernate4gwt.sourceforge.net/getting_started.html

gregor

unread,
May 7, 2008, 7:16:24 PM5/7/08
to Google Web Toolkit
Hi _panic_,

Can you clarify a few things:

1) Are you saying this runs fine in hosted mode but breaks when you
deploy to Tomcat server?
2) How are you deplying the app to your Tomcat server? Are you using
an Ant script to build a WAR?

The most likely reason for your problem from the information you've
given is that the class Anagrafiche is not listed in one of the
generated GWT files called A1B2BC3..........X7YY9Z.gwt.rpc. This is
the so-called "white list" of classes that GWT authorizes itself to
serailize out to the client. If Anagrafiche is not listed in one of
these you will get a
com.google.gwt.user.client.rpc.SerializationException thrown when
attempting to return an instance of it from an RPC call.

This is what is meant by:

"Type '[Ljava.lang.Object;' was not included in the set of types which
can be serialized by this SerializationPolicy or its Class object
could not be loaded. For security purposes, this type will not be
serialized.".

If you use a correct Ant script to build a WAR, the GWT compiler
should make sure these files are created for you, and the war task
should include them in the WAR file along with the generated js, CSS
and HTML files for the app.

regards
gregor
> ...
>
> read more >>

_panic_

unread,
May 8, 2008, 3:41:55 AM5/8/08
to Google Web Toolkit
It's very strange, because when i make some changes on the code, i
recompile
the app and copy the .rpc file under /myworkspace/servers/
mytomcatconfig/

The .rpc file look like this;
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException,
true
it.unipa.studenti.domain.Anagrafiche, true
java.lang.Integer, true
java.lang.Number, false
java.lang.String, true
java.sql.Timestamp, true
java.util.ArrayList, true
java.util.Date, false
java.util.LinkedList, true
java.util.Stack, true
java.util.Vector, true
net.sf.hibernate4gwt.pojo.gwt.LazyGwtPojo, false

As you can see, Anagrafiche pojo is listed, but still get same error.

Regards
> ...
>
> leggi tutto

_panic_

unread,
May 8, 2008, 4:11:01 AM5/8/08
to Google Web Toolkit
Only une doubt: last rows of .rpf file is:
"net.sf.hibernate4gwt.pojo.gwt.LazyGwtPojo, false"
What is the exact maening of this?
> ...
>
> leggi tutto

_panic_

unread,
May 8, 2008, 4:31:30 AM5/8/08
to Google Web Toolkit
Oh, sorry, forgot answer to you r question:
I'm using eclipse + cypal studio (an eclipse plug-in for gwt).
I run the app in hosted mode under a pre-configured server (tomcat 6)
with eclipse.
When i build the app, in order to compile java->javascript, i copy the
fresh files (including the .rpc file) under /myworkspace/servers/
MyPreconfiguredTomcatServer/.

With this scenario i'm not able to send rpc calls to server.
Never deployed the app to war file.
I still run only in hosted-mode with a server configured by me; no
embeeded server use.
regards
> ...
>
> leggi tutto

gregor

unread,
May 8, 2008, 5:32:32 AM5/8/08
to Google Web Toolkit
Hi _panic_,


On May 8, 9:11 am, _panic_ <riboriori.ribori...@libero.it> wrote:
> Only une doubt: last rows of .rpf file is:
> "net.sf.hibernate4gwt.pojo.gwt.LazyGwtPojo, false"
> What is the exact maening of this?

Have you tried manually editing the .rpc file to change it to
"net.sf.hibernate4gwt.pojo.gwt.LazyGwtPojo, false"?

regards
gregor

gregor

unread,
May 8, 2008, 5:42:09 AM5/8/08
to Google Web Toolkit
Sorry, I mean obviously change it to
"net.sf.hibernate4gwt.pojo.gwt.LazyGwtPojo, true"?

_panic_

unread,
May 8, 2008, 7:53:27 AM5/8/08
to Google Web Toolkit
Yes i did.
Same error.
I cant understand why fires that error.

gregor

unread,
May 8, 2008, 8:26:10 AM5/8/08
to Google Web Toolkit
Ah, i think this may be it - check the following post over at Bruno's
hibernate4gwt forum as it looks to be about the same thing as your
problem:

http://sourceforge.net/forum/forum.php?thread_id=2010476&forum_id=689608

Bruno's answer is:

"The stack trace tells me that you are using the regular
GWTRPCServiceExporter and not the HB4GWTRPCServiceExporter, which is
needed for integrating the two libraries"

and you indeed have:

org.gwtwidgets.server.spring.GWTRPCServiceExporter.invokeMethodOnService(GWTRPCServiceExporter.java:
158)
at
org.gwtwidgets.server.spring.GWTRPCServiceExporter.processCall(GWTRPCServiceExporter.java:
316)

I would check this out, and if still no joy, I would post this issue
on Bruno's forum.

regards
gregor

_panic_

unread,
May 8, 2008, 8:56:22 AM5/8/08
to Google Web Toolkit
Yeah, tanks!!!!
Now i will made the needed changes and post the results!
Regards.

_panic_

unread,
May 8, 2008, 1:56:47 PM5/8/08
to Google Web Toolkit
In the official page (http://gwt-widget.sourceforge.net/?q=node/49),
in wich
explain how to use HB4GWTRPCServiceExporter, there is a comments
about:
"As of Hibernate4GWT
v1.0 the SL has the HB4GWTRPCServiceExporter which is an adaption of
HibernateRemoteService and can be used similar to the
GWTRPCServiceExporter";
is this is true, must i extend my service implementation from
HB4GWTRPCServiceExporter, instead of HibernateRemoteService?
I tried it. In addiction i modified my configuration spring context as
follows:

<bean id="anagraficheService" class =
"it.unipa.studenti.server.AnagraficheServiceImpl">
<property name="sessionFactory">
<ref bean = "sessionFactory" />
</property>
<property name="beanManager">
<ref bean="hibernateBeanManager" />
</property>
</bean>




<bean id="hibernateBeanManager"
class="net.sf.hibernate4gwt.core.HibernateBeanManager">
<property name="pojoStore" ref="pojoStore" />
<property name="sessionFactory" ref="sessionFactory" />
</bean>



<bean id="HB4GWTRPCService"
class="org.gwtwidgets.server.spring.hb4gwt.HB4GWTRPCServiceExporter">
<property name="beanManager" ref="hibernateBeanManager" />
<property name="service" ref="anagraficheService" />
</bean>

<bean id="pojoStore"
class="net.sf.hibernate4gwt.core.store.stateless.StatelessPojoStore" /
>


<bean id = "sessionFactory" class =
"org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref = "dataSource" />
<property name="configLocation">
<value>/WEB-INF/hibernate.cfg.xml</value>
</property>
<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration</value>
</property>
<property name = "hibernateProperties">
<props>
<prop
key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
</props>
</property>
</bean>


But when i start tomcat server i get follow errors:
8-mag-2008 19.51.12 org.apache.tomcat.util.digester.SetPropertiesRule
begin
AVVERTENZA: [SetPropertiesRule]{Server/Service/Engine/Host/Context}
Setting property 'source' to 'org.eclipse.jst.j2ee.server:Studenti'
did not find a matching property.
8-mag-2008 19.51.12 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path: C:\Programmi\Java\jre1.6.0_04\bin;.;C:\WINDOWS\Sun
\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Programmi\Java
\jre1.6.0_04\bin\client;C:\Programmi\Java\jre1.6.0_04\bin;C:\oracle
\product\10.2.0\db_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS
\System32\Wbem;c:\oracle_instant_client;c:\oracle_instant_client
\network\admin;C:\Programmi\Microsoft Platform SDK\Bin\.;C:\Programmi
\Microsoft Platform SDK\Bin\WinNT\.;C:\Sun\SDK\bin;C:\Programmi\SSH
Communications Security\SSH Secure Shell;c:\oracle_instant_client;C:
\Programmi\Microsoft Platform SDK\Bin\.;C:\Programmi\Microsoft
Platform SDK\Bin\WinNT\.
8-mag-2008 19.51.12 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
8-mag-2008 19.51.12 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 532 ms
8-mag-2008 19.51.12 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
8-mag-2008 19.51.12 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
8-mag-2008 19.51.12 org.apache.catalina.loader.WebappClassLoader
validateJarFile
INFO: validateJarFile(C:\Documents and Settings\sergio\workspace
\.metadata\.plugins\org.eclipse.wst.server.core\tmp6\wtpwebapps
\Studenti\WEB-INF\lib\gwt-user.jar) - jar not loaded. See Servlet Spec
2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
8-mag-2008 19.51.12 org.apache.catalina.core.StandardContext
addApplicationListener
INFO: The listener
"org.springframework.web.context.ContextLoaderListener" is already
configured for this context. The duplicate definition has been
ignored.
log4j:WARN No appenders could be found for logger
(org.springframework.util.ClassUtils).
log4j:WARN Please initialize the log4j system properly.
8-mag-2008 19.51.13 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
8-mag-2008 19.51.16 org.apache.catalina.core.StandardContext
listenerStart
GRAVE: Exception sending context initialized event to listener
instance of class
org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'anagraficheService' defined in ServletContext
resource [/WEB-INF/domain.xml]: Invocation of init method failed;
nested exception is java.lang.Exception: HibernateBeanManager not set
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:
1302)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:
463)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
$1.run(AbstractAutowireCapableBeanFactory.java:404)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:
375)
at org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:263)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:
170)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:
260)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:
184)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:
163)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:
430)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:
729)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:
381)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:
254)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:
198)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:
45)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:
3843)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:
4350)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:
443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:
516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:
710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.Exception: HibernateBeanManager not set
at
org.gwtwidgets.server.spring.hb4gwt.HB4GWTRPCServiceExporter.afterPropertiesSet(HB4GWTRPCServiceExporter.java:
30)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:
1333)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:
1299)
... 30 more
8-mag-2008 19.51.16 org.apache.catalina.core.StandardContext start
GRAVE: Error listenerStart
8-mag-2008 19.51.16 org.apache.catalina.core.StandardContext start
GRAVE: Context [/Studenti] startup failed due to previous errors
8-mag-2008 19.51.16 org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
8-mag-2008 19.51.16 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
8-mag-2008 19.51.16 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
8-mag-2008 19.51.16 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/47 config=null
8-mag-2008 19.51.16 org.apache.catalina.startup.Catalina start
INFO: Server startup in 4625 ms


Any help???

_panic_

unread,
May 8, 2008, 2:05:39 PM5/8/08
to Google Web Toolkit
Another hint: in the official page, there are 2 infos:
1) HB4GWTRPCServiceExporter is an adaption for HibernateRemoteService,
so i extended my implementation service (AnagraficheServiceImpl)
from HB4GWTRPCServiceExporter, instead from HibernateRemoteService:

public class AnagraficheServiceImpl extends HB4GWTRPCServiceExporter /
*HibernateRemoteService*/ implements AnagraficheService
{
...
}


2) "The HibernateBeanManager class must then be injected in every
HibernateRemoteService class" (from the site), so i
made this task via IoC spring container as follows:
<bean id="anagraficheService" class =
"it.unipa.studenti.server.AnagraficheServiceImpl">
<property name="sessionFactory">
<ref bean = "sessionFactory" />
</property>
<property name="beanManager">
<ref bean="hibernateBeanManager" />
</property>
</bean>

<bean id="hibernateBeanManager"
class="net.sf.hibernate4gwt.core.HibernateBeanManager">
<property name="pojoStore" ref="pojoStore" />
<property name="sessionFactory" ref="sessionFactory" />
</bean>

I used sessionFactory injection too, because it a facility in order to
create and executing queries.
Another info: as urlmapper i use GWTHandler.
If i must not use it, can i replace with simpleurlmapping of spring?

Any elp will be appreciated.
Regards.
Sergio
> ...
>
> legi tutto
Reply all
Reply to author
Forward
0 new messages