You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by mdebooy <ma...@debooy.eu> on 2010/09/06 23:05:29 UTC

Jasig CAS

I keep having trouble with openEJB not able to use Hibernate.

I installed the Jasig CAS server (cas-server-webapp-3.4.2.war) on the same
Tomcat server as openEJB. When I try to login into CAS then I get the same
error as I have when I use Hibernate in my web application:
2010-09-06 22:51:02,484 ERROR
[org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/cas-server-webapp-3.4.2].[cas]]
- <Se
rvlet.service() for servlet cas threw exception>
java.lang.ClassCastException:
org.apache.openjpa.persistence.PersistenceProviderImpl cannot be cast to
javax.persistence.spi.Persist
enceProvider
        at javax.persistence.Persistence$1.isLoaded(Persistence.java:77)
        at
org.hibernate.validator.engine.resolver.JPATraversableResolver.isReachable(JPATraversableResolver.java:33)
        at
org.hibernate.validator.engine.resolver.DefaultTraversableResolver.isReachable(DefaultTraversableResolver.java:112)
        at
org.hibernate.validator.engine.resolver.SingleThreadCachedTraversableResolver.isReachable(SingleThreadCachedTraversableRe
solver.java:47)
...
When I remove the openejb.war file the CAS authentication works fine.

I searched the internet and the mail list again and found that Jean-Louis
MONTEIRO has a pom.xml to create an openejb.war with Hibernate instead of
openJPA (but I can not find it). He also explained that he can not put the
openejb.war with Hibernate on-line because of the license incompatibilities.
I can understand and live with that but what I can not live with is the fact
that in the documentation there is an example which uses Hibernate but does
not work.

I am not a full time Java developer. I do not have lots of time to figure
out everything. I just want to make applications for myself and perhaps put
them on the internet so others can use them too. For that I want to use
software like openEJB, Hibernate, and CAS. All of them work together but the
figuring out how takes a lot of fun out of it.

So my question is: Can somebody provide me with a detailed information on
how to create an openejb.war file that uses Hibernate instead of openJPA?
-- 
View this message in context: http://openejb.979440.n4.nabble.com/Jasig-CAS-tp2528880p2528880.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Jasig CAS

Posted by mdebooy <ma...@debooy.eu>.
A few days ago I managed to get the packages I needed to compile.
Unfortunately after 25 minutes MaVeN stopped with an error. Today I updated
the sources but now I am back to where I can not get a package
(-DgroupId=org.apache.activemq -DartifactId=activeio-core
-Dversion=3.0.0-incubator).

I give up  I will look for an other way to get my web applications working.
Thanks for all the help but it costs me too much time and effort to get it
running. I need something out-of-the-box.
-- 
View this message in context: http://openejb.979440.n4.nabble.com/Jasig-CAS-tp2528880p2544429.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Jasig CAS

Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.

mdebooy wrote:
> 
> A few hours further. Sources are on my PC from svn. The usage of maven
> gives more problems. For the moment I can not get my Nexus to fetch the
> Apache Geronimo packages so maven fails to make the packages. Putting the
> pieces together is not easy and self explaining.
> 

IMHO, you should only have to deal with openejb-tomcat-webapp module. All
others are accessible from Central repository.
If you still have problems, let me know. I can give it a try after removing
my local maven repository.


mdebooy wrote:
> 
> You told that your company uses CAS and openEJB. Are they deployed on the
> same Tomcat server?
> 
I'll check that point this morning but I think so ;-)

Jean-Louis

-- 
View this message in context: http://openejb.979440.n4.nabble.com/Jasig-CAS-tp2528880p2530866.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Jasig CAS

Posted by mdebooy <ma...@debooy.eu>.
A few hours further. Sources are on my PC from svn. The usage of maven gives
more problems. For the moment I can not get my Nexus to fetch the Apache
Geronimo packages so maven fails to make the packages. Putting the pieces
together is not easy and self explaining.

You told that your company uses CAS and openEJB. Are they deployed on the
same Tomcat server?

-- 
View this message in context: http://openejb.979440.n4.nabble.com/Jasig-CAS-tp2528880p2530463.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Jasig CAS

Posted by mdebooy <ma...@debooy.eu>.
Thanks for the swift reply. I will try it as soon as possible and let you
know.

-- 
View this message in context: http://openejb.979440.n4.nabble.com/Jasig-CAS-tp2528880p2529462.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Jasig CAS

Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.
Hi,

Hey, i opened a JIRA but did not get time to publish a pom.
Will try to do that asap.

In order to help, here is a subset of the pom i use to create the
OpenEJB+Hibernate distribution.
You must copy/paste the code below in the openejb-tomcat-webapp/pom.xml.
Then, you just need to activate the hibernate profile (mvn clean package -P
assemble,hibernate).
I need to change it a bit for the 3.2-SNAPSHOT because i'd like to use the
latest Hibernate distribution (JPA 2 compatible).

We use CAS and Hibernate in my company without any problems.
Hope you'll be able to do the same ;-)

If you still have some problems, feel free to post here.

@Jon: do you think we can create a dedicated page on our web site?
I can do that if you want.

Jean-Louis

<profiles>
            <profile>
                <id>openjpa</id>
                <activation>
                    <activeByDefault>true</activeByDefault>
                </activation>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.openejb</groupId>
                        <artifactId>openejb-core</artifactId>
                        <version>${project.version}</version>
                        <scope>runtime</scope>
                        <exclusions>
                            <exclusion>
                               
<groupId>org.apache.geronimo.modules</groupId>
                                <artifactId>geronimo-kernel</artifactId>
                            </exclusion>
                            <exclusion>
                               
<groupId>org.apache.geronimo.modules</groupId>
                               
<artifactId>geronimo-webservices</artifactId>
                            </exclusion>
                            <exclusion>
                               
<groupId>org.apache.geronimo.modules</groupId>
                                <artifactId>geronimo-naming</artifactId>
                            </exclusion>
                            <exclusion>
                               
<groupId>org.apache.geronimo.modules</groupId>
                                <artifactId>geronimo-timer</artifactId>
                            </exclusion>
                            <exclusion>
                               
<groupId>org.apache.geronimo.modules</groupId>
                                <artifactId>geronimo-security</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                </dependencies>
            </profile>
          <profile>
              <id>hibernate</id>
              <dependencies>
                  <!-- lots of dependencies now depends on SLF4J. To avoid
                   side effects, we'll fix the api version
                   http://www.slf4j.org/compatibility.html -->
                  <dependency>
                      <groupId>org.slf4j</groupId>
                      <artifactId>slf4j-api</artifactId>
                      <version>1.5.8</version> <!-- version used by
cxf-bundle -->
                      <scope>compile</scope>
                  </dependency>
                  <dependency>
                      <groupId>org.slf4j</groupId>
                      <artifactId>slf4j-log4j12</artifactId>
                      <version>1.5.8</version>
                      <scope>runtime</scope>
                  </dependency>

                  <!-- CXF depends on ASM 2.2.3 but it also works file with
ASM 3.x
                  See http://cxf.apache.org/21-migration-guide.html
                  So, we prefer to use the latest one (wich is also embedded
in xbean-asm-shaded -->
                  <dependency>
                      <groupId>asm</groupId>
                      <artifactId>asm</artifactId>
                      <version>3.2</version>
                  </dependency>

                  <dependency>
                      <groupId>org.apache.openejb</groupId>
                      <artifactId>openejb-core</artifactId>
                      <version>${project.version}</version>
                      <scope>runtime</scope>
                      <exclusions>
                          <exclusion>
                              <groupId>org.apache.geronimo.modules</groupId>
                              <artifactId>geronimo-kernel</artifactId>
                          </exclusion>
                          <exclusion>
                              <groupId>org.apache.geronimo.modules</groupId>
                              <artifactId>geronimo-webservices</artifactId>
                          </exclusion>
                          <exclusion>
                              <groupId>org.apache.geronimo.modules</groupId>
                              <artifactId>geronimo-naming</artifactId>
                          </exclusion>
                          <exclusion>
                              <groupId>org.apache.geronimo.modules</groupId>
                              <artifactId>geronimo-timer</artifactId>
                          </exclusion>
                          <exclusion>
                              <groupId>org.apache.geronimo.modules</groupId>
                              <artifactId>geronimo-security</artifactId>
                          </exclusion>
                          <exclusion>
                              <groupId>org.apache.openjpa</groupId>
                              <artifactId>openjpa</artifactId>
                          </exclusion>
                      </exclusions>
                  </dependency>
                  <!-- hibernate dependencies -
http://community.jboss.org/wiki/HibernateCompatibilityMatrix -->
                  <!-- To avoid ASM conflicts with other libraries like CXF
for example
                  we exclude ASM, ASM-ATTRS and CGLIB and just include
CGLIB_NODEP -->
                  <dependency>
                      <groupId>cglib</groupId>
                      <artifactId>cglib-nodep</artifactId>
                      <version>2.1_3</version>
                  </dependency>
                  <dependency>
                      <groupId>org.hibernate</groupId>
                      <artifactId>hibernate</artifactId>
                      <version>3.2.7.ga</version>
                      <exclusions>
                          <exclusion>
                              <groupId>asm</groupId>
                              <artifactId>asm</artifactId>
                          </exclusion>
                          <exclusion>
                              <groupId>asm</groupId>
                              <artifactId>asm-attrs</artifactId>
                          </exclusion>
                          <exclusion>
                              <groupId>cglib</groupId>
                              <artifactId>cglib</artifactId>
                          </exclusion>
                          <exclusion>
                              <groupId>javax.transaction</groupId>
                              <artifactId>jta</artifactId>
                          </exclusion>
                      </exclusions>
                  </dependency>
                  <dependency>
                      <groupId>org.hibernate</groupId>
                      <artifactId>hibernate-entitymanager</artifactId>
                      <version>3.3.2.GA</version>
                      <exclusions>
                          <exclusion>
                              <groupId>javax.persistence</groupId>
                              <artifactId>persistence-api</artifactId>
                          </exclusion>
                      </exclusions>
                  </dependency>
                  <dependency>
                      <groupId>org.hibernate</groupId>
                      <artifactId>hibernate-annotations</artifactId>
                      <version>3.3.1.GA</version>
                  </dependency>
                  <dependency>
                      <groupId>org.hibernate</groupId>
                      <artifactId>hibernate-validator</artifactId>
                      <version>3.0.0.ga</version>
                  </dependency>
              </dependencies>
          </profile>
        </profiles>
        <dependencies>
          <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>javaee-api</artifactId>
            <version>5.0-2</version>
          </dependency>
          <dependency>
            <groupId>org.codehaus.swizzle</groupId>
            <artifactId>swizzle-stream</artifactId>
          </dependency>
          <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>openejb-tomcat-loader</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
          </dependency>
          <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>openejb-tomcat-catalina</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
          </dependency>
          <!-- Used in profile
          <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>openejb-core</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
            <exclusions>
              <exclusion>
                <groupId>org.apache.geronimo.modules</groupId>
                <artifactId>geronimo-kernel</artifactId>
              </exclusion>
              <exclusion>
                <groupId>org.apache.geronimo.modules</groupId>
                <artifactId>geronimo-webservices</artifactId>
              </exclusion>
              <exclusion>
                <groupId>org.apache.geronimo.modules</groupId>
                <artifactId>geronimo-naming</artifactId>
              </exclusion>
              <exclusion>
                <groupId>org.apache.geronimo.modules</groupId>
                <artifactId>geronimo-timer</artifactId>
              </exclusion>
              <exclusion>
                <groupId>org.apache.geronimo.modules</groupId>
                <artifactId>geronimo-security</artifactId>
              </exclusion>
            </exclusions>
          </dependency>
          -->
          <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>openejb-webservices</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
          </dependency>
          <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>openejb-cxf</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
              <exclusions>
                  <exclusion>
                      <groupId>org.slf4j</groupId>
                      <artifactId>slf4j-jdk14</artifactId>
                  </exclusion>
              </exclusions>
          </dependency>
          <dependency>
            <groupId>org.apache.geronimo.javamail</groupId>
            <artifactId>geronimo-javamail_1.4_mail</artifactId>
            <scope>runtime</scope>
          </dependency>
          <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>openejb-client</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
          </dependency>
          <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>openejb-tomcat-common</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
          </dependency>
          <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>openejb-server</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
          </dependency>
          <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>openejb-ejbd</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
          </dependency>
          <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>openejb-hsql</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
          </dependency>
          <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>openejb-http</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
          </dependency>
          <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>openejb-telnet</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
          </dependency>
          <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>openejb-itests-client</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
          </dependency>
          <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>openejb-itests-beans</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
          </dependency>
          <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>catalina</artifactId>
          </dependency>
        </dependencies>
-- 
View this message in context: http://openejb.979440.n4.nabble.com/Jasig-CAS-tp2528880p2529215.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Jasig CAS

Posted by mdebooy <ma...@debooy.eu>.
Before you go into the examples. I meant the example on the documentation
page of Hibernate in the Other JPA providers chapter.
-- 
View this message in context: http://openejb.979440.n4.nabble.com/Jasig-CAS-tp2528880p2529465.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Jasig CAS

Posted by Jonathan Gallimore <jo...@gmail.com>.
Hi,

Thanks for reporting this - seems like something is not quite right with our
hibernate integration. I'll give it a try here with our hibernate example -
if I can get it to work, I'll post up some documentation with exactly what
you need to build.

Jon

On Mon, Sep 6, 2010 at 10:05 PM, mdebooy <ma...@debooy.eu> wrote:

>
> I keep having trouble with openEJB not able to use Hibernate.
>
> I installed the Jasig CAS server (cas-server-webapp-3.4.2.war) on the same
> Tomcat server as openEJB. When I try to login into CAS then I get the same
> error as I have when I use Hibernate in my web application:
> 2010-09-06 22:51:02,484 ERROR
>
> [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/cas-server-webapp-3.4.2].[cas]]
> - <Se
> rvlet.service() for servlet cas threw exception>
> java.lang.ClassCastException:
> org.apache.openjpa.persistence.PersistenceProviderImpl cannot be cast to
> javax.persistence.spi.Persist
> enceProvider
>        at javax.persistence.Persistence$1.isLoaded(Persistence.java:77)
>        at
>
> org.hibernate.validator.engine.resolver.JPATraversableResolver.isReachable(JPATraversableResolver.java:33)
>        at
>
> org.hibernate.validator.engine.resolver.DefaultTraversableResolver.isReachable(DefaultTraversableResolver.java:112)
>        at
>
> org.hibernate.validator.engine.resolver.SingleThreadCachedTraversableResolver.isReachable(SingleThreadCachedTraversableRe
> solver.java:47)
> ...
> When I remove the openejb.war file the CAS authentication works fine.
>
> I searched the internet and the mail list again and found that Jean-Louis
> MONTEIRO has a pom.xml to create an openejb.war with Hibernate instead of
> openJPA (but I can not find it). He also explained that he can not put the
> openejb.war with Hibernate on-line because of the license
> incompatibilities.
> I can understand and live with that but what I can not live with is the
> fact
> that in the documentation there is an example which uses Hibernate but does
> not work.
>
> I am not a full time Java developer. I do not have lots of time to figure
> out everything. I just want to make applications for myself and perhaps put
> them on the internet so others can use them too. For that I want to use
> software like openEJB, Hibernate, and CAS. All of them work together but
> the
> figuring out how takes a lot of fun out of it.
>
> So my question is: Can somebody provide me with a detailed information on
> how to create an openejb.war file that uses Hibernate instead of openJPA?
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Jasig-CAS-tp2528880p2528880.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>