demos

96 views
Skip to first unread message

Matthew Pocock

unread,
May 9, 2012, 12:43:02 PM5/9/12
to gwtse...@googlegroups.com
Hi,

I have tried to run the three demo wars in glassfish, but all three fail with the same problem:

Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.gwt.ss.GwtExceptionTranslator#0' defined in class path resource [applicationContext-security.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/slf4j/spi/LoggerFactoryBinder. Please see server.log for more details.

I have tried adding slf4j-log4j12-1.6.4.jar as an extra library during the glassfish deployment, but that's not worked.

I would really like to see these demos running on my local machine. Am I doing something wrong? Is there a known setup where they work?

Thanks,

Matthew

Matthew Pocock

unread,
May 9, 2012, 1:07:53 PM5/9/12
to gwtse...@googlegroups.com
I got gssDemo1 to deploy by modifying the pom and adding the dependency:

<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-log4j12</artifactId>
  <version>1.6.4</version>
</dependency>

I also made this change to gssDemo2 and gssDemo3, but these fail to deploy in glassfish with:

Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [applicationContext-mvc.xml] Offending resource: class path resource [applicationContext.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/mvc] Offending resource: class path resource [applicationContext-mvc.xml] . Please see server.log for more details.
--
Dr Matthew Pocock
Integrative Bioinformatics Group, School of Computing Science, Newcastle University
skype: matthew.pocock
tel: (0191) 2566550

Matthew Pocock

unread,
May 9, 2012, 1:39:00 PM5/9/12
to gwtse...@googlegroups.com
So, for gssDemo2 I also had to add this dependency to the pom and rebuild the war:

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>

For gssDemo3 I had to add this and additionally add:

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.version}</version>
        </dependency>

I can't help feeling that these dependencies where left out for a very good reason, and that I'm trying to deploy these wars in an unsupported environment. Any words of wisdom?

Thanks,

Matthew

Matthew Pocock

unread,
May 9, 2012, 2:01:43 PM5/9/12
to gwtse...@googlegroups.com
Sorry for spamming this list. However, I think I'm making progress and perhaps if this gets google-indexed, others may have a happier time than me.

Firstly, I was working from the 1.1.0 release. I've now checked out a read-only trunk from svn, and have found gwsDemo4 demonstrating OpenID security, which is what I was after all the while.

To make this work, I had to edit the pom.

--- pom.xml (revision 155)
+++ pom.xml (working copy)
@@ -25,6 +25,10 @@
             <url>http://maven.springframework.org/milestone</url>
         </repository>
+        <repository>
+            <id>SpringSource Enterprise Bundle Repositories</id>
+        </repository>
     </repositories>
     <!--Override dependency version-->  
     <properties>
@@ -84,7 +88,7 @@
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
-            <artifactId>org.springframework.web.servlet</artifactId>
+            <artifactId>spring-webmvc</artifactId>
             <version>${org.springframework.version}</version>
         </dependency>
         <dependency>


After this chance, it deployed to glassfish without any problems and worked first time. Can't improve on that. Thanks for the demos.

Matthew

Matthew Pocock

unread,
May 9, 2012, 4:07:00 PM5/9/12
to Steven Jardine, gwtse...@googlegroups.com
I'd previously only tested deploying demo1..3 from the 1.1.0 release. From trunk, against spring 3, there are some other tweaks.

The http element contained an exclusion for filtering /**/demo1 so that it's possible to view the demo without being logged in. The syntax for that has changed. It now needs one http element for the unsecured resource and another for the secured ones. The same change was needed for demo2 and demo3. Demo4 already had the right form.

Matthew

Index: gssDemo1/src/main/resources/applicationContext-security.xml
===================================================================
--- gssDemo1/src/main/resources/applicationContext-security.xml (revision 156)
+++ gssDemo1/src/main/resources/applicationContext-security.xml (working copy)
@@ -13,9 +13,11 @@
     <aop:aspectj-autoproxy proxy-target-class="true"/>
     <beans:bean class="com.gwt.ss.GwtExceptionTranslator"/>
     <global-method-security pre-post-annotations="disabled" secured-annotations="enabled" jsr250-annotations="enabled"/>
+
+    <http pattern="/**/demo1" security="none"/>
+
     <http auto-config="false" use-expressions="true" disable-url-rewriting="true">
         <intercept-url pattern="/**/staff" access="hasRole('ROLE_STAFF')" requires-channel="any"/>
-        <intercept-url pattern="/**/demo1" filters="none"/>
         <intercept-url pattern="/secured/**" access="hasRole('ROLE_STAFF')" requires-channel="any"/>
         <form-login login-page="/login.jsp" authentication-failure-url="/login.jsp?authfailed=true"/>
         <!--when using GwtLogout[Async] process Logout,must config success-handler-ref instead of logout-success-url-->
Index: gssDemo2/src/main/resources/applicationContext-security.xml
===================================================================
--- gssDemo2/src/main/resources/applicationContext-security.xml (revision 156)
+++ gssDemo2/src/main/resources/applicationContext-security.xml (working copy)
@@ -13,9 +13,11 @@
     <aop:aspectj-autoproxy proxy-target-class="true"/> 
     <beans:bean class="com.gwt.ss.GwtExceptionTranslator"/>
     <global-method-security pre-post-annotations="disabled" secured-annotations="enabled" jsr250-annotations="enabled"/>
+
+    <http pattern="/**/demo2" security="none"/>
+
     <http auto-config="false" use-expressions="true" disable-url-rewriting="true">
         <intercept-url pattern="/**/staff" access="hasRole('ROLE_STAFF')" requires-channel="any"/>
-        <intercept-url pattern="/**/demo2" filters="none"/>
         <intercept-url pattern="/secured/**" access="hasRole('ROLE_STAFF')" requires-channel="any"/>
         <form-login login-page="/gwtsl/login" authentication-failure-url="/gwtsl/login?authfailed=true"/>
         <!--when using GwtLogout[Async] process Logout,must config success-handler-ref instead of logout-success-url-->
Index: gssDemo3/src/main/resources/applicationContext-security.xml
===================================================================
--- gssDemo3/src/main/resources/applicationContext-security.xml (revision 156)
+++ gssDemo3/src/main/resources/applicationContext-security.xml (working copy)
@@ -13,9 +13,11 @@
     <aop:aspectj-autoproxy proxy-target-class="false"/> 
     <beans:bean class="com.gwt.ss.GwtExceptionTranslator"/>
     <global-method-security pre-post-annotations="disabled" secured-annotations="enabled" jsr250-annotations="enabled"/>
+
+    <http pattern="/**/demo3" security="none" />
+
     <http auto-config="false" use-expressions="true" disable-url-rewriting="true">
         <intercept-url pattern="/**/staff" access="hasRole('ROLE_STAFF')" requires-channel="any"/>
-        <intercept-url pattern="/**/demo3" filters="none"/>
         <intercept-url pattern="/secured/**" access="hasRole('ROLE_STAFF')" requires-channel="any"/>
         <form-login login-page="/mvc/login" authentication-failure-url="/mvc/login?authfailed=true" login-processing-url="/mvc/j_spring_security_check"/>
         <logout invalidate-session="true" success-handler-ref="logoutSuccessHandler" logout-url="/mvc/j_spring_security_logout"/>


On 9 May 2012 20:09, Steven Jardine <st...@mjnservices.com> wrote:
Matthew,

I have committed your changes to svn trunk.  Would you mind testing them for me as I am not currently using glassfish.

Thanks,
Steve

Matthew Pocock

unread,
May 9, 2012, 4:55:53 PM5/9/12
to Steven Jardine, gwtse...@googlegroups.com
Cheers. I hope my changes don't break it for other app servers.

I am probably being useless with google, but is there a page that describes demos 1..3, what they are doing, and how they differ from each other?

Matthew

On 9 May 2012 21:44, Steven Jardine <st...@mjnservices.com> wrote:
I have committed those changes as well.

Matthew Pocock

unread,
May 11, 2012, 1:22:57 PM5/11/12
to Steven Jardine, gwtse...@googlegroups.com
I'm now trying to adapt demo4 to put in my application logic. I've got a bit stuck because I can't see where the demo4 class is bound to index.jsp. There must be something that tells the system to re-write index.jsp by combining it with the demo4 class, but I can't find this in any of the java or xml files. I wanted to try to replace the demo4 entry point with my own one, but so far can't see how to.

Thanks,

Matthew

On 9 May 2012 23:04, Steven Jardine <st...@mjnservices.com> wrote:
I am not sure.  I didn't write the demo's or upload them to appspot.  Kent would be better able to speak to that.  As far as the change breaking other servers, I doubt they will but you never know.

Thanks,
Steve
Reply all
Reply to author
Forward
0 new messages