Hi Matt,
This is the first time I'm developing a portlet application. I modified
AppFuse to be used in a portlet environment (there are still a few issues to
solve). I develop on AppFuse Modular Struts2+Spring+Hibernate.
DWR uses a servlet to attend the requests (what goes apart from portlet
environment). I planned to use the Managers from the Core Module to collect
the data, but I got the IllegalArgumentException.
Using this simple classes, everything goes right:
public interface AutorService {
public Autor get(String id);
}
public class AutorServiceImpl implements AutorService {
private AutorManager autorManager;
public void setAutorManager(AutorManager autorManager) {
this.autorManager = autorManager;
}
public Autor get(String id) {
return autorManager.get(new Long(id));
}
}
Configuration:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.directwebremoting.org/schema/spring-dwr
http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd">
<dwr:configuration>
<dwr:convert type="hibernate3"
class="com.proy.model.produccion.Autor"/>
<dwr:convert type="hibernate3"
class="com.proy.model.produccion.AutorTipo"/>
<dwr:convert type="hibernate3"
class="com.proy.model.distribucion.Cliente"/>
<dwr:convert type="hibernate3"
class="com.proy.model.distribucion.ClienteTipoIdentificacion"/>
<dwr:convert type="hibernate3"
class="com.proy.model.distribucion.ClienteTipo"/>
<dwr:convert type="hibernate3"
class="com.proy.model.produccion.AutorSituacion"/>
</dwr:configuration>
<bean id="autorService"
class="com.proy.webapp.service.impl.AutorServiceImpl">
<property name="autorManager" ref="autorManager"/>
<dwr:remote javascript="AutorService">
<dwr:include method="get"/>
</dwr:remote>
</bean>
</beans>
Maybe the aop proxies could be the cause of the problem, but I'm not really
sure.
david
mraible wrote:
>
> Have you used another application with your stack of choice in
> Liferay? AppFuse generally leverages the Servlet API, not the Portlet
> API - so it's unlikely it'll work properly in a portlet environment.
>
> Matt
>
> On 9/3/07, David Tercero <[EMAIL PROTECTED]> wrote:
>>
>> Hi, I've disabled acegi's security, but the error still occurs (I'm using
>> it
>> under portlet environment, liferay, and that's suppose to be done by the
>> portal).
>>
>> david.
>>
>>
>> fadhlirahim wrote:
>> >
>> > Maybe you should include the dwr path in security.xml
>> >
>> > /dwr/*
>> >
>> > On 8/31/07, David Tercero <[EMAIL PROTECTED]> wrote:
>> >>
>> >>
>> >> Hi all,
>> >>
>> >> I plan to use DWR as my ajax framework because it is included in
>> >> Appfuse
>> >> 2.0. But I get an exception when doing a call to the service layer:
>> >>
>> >> Ok, I start from the beginig. I use Appfuse 2.0 M5, DWR 2.0.1. I
>> >> define
>> >> a
>> >> bean:
>> >>
>> >> <bean id="autorManager"
>> class="com.proy.service.impl.AutorManagerImpl">
>> >> <constructor-arg ref="autorDao"/>
>> >> <property name="contratoDao" ref="contratoDao"/>
>> >> <property name="liquidacionDao" ref="liquidacionDao"/>
>> >> <dwr:remote javascript="AutorManager">
>> >> <dwr:include method="get"/>
>> >> <dwr:include method="getSituaciones"/>
>> >> <dwr:convert type="bean" class="
>> >> com.proy.model.produccion.Autor"/>
>> >> <dwr:convert type="bean"
>> >> class="com.proy.model.produccion.AutorSituacion"/>
>> >> </dwr:remote>
>> >> </bean>
>> >>
>> >> I configure dwr inside the Spring's bean file (it's the same as
>> >> dwr.xml
>> >> ).
>> >> I get this exception when calling getSituaciones method from the dwr
>> >> debug
>> >> page:
>> >>
>> >> INFO [http-8080-Processor25] DefaultRemoter.info(51) | Exec:
>> >> AutorManager.getSituaciones()
>> >> WARN [http-8080-Processor25] DefaultRemoter.warn(67) | Method
>> execution
>> >> failed:
>> >> java.lang.IllegalArgumentException: object is not an instance of
>> >> declaring
>> >> class
>> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> >> at
>> >>
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
>> >> :39)
>> >> at
>> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(
>> >> DelegatingMethodAccessorImpl.java:25)
>> >> at java.lang.reflect.Method.invoke(Method.java:585)
>> >> at
>> >> org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(
>> >> ExecuteAjaxFilter.java:34)
>> >> at
>> >>
>> org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java
>> >> :428)
>> >> at
>> >>
>> org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:431)
>> >> at
>> >>
>> org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283)
>> >> at
>> >> org.directwebremoting.servlet.PlainCallHandler.handle(
>> >> PlainCallHandler.java:52)
>> >> at org.directwebremoting.servlet.UrlProcessor.handle(
>> >> UrlProcessor.java:101)
>> >> at
>> >>
>> org.directwebremoting.spring.DwrSpringServlet.doPost(DwrSpringServlet.java
>> >> :158)
>> >> at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>> >> at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>> >> at
>> >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>> >> ApplicationFilterChain.java:252)
>> >> at
>> >> org.apache.catalina.core.ApplicationFilterChain.doFilter(
>> >> ApplicationFilterChain.java:173)
>> >> at
>> >> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(
>> >> FilterDispatcher.java:413)
>> >> at
>> >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>> >> ApplicationFilterChain.java:202)
>> >> at
>> >> org.apache.catalina.core.ApplicationFilterChain.doFilter(
>> >> ApplicationFilterChain.java:173)
>> >> at
>> >>
>> org.appfuse.webapp.filter.StaticFilter.doFilterInternal(StaticFilter.java
>> >> :102)
>> >> at
>> >> org.springframework.web.filter.OncePerRequestFilter.doFilter(
>> >> OncePerRequestFilter.java:75)
>> >> at
>> >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>> >> ApplicationFilterChain.java:202)
>> >> at
>> >> org.apache.catalina.core.ApplicationFilterChain.doFilter(
>> >> ApplicationFilterChain.java:173)
>> >> at
>> >> org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(
>> >> ActionContextCleanUp.java:99)
>> >> at
>> >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>> >> ApplicationFilterChain.java:202)
>> >> at
>> >> org.apache.catalina.core.ApplicationFilterChain.doFilter(
>> >> ApplicationFilterChain.java:173)
>> >> at
>> >> org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(
>> >> UrlRewriteFilter.java:350)
>> >> at
>> >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>> >> ApplicationFilterChain.java:202)
>> >> at
>> >> org.apache.catalina.core.ApplicationFilterChain.doFilter(
>> >> ApplicationFilterChain.java:173)
>> >> at
>> >>
>> org.appfuse.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java
>> >> :63)
>> >> at
>> >> org.springframework.web.filter.OncePerRequestFilter.doFilter(
>> >> OncePerRequestFilter.java:75)
>> >> at
>> >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>> >> ApplicationFilterChain.java:202)
>> >> at
>> >> org.apache.catalina.core.ApplicationFilterChain.doFilter(
>> >> ApplicationFilterChain.java:173)
>> >> at
>> >>
>> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(
>> >> CharacterEncodingFilter.java:96)
>> >> at
>> >> org.springframework.web.filter.OncePerRequestFilter.doFilter(
>> >> OncePerRequestFilter.java:75)
>> >> at
>> >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>> >> ApplicationFilterChain.java:202)
>> >> at
>> >> org.apache.catalina.core.ApplicationFilterChain.doFilter(
>> >> ApplicationFilterChain.java:173)
>> >> at
>> >> org.apache.catalina.core.StandardWrapperValve.invoke(
>> >> StandardWrapperValve.java:213)
>> >> at
>> >> org.apache.catalina.core.StandardContextValve.invoke(
>> >> StandardContextValve.java:178)
>> >> at
>> >>
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
>> >> :126)
>> >> at
>> >>
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
>> >> :105)
>> >> at
>> >> org.apache.catalina.core.StandardEngineValve.invoke(
>> >> StandardEngineValve.java:107)
>> >> at
>> >> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
>> >> :148)
>> >> at
>> >>
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>> >> at
>> >>
>> >>
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
>> >> (Http11BaseProtocol.java:664)
>> >> at
>> >> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
>> >> PoolTcpEndpoint.java:527)
>> >> at
>> >> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
>> >> LeaderFollowerWorkerThread.java:80)
>> >> at
>> >> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
>> >> ThreadPool.java:684)
>> >> at java.lang.Thread.run(Thread.java:595)
>> >> [pol] WARN [http-8080-Processor25] BaseCallMarshaller.warn(59) |
>> >> --Erroring:
>> >> batchId[0] message[java.lang.IllegalArgumentException: object is not
>> an
>> >> instance of declaring class]
>> >>
>> >> I don't know where exactly is the issue, but I think it would be
>> >> related
>> >> to aspectj proxying.
>> >>
>> >> Any help?
>> >>
>> >> thanks in advance.
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Appfuse-2.0-M5%2C-DWR-problem-tf4359652s2369.html#a12424905
>> >> Sent from the AppFuse - User mailing list archive at Nabble.com.
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >
>> >
>> > --
>> > /fadhli
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Appfuse-2.0-M5%2C-DWR-problem-tf4359652s2369.html#a12457803
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> http://raibledesigns.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Appfuse-2.0-M5%2C-DWR-problem-tf4359652s2369.html#a12463799
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]