GWT with spring security not working on app engine live server.
- by bedanand
I configured gwt with spring and spring security that works fine on local development server on google app engine.
I deployed to the appspot but there it shows critical error when i see on the log.
and on the browser side shows 500 server error.
log error
Uncaught exception from servlet
javax.servlet.UnavailableException: Initialization failed.
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:200)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:168)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123)
at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:243)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5838)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5836)
at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:398)
at com.google.net.rpc.impl.Server$2.run(Server.java:852)
at com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56)
at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:576)
at com.google.net.rpc.impl.Server.startRpc(Server.java:807)
at com.google.net.rpc.impl.Server.processRequest(Server.java:369)
at com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:442)
at com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319)
at com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:290)
at com.google.net.async.Connection.handleReadEvent(Connection.java:474)
at com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:831)
at com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:207)
at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:103)
at com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:251)
at com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run(JavaRuntime.java:404)
at java.lang.Thread.run(Unknown Source)
web.xml
<web-app>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.rpc</url-pattern>
</servlet-mapping>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>PushUrl.html</welcome-file>
</welcome-file-list>
</web-app>
appengine-web.xml
<application>pushurl</application>
<version>1</version>
<!-- Configure java.util.logging -->
<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
</system-properties>
<sessions-enabled>true</sessions-enabled>
applicationContext.xml
<security:http auto-config="true">
<security:intercept-url pattern="/**/users.rpc" access="ROLE_USER"/>
<security:intercept-url pattern="/**/categories.rpc" access="ROLE_ADMIN"/>
<security:intercept-url pattern="/css/**" filters="none"/>
<security:intercept-url pattern="/login.jsp*" filters="none"/>
<security:form-login login-page='/login.jsp' />
</security:http>
<security:authentication-manager>
<security:authentication-provider>
<security:user-service>
<security:user name="jimi" password="jimi"
authorities="ROLE_USER, ROLE_ADMIN" />
<security:user name="bob" password="bob"
authorities="ROLE_USER" />
</security:user-service>
</security:authentication-provider>
</security:authentication-manager>
dispatcher-servlet.xml
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<value>
/**/users.rpc=userService
/**/categories.rpc=categoryService
</value>
</property>
</bean>
<bean id="userController" class="com.beda.pushurl.server.GwtRpcController">
<property name="remoteService" ref="userService">
</property>
</bean>
<bean id="userService" class="com.beda.pushurl.server.UserServiceImpl" >
<property name="userDAO" ref="myUserDAO"></property>
</bean>
<bean id="categoryService" class="com.beda.pushurl.server.CategoryServiceImpl">
<property name="categoryDAO" ref="myCategoryDAO"></property>
</bean>
<bean id="myUserDAO" class="com.beda.pushurl.server.dao.UserDAOImpl">
</bean>
<bean id="myCategoryDAO" class="com.beda.pushurl.server.dao.CategoryDAOImpl">
</bean>