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 David Dearing <dd...@stottlerhenke.com> on 2009/10/09 20:47:09 UTC
AbstractMethodError in simple Rampart client
I have created a simple Axis2 "echo" service and client and am now
trying to add Rampart security, starting with a simple UsernameToken and
plain text Password.
The secured service is running and it rejects client calls that are
missing the required SOAP header.
I set up the client to add the username and password, but I get an
AbstractMethodError on the client side. Am I missing a configuration
step or an overlooked dependency? Any help would be greatly appreciated!!
I'm using Axis2 1.5 and Rampart 1.4. The rahas-1.4 and rampart-1.4
modules *do* get deployed from the client repo. Brief code snippet:
ConfigurationContext ctx = //snip: Factory.create(repo)
SecureServiceStub stub = new SecureServiceStub(ctx);
// configure rampart security
ServiceClient sc = stub._getServiceClient();
sc.engageModule("rampart");
Options options = sc.getOptions();
options.setUserName("guest");
options.setPassword("pass");
stub.echo("hello");
Exception in thread "main" java.lang.AbstractMethodError
org.apache.axiom.om.impl.builder.StAXBuilder.processAttributes(StAXBuilder.java:230)
org.apache.axiom.om.impl.builder.StAXOMBuilder.populateOMElement(StAXOMBuilder.java:396)
org.apache.axiom.om.impl.builder.StAXOMBuilder.createOMElement(StAXOMBuilder.java:425)
org.apache.axiom.om.impl.builder.StAXOMBuilder.createNextOMElement(StAXOMBuilder.java:282)
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:207)
org.apache.axiom.om.impl.dom.DocumentImpl.getOMDocumentElement(DocumentImpl.java:443)
org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:502)
org.apache.rahas.Token.<init>(Token.java:141)
org.apache.rampart.builder.BindingBuilder.handleSupportingTokens(BindingBuilder.java:388)
...
Trouble with Maven including rampart.mar as client-side dependency
Posted by David Dearing <dd...@stottlerhenke.com>.
I am trying to run Axis2+Rampart for a simple example with plain text
UsernameToken and Password. I am using Axis2 1.5 and Rampart 1.4.
I have a secured service hosted by Axis that works fine with maven. The
rampart and rahas modules are deployed correctly, using the mar files
from my maven repository.
Using the same maven configuration, I am trying to create the
corresponding client, but the rampart and rahas modules are *not*
deployed by default. engageModule("rampart") always gives me an
"AxisFault: Unable to engage module : rampart"
I can force the client to deploy the modules by creating a
ConfigurationContext from the file system, but I would like these to be
automatically found from the maven classpath rather than separately
including the mar files as a client repository.
Does anyone have a clue as to how I can get the client to find the maven
dependencies when engaging the client?
Thanks in advance!
dave
Re: [Axis2] AbstractMethodError in simple Rampart client
Posted by David Dearing <dd...@stottlerhenke.com>.
David Dearing wrote:
> I have created a simple Axis2 "echo" service and client and am now
> trying to add Rampart security, starting with a simple UsernameToken and
> plain text Password.
>
> The secured service is running and it rejects client calls that are
> missing the required SOAP header.
>
> I set up the client to add the username and password, but I get an
> AbstractMethodError on the client side. Am I missing a configuration
> step or an overlooked dependency? Any help would be greatly appreciated!!
>
> I'm using Axis2 1.5 and Rampart 1.4. The rahas-1.4 and rampart-1.4
> modules *do* get deployed from the client repo. Brief code snippet:
>
> ConfigurationContext ctx = //snip: Factory.create(repo)
> SecureServiceStub stub = new SecureServiceStub(ctx);
>
> // configure rampart security
> ServiceClient sc = stub._getServiceClient();
> sc.engageModule("rampart");
>
> Options options = sc.getOptions();
> options.setUserName("guest");
> options.setPassword("pass");
>
> stub.echo("hello");
>
>
> Exception in thread "main" java.lang.AbstractMethodError
> org.apache.axiom.om.impl.builder.StAXBuilder.processAttributes(StAXBuilder.java:230)
> org.apache.axiom.om.impl.builder.StAXOMBuilder.populateOMElement(StAXOMBuilder.java:396)
> org.apache.axiom.om.impl.builder.StAXOMBuilder.createOMElement(StAXOMBuilder.java:425)
> org.apache.axiom.om.impl.builder.StAXOMBuilder.createNextOMElement(StAXOMBuilder.java:282)
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:207)
> org.apache.axiom.om.impl.dom.DocumentImpl.getOMDocumentElement(DocumentImpl.java:443)
> org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:502)
> org.apache.rahas.Token.<init>(Token.java:141)
> org.apache.rampart.builder.BindingBuilder.handleSupportingTokens(BindingBuilder.java:388)
> ...
>
>
Some additional investigation led me to find the error being generated
from a line in StAXBuilder that attempts to call
OMAttribute.setAttributeType with a null type.
The OMAttribute appears to be wsu:Id for the wsse:UsernameToken element.
I think this type should be "xsd:ID", but I'm not sure where/how to
change this on the client.
Re: AbstractMethodError in simple Rampart client?
Posted by David Dearing <dd...@stottlerhenke.com>.
Thanks for the tip! You were correct. Actually, the problem was that I
was *missing* the axiom-dom dependency in my pom.xml.
As a follow-up, is there a good listing of needed dependencies for a
maven pom.xml using Axis2? I feel like there are many runtime
dependencies and it would be nice to verify that I have at least the
minimal set.
Thanks!
Andreas Veithen wrote:
> An AbstractMethodError can only occur if the dependencies at runtime
> are different from the dependencies at build time. The stacktrace
> shows that this happens somewhere inside Axiom. Since Axiom only
> depends on very stable APIs (Activation, JavaMail and StAX), the only
> possible explanation is that you have a mix of Axiom libraries from
> different versions. Probably the version of axiom-dom you are using is
> older than the version of axiom-api.
>
> Andreas
>
> On Fri, Oct 9, 2009 at 20:47, David Dearing <dd...@stottlerhenke.com> wrote:
>> I have created a simple Axis2 "echo" service and client and am now
>> trying to add Rampart security, starting with a simple UsernameToken and
>> plain text Password.
>>
>> The secured service is running and it rejects client calls that are
>> missing the required SOAP header.
>>
>> I set up the client to add the username and password, but I get an
>> AbstractMethodError on the client side. Am I missing a configuration
>> step or an overlooked dependency? Any help would be greatly appreciated!!
>>
>> I'm using Axis2 1.5 and Rampart 1.4. The rahas-1.4 and rampart-1.4
>> modules *do* get deployed from the client repo. Brief code snippet:
>>
>> ConfigurationContext ctx = //snip: Factory.create(repo)
>> SecureServiceStub stub = new SecureServiceStub(ctx);
>>
>> // configure rampart security
>> ServiceClient sc = stub._getServiceClient();
>> sc.engageModule("rampart");
>>
>> Options options = sc.getOptions();
>> options.setUserName("guest");
>> options.setPassword("pass");
>>
>> stub.echo("hello");
>>
>>
>> Exception in thread "main" java.lang.AbstractMethodError
>> org.apache.axiom.om.impl.builder.StAXBuilder.processAttributes(StAXBuilder.java:230)
>> org.apache.axiom.om.impl.builder.StAXOMBuilder.populateOMElement(StAXOMBuilder.java:396)
>> org.apache.axiom.om.impl.builder.StAXOMBuilder.createOMElement(StAXOMBuilder.java:425)
>> org.apache.axiom.om.impl.builder.StAXOMBuilder.createNextOMElement(StAXOMBuilder.java:282)
>> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:207)
>> org.apache.axiom.om.impl.dom.DocumentImpl.getOMDocumentElement(DocumentImpl.java:443)
>> org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:502)
>> org.apache.rahas.Token.<init>(Token.java:141)
>> org.apache.rampart.builder.BindingBuilder.handleSupportingTokens(BindingBuilder.java:388)
>> ...
>>
>>
>>
>
>
Re: AbstractMethodError in simple Rampart client
Posted by Andreas Veithen <an...@gmail.com>.
An AbstractMethodError can only occur if the dependencies at runtime
are different from the dependencies at build time. The stacktrace
shows that this happens somewhere inside Axiom. Since Axiom only
depends on very stable APIs (Activation, JavaMail and StAX), the only
possible explanation is that you have a mix of Axiom libraries from
different versions. Probably the version of axiom-dom you are using is
older than the version of axiom-api.
Andreas
On Fri, Oct 9, 2009 at 20:47, David Dearing <dd...@stottlerhenke.com> wrote:
> I have created a simple Axis2 "echo" service and client and am now
> trying to add Rampart security, starting with a simple UsernameToken and
> plain text Password.
>
> The secured service is running and it rejects client calls that are
> missing the required SOAP header.
>
> I set up the client to add the username and password, but I get an
> AbstractMethodError on the client side. Am I missing a configuration
> step or an overlooked dependency? Any help would be greatly appreciated!!
>
> I'm using Axis2 1.5 and Rampart 1.4. The rahas-1.4 and rampart-1.4
> modules *do* get deployed from the client repo. Brief code snippet:
>
> ConfigurationContext ctx = //snip: Factory.create(repo)
> SecureServiceStub stub = new SecureServiceStub(ctx);
>
> // configure rampart security
> ServiceClient sc = stub._getServiceClient();
> sc.engageModule("rampart");
>
> Options options = sc.getOptions();
> options.setUserName("guest");
> options.setPassword("pass");
>
> stub.echo("hello");
>
>
> Exception in thread "main" java.lang.AbstractMethodError
> org.apache.axiom.om.impl.builder.StAXBuilder.processAttributes(StAXBuilder.java:230)
> org.apache.axiom.om.impl.builder.StAXOMBuilder.populateOMElement(StAXOMBuilder.java:396)
> org.apache.axiom.om.impl.builder.StAXOMBuilder.createOMElement(StAXOMBuilder.java:425)
> org.apache.axiom.om.impl.builder.StAXOMBuilder.createNextOMElement(StAXOMBuilder.java:282)
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:207)
> org.apache.axiom.om.impl.dom.DocumentImpl.getOMDocumentElement(DocumentImpl.java:443)
> org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:502)
> org.apache.rahas.Token.<init>(Token.java:141)
> org.apache.rampart.builder.BindingBuilder.handleSupportingTokens(BindingBuilder.java:388)
> ...
>
>
>