axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nandana Mihindukulasooriya" <>
Subject Re: Axis2(1.4) + Rampart 1.4 throws exception
Date Thu, 19 Jun 2008 12:25:45 GMT
See my comments inline.

On Tue, Jun 17, 2008 at 8:41 AM, Landslide <> wrote:

> I was trying to use Axis2 (1.4) + Rampart 1.4, with a policy file, and I
> got
> the following exception:
> Exception in thread "main" org.apache.axis2.phaseresolver.PhaseException:
> Did not find the desired phase 'Security' while deploying handler
> 'PolicyBasedSecurityInHandler'.

Most common reason for this is missing Security phase in the OutFaultFlow in
the axis2.xml. This was added in Axis2 1.4.

> at these lines of code on my client side:
> String args1 = "C:/java/eclipse/workspace/Axis2Client";
> ConfigurationContext ctx =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem(args1,
> null);

Looking at your code, it seems that you are not passing an axis2.xml file.
Does your Axis2 repo has an axis2.xml ? Or have you set "axis2.xml" System
property ?

> ServiceClient client = new ServiceClient(ctx, null);
> It seems that the second parameter of
> "ConfigurationContextFactory.createConfigurationContextFromFileSystem(args1,
> null);" cannot be set null as it is shown here.

No, you can pass null. It is not the problem here. The problem is when
rampart module is engaged when the service is being deployed , it  hasn't
found the  Security  Phase in one of the flows.  Most probably it is

The exception is thrown long before the code reaches the following 2 lines:
> String args2 = "policy.xml";
> options.setProperty(RampartMessageData.KEY_RAMPART_POLICY,
> loadPolicy(args2));

Yes, this happens when creating the Configuration Context.

View raw message