You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Mi...@servicecanada.gc.ca on 2007/05/11 17:25:31 UTC
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(DeploymentEngine.java:437)
at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:83)
at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.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.SpringServletContextObjectSupplier
</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.ApplicationContextHolder"/>
-->
<!-- 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.xml</value>
<value>ca/gc/publiservice/sso/model/generated/Person.hbm.xml</value>
<value>ca/gc/publiservice/sso/model/generated/PersonRole.hbm.xml</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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
AXIS 1.4 WSDL2JAVA does not create wrapper class for ref element with nillable = true
Posted by Ne...@wellsfargo.com.
1. Schema:
<!-- Define global elements -->
<xs:element name="gBooleanNillable" type="xs:boolean" nillable="true"/>
<!-- Refer global elements -->
<xs:complexType name="MyOperationRequest_Type">
<xs:sequence>
<xs:element ref="gBooleanNillable"/>
</xs:sequence>
</xs:complexType>
2. wsdl2java testing
With AXIS1.2 RC1 wsdl2java, a java.lang.Boolean class will be generated
.
org.apache.axis.wsdl.symbolTable.DefinedElement
QName:
{http://service.wellsfargo.com/provider/ecpr/prototype/myOperation/2007/
}gBooleanNillable
name: java.lang.Boolean
isReferenced? true
Class: org.apache.axis.wsdl.symbolTable.DefinedElement
Base?: true
Undefined?: false
isSimpleType? false
Node: [xs:element: null]
Dims:
RefType:
QName: {http://schemas.xmlsoap.org/soap/encoding/}boolean
name: java.lang.Boolean
isReferenced? true
Class: org.apache.axis.wsdl.symbolTable.BaseType
Base?: true
Undefined?: false
isSimpleType? false
Node: null
Dims:
RefType: null
With AXIS1.4 wsdl2java, NO java.lang.Boolean class will be generated.
org.apache.axis.wsdl.symbolTable.DefinedElement
QName:
{http://service.wellsfargo.com/provider/ecpr/prototype/myOperation/2007/
}gBooleanNillable
name: boolean
isReferenced? true
Class: org.apache.axis.wsdl.symbolTable.DefinedElement
Base?: true
Undefined?: false
isSimpleType? false
Node: [xs:element: null]
Dims:
isOnlyLiteralReferenced: false
RefType:
QName: {http://www.w3.org/2001/XMLSchema}boolean
name: boolean
isReferenced? true
Class: org.apache.axis.wsdl.symbolTable.BaseType
Base?: true
Undefined?: false
isSimpleType? false
Node: null
Dims:
isOnlyLiteralReferenced: false
RefType: null
3. The problem is that AXIS 1.4 wsdljava does not create Boolean wrapper
class for the element with nillable=true. This does not follow JAX-RPC
1.1 standard.
4. What I found.
I found that AXIS 1.4 did not retrieve the attribute of ref element. In
fact,
I found following code were commented out in the method
getTypeQNameFromAttr of org.apache.axis.wsdl.symbolTable.utils.java
(AXIS 1.4)
// An alternate qname is returned if nillable
// if (typeAttrName.equals("type")) {
// if (JavaUtils.isTrueExplicitly(getAttribute(node,
"nillable"))) {
// qName = getNillableQName(qName);
// }
// }
Based on my understand, this code is needed.
5. What I did
I uncommented out above code and put back the method
"getNillableQName(qName)" (from AXIS 1.2).
Testing proved it fixed my problem
/**
* getNillableQName returns the QName to use if the nillable=true
* attribute is used.
* For example, in JAX-RPC:
* The QName "xsd:int" maps to a java int.
* However if an element with a type="xsd:int" also has the
* "nillable=true" attribute, the type should be an Integer (not
an int).
* So in these circumstances, this routine is called with xsd:int
to
* get a suitable qname (soapenc:int) which maps to Integer.
* @param qName QName
*/
public static QName getNillableQName(QName qName) {
QName rc = qName;
if (Constants.isSchemaXSD(rc.getNamespaceURI())) {
String localName = rc.getLocalPart();
if (localName.equals("int") ||
localName.equals("long") ||
localName.equals("short") ||
localName.equals("float") ||
localName.equals("double") ||
localName.equals("boolean") ||
localName.equals("byte"))
{
rc = findQName(Constants.URI_DEFAULT_SOAP_ENC,
qName.getLocalPart());
}
else if (localName.equals("base64Binary"))
{
rc = findQName(Constants.URI_DEFAULT_SOAP_ENC,
"base64");
} else if (localName.equals("hexBinary")) {
rc = findQName(Constants.URI_DEFAULT_SCHEMA_XSD,
"hexBinary");
}
}
return rc;
}
6. My question
Does anyone know the reason we commentted above code ?
Since I do not fully understand wsdl2java changes for AXIS 1.4 yet, I
will really appreciate that anyone points out the issue of doing that.
Thanks in advance.
Neng Xu
WellsFargo Services Company; ECBS
225 2nd Ave. S. Mpls, MN 55479
Phone (612) 667-6489; Fax:(612) 667-8092
MAC: N9301-028
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Packaging module specific jars
Posted by Jim Alateras <ji...@comware.com.au>.
Thxs Deepal
cheers
</jima>
Deepal Jayasinghe wrote:
> hi Jim ,
> please put that under lib directory in the module mar file
> foo.mar
> META-INF
> module.xml
> lib
> mylib.jar
>
> For more information please have a look at
> [http://www-128.ibm.com/developerworks/library/ws-axis2soap/index.html]
>
> Thanks
> Deepal
>
>> I am developing a module for axis2 (v1.2) and was wondering where I
>> would place 'jar' files that are specific for that module. Would I
>> place them in axis2's WEB-INF/lib directory or somewhere else?
>>
>> These 'jars' are only required by this particular module.
>>
>> cheers
>> </jima>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Packaging module specific jars
Posted by Deepal Jayasinghe <de...@opensource.lk>.
hi Jim ,
please put that under lib directory in the module mar file
foo.mar
META-INF
module.xml
lib
mylib.jar
For more information please have a look at
[http://www-128.ibm.com/developerworks/library/ws-axis2soap/index.html]
Thanks
Deepal
> I am developing a module for axis2 (v1.2) and was wondering where I
> would place 'jar' files that are specific for that module. Would I
> place them in axis2's WEB-INF/lib directory or somewhere else?
>
> These 'jars' are only required by this particular module.
>
> cheers
> </jima>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
--
Thanks,
Deepal
................................................................
"The highest tower is built one brick at a time"
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Packaging module specific jars
Posted by Jim Alateras <ji...@comware.com.au>.
I am developing a module for axis2 (v1.2) and was wondering where I
would place 'jar' files that are specific for that module. Would I place
them in axis2's WEB-INF/lib directory or somewhere else?
These 'jars' are only required by this particular module.
cheers
</jima>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Problem moving service from axis2-1.1.1 to axis2-1.2
Posted by Davanum Srinivas <da...@gmail.com>.
Hmm, could you please log a JIRA and upload your sample?
thanks,
dims
On 5/11/07, Michael.Davis@servicecanada.gc.ca
<Mi...@servicecanada.gc.ca> wrote:
> Good question, but no, it's a new one.
>
> I've discovered something else though. I was a bit inaccurate in showing the operation in my services.xml as:
>
> <operation name="authenticate">
> <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
> </operation>
>
> It should have been:
>
> <operation name="authenticate">
> <module ref="hibernateTransactionModule"/>
> <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
> </operation>
>
> When I take the module element out, the problem disappears, which is totally consistent with what I believe is the error in the code. Is there a new format for the services.xml or something?
>
> Thanks
> Michael
>
>
> > -----Original Message-----
> > From: Davanum Srinivas [mailto:davanum@gmail.com]
> > Sent: Friday, May 11, 2007 12:36 PM
> > To: axis-user@ws.apache.org
> > Subject: Re: Problem moving service from axis2-1.1.1 to axis2-1.2
> >
> >
> > Michael,
> >
> > Do you have an existing *OLD* axis2.xml in your WEB-INF/conf
> > directory?
> >
> > thanks,
> > dims
> >
> > On 5/11/07, Michael.Davis@servicecanada.gc.ca
> > <Mi...@servicecanada.gc.ca> 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: Michael.Davis@servicecanada.gc.ca
> > > > [mailto:Michael.Davis@servicecanada.gc.ca]
> > > > Sent: Friday, May 11, 2007 11:26 AM
> > > > To: axis-user@ws.apache.org
> > > > 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: axis-user-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > >
> > > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
> > --
> > Davanum Srinivas :: http://davanum.wordpress.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
--
Davanum Srinivas :: http://davanum.wordpress.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
RE: Problem moving service from axis2-1.1.1 to axis2-1.2
Posted by Mi...@servicecanada.gc.ca.
Good question, but no, it's a new one.
I've discovered something else though. I was a bit inaccurate in showing the operation in my services.xml as:
<operation name="authenticate">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</operation>
It should have been:
<operation name="authenticate">
<module ref="hibernateTransactionModule"/>
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</operation>
When I take the module element out, the problem disappears, which is totally consistent with what I believe is the error in the code. Is there a new format for the services.xml or something?
Thanks
Michael
> -----Original Message-----
> From: Davanum Srinivas [mailto:davanum@gmail.com]
> Sent: Friday, May 11, 2007 12:36 PM
> To: axis-user@ws.apache.org
> Subject: Re: Problem moving service from axis2-1.1.1 to axis2-1.2
>
>
> Michael,
>
> Do you have an existing *OLD* axis2.xml in your WEB-INF/conf
> directory?
>
> thanks,
> dims
>
> On 5/11/07, Michael.Davis@servicecanada.gc.ca
> <Mi...@servicecanada.gc.ca> 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: Michael.Davis@servicecanada.gc.ca
> > > [mailto:Michael.Davis@servicecanada.gc.ca]
> > > Sent: Friday, May 11, 2007 11:26 AM
> > > To: axis-user@ws.apache.org
> > > 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: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
> --
> Davanum Srinivas :: http://davanum.wordpress.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Problem moving service from axis2-1.1.1 to axis2-1.2
Posted by Davanum Srinivas <da...@gmail.com>.
Michael,
Do you have an existing *OLD* axis2.xml in your WEB-INF/conf directory?
thanks,
dims
On 5/11/07, Michael.Davis@servicecanada.gc.ca
<Mi...@servicecanada.gc.ca> 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: Michael.Davis@servicecanada.gc.ca
> > [mailto:Michael.Davis@servicecanada.gc.ca]
> > Sent: Friday, May 11, 2007 11:26 AM
> > To: axis-user@ws.apache.org
> > 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: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
--
Davanum Srinivas :: http://davanum.wordpress.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
RE: Problem moving service from axis2-1.1.1 to axis2-1.2
Posted by Mi...@servicecanada.gc.ca.
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: Michael.Davis@servicecanada.gc.ca
> [mailto:Michael.Davis@servicecanada.gc.ca]
> Sent: Friday, May 11, 2007 11:26 AM
> To: axis-user@ws.apache.org
> 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: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org