geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Kakunin" <akaku...@emdev.ru>
Subject Migrting application into Geronimo
Date Mon, 28 Apr 2008 13:50:53 GMT
Hello! I'm currently working with migrating quite big war-only application (
http://www.emforge.org) to the Geronimo.
We are using Tomcat 5.5/6.0 for development, but already prepared "special"
versions for JBossAS and GlassFis to provide better integration (
http://www.emforge.org/wiki/EmForgeJ2EEIntegration has a little bit more
details).

So, now the turn on Geronimo.

This application is used many dependencies, some of which make sense are:
* JSF-RI 1.2 & Facelets & RichFaces 3.2.0
* Spring 2.5.2
* CXF 2.0.5-incubator.

During trying to run application on GlassFish I met some problems, seems
related to the facts, that Geronimo is used a little bit another versions:
* MyFaces 1.2 (as JSF Implementation)
* Spring 2.0.5
* CXF 2.0.2

But before one general question: how to use some default (I suppose
jdbc/ActiveDS) DataSource in my application?
We need it because by default, we are using build-in file-based HSQL, but in
these "special" pacjkages for J2EE servers we provide some better
integration - for example we are using some default DS as DataSource. It
allows user to start application by simple deploying (without any external
configuration) and avoid from using HSQL (it has some problems).

I read documentation (
http://cwiki.apache.org/GMOxDOC21/deployment-plans.html) and trying to do
like it is described there  - added resource into web.xml:

    <resource-ref>
        <res-ref-name>jdbc/ActiveDS</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>

And added dependency into geronimo-web.xml (may be it is not correct - but I
tried different ways):


<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
          xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2"
          xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
          xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">

    <sys:environment>
        <sys:moduleId>
            <sys:groupId>org.emforge</sys:groupId>
            <sys:artifactId>EmForge</sys:artifactId>
            <sys:version>0.23</sys:version>
            <sys:type>war</sys:type>
        </sys:moduleId>

        <sys:hidden-classes>

<sys:filter>org.jaxen,org.springframework,org.apache.cxf</sys:filter>
           </sys:hidden-classes>

           <sys:dependencies>
            <sys:dependency>
                <sys:groupId>console.dbpool</sys:groupId>
                <sys:artifactId>jdbc%2FActiveDS</sys:artifactId>
            </sys:dependency>
        </sys:dependencies>
    </sys:environment>
    <context-root>/EmForge</context-root>
    <nam:resource-ref>
        <nam:ref-name>jdbc/ActiveDS</nam:ref-name>
        <nam:resource-link>jdbc/ActiveDS</nam:resource-link>
        <nam:pattern>
          <nam:groupId>console.dbpool</nam:groupId>
          <nam:artifactId>jdbc%2FActiveDS</nam:artifactId>
          <nam:name>jdbc/ActiveDS</nam:name>
        </nam:pattern>
    </nam:resource-ref>


But in this case I'm getting error during deployment:

error: cvc-complex-type.2.4a: Expected elements
'non-overridable-classes@http://geronimo.apache.org/xml/ns/deployment-1.2
inverse-classloading@http://geronimo.apache.org/xml/ns/deployment-1.2
suppress-default-environment@http://geronimo.apache.org/xml/ns/deployment-1.2'
instead of 'dependencies@http://geronimo.apache.org/xml/ns/deployment-1.2'
here in element
environment@http://geronimo.apache.org/xml/ns/deployment-1.2

error: cvc-complex-type.2.4b: Element not allowed:
pattern@http://geronimo.apache.org/xml/ns/naming-1.2 in element
resource-ref@http://geronimo.apache.org/xml/ns/naming-1.2



What I'm doing wrong here?


Another question - MyFaces and JSF-RI?
Is it possible to configure somehow my application to use JSF-RI instead of
MyFaces. Problem is - we have some  custom renderers, which implementation
is inherited from com.sun renderers, so - when I'm deploying application
into Geronimo - I'm getting class-not-found error.

Last Question - Implementing Web-Services with using CXF & Spring.
Some services in our application wrapped with CXF-based Web-Services
Implementation. For doing it we have defined in spring context:

    <!-- Load CXF modules from cxf.jar -->
    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

    <!-- Enable message logging using the CXF logging feature -->
    <cxf:bus>
        <cxf:features>
            <cxf:logging/>
        </cxf:features>
    </cxf:bus>


    <!-- Service endpoint -->
    <!-- See http://incubator.apache.org/cxf/faq.html regarding CXF + Spring
AOP -->
    <jaxws:endpoint id="bpmWsService"
            implementorClass="org.emforge.jbpm.BpmServiceImpl"
            implementor="#bpmService"
            address="/org.emforge.BpmService">
        <jaxws:inInterceptors>
            <bean
class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
               <ref bean="wss4jInConfiguration"/>

            <bean
class="ru.emdev.EmForge.security.ValidateUserTokenInterceptor"/>
        </jaxws:inInterceptors>
    </jaxws:endpoint>


But I'm getting followed error during starting application:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'bpmWsService': Unsatisfied dependency expressed
through constructor argument with index 2 of type [java.lang.String]:
Ambiguous constructor argument types - did you specify the correct bean
references as constructor arguments?


I tried both - put org.apache.cxf and org.springframework into
hidden-classes via:
<sys:hidden-classes>
               <sys:filter>org.jaxen</sys:filter>
               <sys:filter>org.springframework</sys:filter>
               <sys:filter>org.apache.cxf</sys:filter>
           </sys:hidden-classes>

But still getting this error.

I tried to hide classes via:
        <sys:hidden-classes>

<sys:filter>org.jaxen,org.springframework,org.apache.cxf</sys:filter>
           </sys:hidden-classes>

but it is not work at all (I'm starting to get errors related to org.jaxen).

I tried to switch my application to cxf-2.0.2 (since for me it is not so
important which version is used and I like the idea to remove some
dependencies from our war-file to make is smaller) - same effect.
I tried to remove cxf from my war-file libs (so, to use only cxf from
geronimo) - I've got error ClassNotFound on servlet definition:

   <servlet>
        <servlet-name>CXFServlet</servlet-name>
        <servlet-class>
            org.apache.cxf.transport.servlet.CXFServlet
        </servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>CXFServlet</servlet-name>
        <url-pattern>/ws</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>CXFServlet</servlet-name>
        <url-pattern>/ws/*</url-pattern>
    </servlet-mapping>


I looked into tutorials - but found only tutorial about writting
web-services for Geronimo with using Axis2 - not CXF...


So, really do not know what is a correct way to define CXF-based
web-services in Geronimo. Does anybody has any suggestions.


I will be happy to any help. For us it is really important to add support
for Geronimo - in this case our application with run on all most-important
Open-Source J2EE servers.

-- 
With best regards,
Alexey Kakunin

Mime
View raw message