Michael,

Do you have an existing *OLD* axis2.xml in your WEB-INF/conf directory?

thanks,
dims

On 5/11/07, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
More info...

While reading the code, it looks like the module references in the 
AxisOperation class are supposed to be QNames, not Strings. They get added in 
org.apache.axis2.deployment.DescriptionBuilder line 477:

operation.addModule(new QName(refName));

and so when org.apache.axis2.deployment.DeploymentEngine does this:

ArrayList modules = opDesc.getModuleRefs();
        for (int i = 0; i < modules.size(); i++) {
        String moduleName = (String) modules.get(i);

it causes the ClassCastException.

In version 1.1.1, the code in DeploymentEngine lines 421-425 are:

               AxisOperation opDesc = (AxisOperation) iterator.next();
                ArrayList modules = opDesc.getModuleRefs();

                for (int i = 0; i < modules.size(); i++) {
                    QName moduleName = (QName) modules.get(i);

which looks a lot more correct!

Michael Davis


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 11, 2007 11:26 AM
> To: [email protected]
> Subject: Problem moving service from axis2-1.1.1 to axis2-1.2
>
>
> Hi,
>
> I'm new to Axis. I got a simple service running in version
> 1.1.1. I'm using Spring and followed the guidelines at
> http://ws.apache.org/axis2/1_2/spring.html
> for using it with a servlet context.
>
> I've got the axis libraries and my classes all bundled in a
> web app, rather than deploying axis on its own and uploading
> aar files.
>
> I tried changing the libraries in WEB-INF/lib to the version
> 1.2 ones. I was careful to upgrade the supporting libraries
> as well (e.g. XmlSchema.) Now when I try to run the
> application, I get a class cast exception:
>
> 2007-05-11 10:55:12,675 INFO
> org.apache.axis2.deployment.ServiceDeployer - The sso.aar
> service, which is not valid, caused java.lang.ClassCastException
>         at
> org.apache.axis2.deployment.DeploymentEngine.fillServiceGroup(
> DeploymentEngine.java:498)
>         at
> org.apache.axis2.deployment.DeploymentEngine.addServiceGroup(D
> eploymentEngine.java:437)
>         at
> org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDepl
> oyer.java:83)
>         at
> org.apache.axis2.deployment.DeploymentEngine.doDeploy(Deployme
> ntEngine.java:582)
> etc.
>
> DeploymentEngine.java lines 493-499 are:
>
>             for (Iterator iterator =
> axisService.getOperations(); iterator.hasNext();) {
>                 AxisOperation opDesc = (AxisOperation)
> iterator.next();
>                 ArrayList modules = opDesc.getModuleRefs();
>
>                 for (int i = 0; i < modules.size(); i++) {
> error is here ->    String moduleName = (String) modules.get(i);
>                     AxisModule module =
> axisConfig.getModule(moduleName);
>
> Has anyone ever had a similar error?
> Any hints would be greatly appreciated!
>
> My services.xml contains:
>
>     <service name="Authenticate" scope="application">
>       <description>
>           Publiservice Single Sign On
>       </description>
>       <messageReceivers>
>           <messageReceiver
>               mep="http://www.w3.org/2004/08/wsdl/in-only";
>
> class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
>           <messageReceiver
>               mep="http://www.w3.org/2004/08/wsdl/in-out";
>
> class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
>       </messageReceivers>
>       <parameter name="ServiceObjectSupplier" locked="false">
>
> org.apache.axis2.extensions.spring.receivers.SpringServletCont
> extObjectSupplier
>       </parameter>
>       <parameter name="SpringBeanName"
> locked="false">authenticateService</parameter>
>       <operation name="authenticate">
>           <messageReceiver
> class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
>       </operation>
>     </service>
>
> My applicationContext.xml (for spring) contains:
>
> <beans>
>     <!-- Configure spring to give a hook to axis2 without a
> ServletContext
>     <bean id="applicationContext"
>
> class="org.apache.axis2.extensions.spring.receivers.Applicatio
> nContextHolder"/>
>      -->
>     <!-- Hibernate section -->
>     <bean id="dataSource"
> class="org.springframework.jdbc.datasource.DriverManagerDataSource">
>       <property name="driverClassName"
> value="oracle.jdbc.driver.OracleDriver"/>
>       <property name="url"
> value="jdbc:oracle:thin:@parker:1521:d36bm"/>
>       <property name="username" value="pubsso_webuser"/>
>       <property name="password" value="blah"/>
>     </bean>
>
>     <bean id="sessionFactory"
> class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
>       <property name="dataSource" ref="dataSource"/>
>       <property name="mappingResources">
>           <list>
>
> <value>ca/gc/publiservice/sso/model/generated/Application.hbm.
> xml</value>
>
> <value>ca/gc/publiservice/sso/model/generated/Permission.hbm.x
> ml</value>
>
> <value>ca/gc/publiservice/sso/model/generated/Person.hbm.xml</value>
>
> <value>ca/gc/publiservice/sso/model/generated/PersonRole.hbm.x
> ml</value>
>
> <value>ca/gc/publiservice/sso/model/generated/Role.hbm.xml</value>
>           </list>
>       </property>
>       <property name="hibernateProperties">
>           <props>
>               <prop
> key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
>               <prop
> key="hibernate.current_session_context_class">thread</prop>
>           </props>
>       </property>
>     </bean>
>
>     <bean id="dao" class="ca.gc.publiservice.sso.model.DAO">
>       <property name="sessionFactory" ref="sessionFactory"/>
>     </bean>
>
>     <!-- Axis2 Web Service -->
>     <bean id="authenticateService"
> class="ca.gc.publiservice.sso.ws.AuthenticateImpl">
>       <property name="dao" ref="dao"/>
>     </bean>
> </beans>
>
> Many thanks
> Michael Davis
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Davanum Srinivas :: http://davanum.wordpress.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to