Usando o Remoting plugin
19/04/2010 00:00
0
Gente, eu vi no tutorial: http://www.grails.org/Remoting+Plugin a parte de configuração para a utilização do httpinvoker:

tenho a minha classe de serviço com a configuração:

package pt

class CalendarioService {

static remote = [
protocol: 'http',
iface: pt.ptinovacao.be.corporative.service.ManageScheduleService,
host: '10.51.161.161',
port: '8223',
webcontext: 'beCorporativeWAR',
]

}


e no entanto ao tentar grails run-app é dado um erro enorme:
2010-04-19 15:33:31,362 [main] ERROR context.ContextLoader - Context initialization failed
org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is java.lang.IllegalStateException: No bean class
specified on bean definition
at org.codehaus.groovy.grails.web.context.GrailsContextLoader.createWebApplicationContext(GrailsContextLoader.java:75)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
.
.
.
Caused by: java.lang.IllegalStateException: No bean class specified on bean definition
.
.
.
2010-04-19 15:33:32,299 [main] ERROR [localhost].[/AppCalendario] - Exception sending context initialized event to listener instance of class org.codehaus
.groovy.grails.web.context.GrailsContextLoaderListener
org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is java.lang.IllegalStateException: No bean class specified on bean definition
.
.
.
2010-04-19 15:33:33,221 [main] ERROR core.StandardContext - Error listenerStart
2010-04-19 15:33:33,237 [main] ERROR core.StandardContext - Context [/AppCalendario] startup failed due to previous errors
Server running. Browse to <!-- m --><a class="postlink" href="http://localhost:8080/AppCalendario">http://localhost:8080/AppCalendario</a><!-- m -->

e ao acessar da erro 404

quando eu coloco chaves{} ao invez de colchetes []
package pt

class CalendarioService {

static remote = {
protocol: 'http',
iface: pt.ptinovacao.be.corporative.service.ManageScheduleService,
host: '10.51.161.161',
port: '8223',
webcontext: 'beCorporativeWAR',
}

}


Environment set to development
[groovyc] Compiling 2 source files to D:\Grails\workspace_grails\AppCalendario\target\classes
[groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, D:\Grails\workspace_grails\AppCalendario\grails-app\services\pt
\CalendarioService.groovy: 6: unexpected token: http @ line 6, column 19.
[groovyc] protocol: 'http',
[groovyc] ^
[groovyc]
[groovyc] 1 error
Compilation error: Compilation Failed

o que ocorre???
ele não está conseguindo resolver esse protocolo? ou eu estou fazendo errado????

obrigado pela atenção!
Tags: Groovy


0
Consegui,

package pt

class CalendarioService {

static remote = [
protocol: 'httpinvoker',
iface: pt.ptinovacao.be.corporative.service.ManageScheduleService,
host: '10.51.161.161',
port: '8223',

]

}


mas agora me da esse erro:



2010-04-19 17:04:04,187 [http-8080-1] ERROR errors.GrailsExceptionResolver - Cannot invoke method getSchedule() on null object
java.lang.NullPointerException: Cannot invoke method getSchedule() on null object
at pt.CalendarioController$_closure2.doCall(CalendarioController.groovy:13)
at pt.CalendarioController$_closure2.doCall(CalendarioController.groovy)
at java.lang.Thread.run(Thread.java:595)
2010-04-19 17:04:04,468 [http-8080-1] ERROR [Tomcat].[localhost] - Exception Processing ErrorPage[errorCode=500, location=/grails-errorhandler]
java.lang.IllegalStateException: Cannot reset buffer after response has been committed
at org.apache.catalina.connector.Response.resetBuffer(Response.java:691)
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:409)
at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:343)
at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:287)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
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:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:595)


saberiam o que poderia ser?????

OBRIGADO GALERA!!!
19/04/2010 00:00



Ainda não faz parte da comunidade???

Para se registrar, clique aqui.


Aprenda Groovy e Grails com a Formação itexto!

Newsletter Semana Groovy

Assinar

Envie seu link!


Livro de Grails


/dev/All

Os melhores blogs de TI (e em português) em um único lugar!

 
Creative Commons
RSS Grails Brasil é mantido por itexto Consultoria.
Em caso de problemas contacte Henrique Lobo Weissmann (Kico) por e-mail: kico@itexto.com.br
Todo o conteúdo presente neste site adota o Creative Commons como licença padrão.
Ver: 4.14.0
itexto