Hi,
thank you very much. This had been exactly our fault.
On Fri, Jan 8, 2010 at 3:33 AM, Freeman Fang <[email protected]> wrote:
> Seems you are using SecuredBroker, which delegate the auth to JAAS, but
> you didn't add your user/password to the configuration, that's why you saw
> the exception.
> You need do
> edit $SMX_HOME/conf/users-passwords.properties
> add
> wss4j=xyz
>
> edit $SMX_HOME/conf/groups.properties
> replace
> admin=smx
> with
> admin=smx,wss4j
> Freeman
Now we tried to deploy our project and got another error. This is the
interceptor:
public class SoapInInterceptor extends AbstractWSS4JInterceptor {
private String domain = "servicemix-domain";
private AuthenticationService authenticationService;
private ThreadLocal<Subject> currentSubject = new
ThreadLocal<Subject>();
public SoapInInterceptor(AuthenticationService authenticationService) {
super();
setPhase(Phase.PRE_PROTOCOL);
getAfter().add(WSS4JInInterceptor.class.getName()); //after
WSS4JInInterceptor?!?!?
this.authenticationService = authenticationService;
}
public void handleMessage(SoapMessage message) throws Fault {
try {
Subject subject = (Subject) currentSubject.get();
if (subject == null) {
subject = new Subject();
currentSubject.set(subject);
}
List<Object> results =
(Vector<Object>)message.get(WSHandlerConstants.RECV_RESULTS);
if (results == null) {
return;
}
for (Iterator iter = results.iterator(); iter.hasNext();) {
WSHandlerResult hr = (WSHandlerResult) iter.next();
if (hr == null || hr.getResults() == null) {
return;
}
for (Iterator it = hr.getResults().iterator();
it.hasNext();) {
WSSecurityEngineResult er = (WSSecurityEngineResult)
it.next();
WSUsernameTokenPrincipal p =
(WSUsernameTokenPrincipal)er.getPrincipal();
if (er != null && er.getPrincipal() instanceof
WSUsernameTokenPrincipal) {
subject.getPrincipals().add(p);
this.authenticationService.authenticate(subject,
domain, p.getName(), p.getPassword());
}
logger.info("nach 2. for-Schleife im SOAPInInterceptor");
}
logger.info("nach 1. for-Schleife im SOAPInInterceptor");
}
message.put(Subject.class, subject);
} catch (GeneralSecurityException e) {
throw new Fault(e);
} finally {
currentSubject.set(null);
}
}
}
And we got this error:
[java] ERROR - CxfBcComponent -
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.apache.servicemix.cxfbc.CxfBcConsumer#0' defined in file
[C:\praxisseminar\apache-servicemix-3.3\data\smx\service-assemblies\SA-CALC-CXF-Teil2\version_2\sus\servicemix-cxf-bc\SU-CALC-CXF-BC\xbean.xml]:
Cannot create inner bean 'de.ps.SoapInInterceptor#0' of type
[de.ps.SoapInInterceptor] while setting bean property 'inInterceptors' with
key [3]; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'de.ps.SoapInInterceptor#0' defined in file
[C:\praxisseminar\apache-servicemix-3.3\data\smx\service-assemblies\SA-CALC-CXF-Teil2\version_2\sus\servicemix-cxf-bc\SU-CALC-CXF-BC\xbean.xml]:
Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class [de.ps.SoapInInterceptor]: No default constructor found; nested
exception is java.lang.NoSuchMethodException:
de.ps.SoapInInterceptor.<init>()
[java] [Fatal Error] :13:979: The element type "init" must be
terminated by the matching end-tag "</init>".
[java] ERROR - AutoDeploymentService - Failed to update
Service Assembly...
Any ideas? I think we´ve got a problem with the authenticationService but we
can´t figure out where the problem is.
Thanks a lot.
Best regards,
N + P