Why the secure-rest example shipped with jboss-fuse 6.0 does not work ?

Solution Unverified - Updated -

Issue

  • While trying to run the "jboss-fuse-6.0.0.redhat-024/examples/secure-rest" the following exception is encountered in the fuse log:
11:55:34,107 | INFO  | hat-024-thread-1 | ServerImpl                       | 147 - org.apache.cxf.cxf-api - 2.6.0.redhat-60024 | Setting the server's publish address to be /securecrm
11:55:34,108 | INFO  | hat-024-thread-1 | InstrumentationManagerImpl       | 150 - org.apache.cxf.cxf-rt-management - 2.6.0.redhat-60024 | registering MBean org.apache.cxf:bus.id=org.jboss.fuse.examples.secure-rest-cxf7146475,type=Bus.Service.Endpoint,service="{http://security.jaxrs.cxf.examples.fuse.jboss.org/}CustomerService",port="CustomerService",instance.id=7804666: org.apache.cxf.endpoint.ManagedEndpoint@857753
11:55:34,112 | INFO  | hat-024-thread-1 | InstrumentationManagerImpl       | 150 - org.apache.cxf.cxf-rt-management - 2.6.0.redhat-60024 | registering MBean org.apache.cxf:bus.id=org.jboss.fuse.examples.secure-rest-cxf7146475,type=Bus.Service.Endpoint,service="{http://security.jaxrs.cxf.examples.fuse.jboss.org/}CustomerService",port="CustomerService",instance.id=7804666: javax.management.modelmbean.RequiredModelMBean@1ea6e94
11:55:59,028 | WARN  | qtp25016004-183  | ServletHandler                   | 90 - org.eclipse.jetty.util - 7.6.7.v20120910 | /cxf/securecrm/customerservice/customers/123
java.lang.reflect.UndeclaredThrowableException
    at org.ops4j.pax.web.service.internal.$Proxy6.service(Unknown Source)[100:org.ops4j.pax.web.pax-web-runtime:1.1.11]
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)[80:org.eclipse.jetty.servlet:7.6.7.v20120910]
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:447)[80:org.eclipse.jetty.servlet:7.6.7.v20120910]
    at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:70)[98:org.ops4j.pax.web.pax-web-jetty:1.1.11]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:534)[82:org.eclipse.jetty.security:7.6.7.v20120910]
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:117)[98:org.ops4j.pax.web.pax-web-jetty:1.1.11]
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374)[80:org.eclipse.jetty.servlet:7.6.7.v20120910]
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:972)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:75)[98:org.ops4j.pax.web.pax-web-jetty:1.1.11]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.server.Server.handle(Server.java:363)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:920)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:982)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)[79:org.eclipse.jetty.http:7.6.7.v20120910]
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)[79:org.eclipse.jetty.http:7.6.7.v20120910]
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627)[81:org.eclipse.jetty.io:7.6.7.v20120910]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51)[81:org.eclipse.jetty.io:7.6.7.v20120910]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[90:org.eclipse.jetty.util:7.6.7.v20120910]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[90:org.eclipse.jetty.util:7.6.7.v20120910]
    at java.lang.Thread.run(Thread.java:722)[:1.7.0_21]
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_21]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_21]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_21]
    at java.lang.reflect.Method.invoke(Method.java:601)[:1.7.0_21]
    at org.ops4j.pax.web.service.internal.HttpServiceStarted$1.invoke(HttpServiceStarted.java:182)[100:org.ops4j.pax.web.pax-web-runtime:1.1.11]
    ... 27 more
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.apache.karaf.jaas.boot.principal.RolePrincipal from bundle 234 (org.jboss.fuse.examples.secure-rest)
    at org.eclipse.jetty.plus.jaas.JAASLoginService.getGroups(JAASLoginService.java:327)
    at org.eclipse.jetty.plus.jaas.JAASLoginService.login(JAASLoginService.java:244)
    at org.eclipse.jetty.security.authentication.BasicAuthenticator.validateRequest(BasicAuthenticator.java:88)
    at org.eclipse.jetty.security.authentication.DeferredAuthentication.authenticate(DeferredAuthentication.java:108)
    at org.eclipse.jetty.server.Request.getUserPrincipal(Request.java:1251)
    at org.apache.cxf.transport.http.AbstractHTTPDestination.setupMessage(AbstractHTTPDestination.java:332)[159:org.apache.cxf.cxf-rt-transports-http:2.6.0.redhat-60024]
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:219)[159:org.apache.cxf.cxf-rt-transports-http:2.6.0.redhat-60024]
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:214)[159:org.apache.cxf.cxf-rt-transports-http:2.6.0.redhat-60024]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:194)[159:org.apache.cxf.cxf-rt-transports-http:2.6.0.redhat-60024]
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:130)[159:org.apache.cxf.cxf-rt-transports-http:2.6.0.redhat-60024]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:221)[159:org.apache.cxf.cxf-rt-transports-http:2.6.0.redhat-60024]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:146)[159:org.apache.cxf.cxf-rt-transports-http:2.6.0.redhat-60024]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)[95:org.apache.geronimo.specs.geronimo-servlet_2.5_spec:1.2]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:197)[159:org.apache.cxf.cxf-rt-transports-http:2.6.0.redhat-60024]
    ... 32 more
Caused by: java.lang.ClassNotFoundException: org.apache.karaf.jaas.boot.principal.RolePrincipal from bundle 234 (org.jboss.fuse.examples.secure-rest)
    at org.apache.cxf.bus.blueprint.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:116)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_21]
    at org.eclipse.jetty.plus.jaas.JAASLoginService.getGroups(JAASLoginService.java:315)
    ... 45 more
Caused by: java.lang.ClassNotFoundException: org.apache.karaf.jaas.boot.principal.RolePrincipal not found by org.jboss.fuse.examples.secure-rest [234]
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_21]
    at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1862)
    at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:937)
    at org.apache.cxf.bus.blueprint.BundleDelegatingClassLoader$1.run(BundleDelegatingClassLoader.java:54)
    at org.apache.cxf.bus.blueprint.BundleDelegatingClassLoader$1.run(BundleDelegatingClassLoader.java:52)
    at java.security.AccessController.doPrivileged(Native Method)[:1.7.0_21]
    at org.apache.cxf.bus.blueprint.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:52)
    at org.apache.cxf.bus.blueprint.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:110)
    ... 47 more
11:55:59,127 | WARN  | qtp25016004-186  | JAASLoginInterceptor             | 149 - org.apache.cxf.cxf-rt-core - 2.6.0.redhat-60024 | No user name and/or password is available, name: null, password: null 
11:55:59,128 | WARN  | qtp25016004-186  | PhaseInterceptorChain            | 147 - org.apache.cxf.cxf-api - 2.6.0.redhat-60024 | Interceptor for {http://security.jaxrs.cxf.examples.fuse.jboss.org/}CustomerService has thrown exception, unwinding now
java.lang.SecurityException
    at org.apache.cxf.interceptor.security.JAASLoginInterceptor.handleMessage(JAASLoginInterceptor.java:129)[149:org.apache.cxf.cxf-rt-core:2.6.0.redhat-60024]
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)[147:org.apache.cxf.cxf-api:2.6.0.redhat-60024]
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)[147:org.apache.cxf.cxf-api:2.6.0.redhat-60024]
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:236)
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:214)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:194)
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:130)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:221)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:146)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:197)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_21]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_21]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_21]
    at java.lang.reflect.Method.invoke(Method.java:601)[:1.7.0_21]
    at org.ops4j.pax.web.service.internal.HttpServiceStarted$1.invoke(HttpServiceStarted.java:182)[100:org.ops4j.pax.web.pax-web-runtime:1.1.11]
    at org.ops4j.pax.web.service.internal.$Proxy6.service(Unknown Source)[100:org.ops4j.pax.web.pax-web-runtime:1.1.11]
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)[80:org.eclipse.jetty.servlet:7.6.7.v20120910]
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:447)[80:org.eclipse.jetty.servlet:7.6.7.v20120910]
    at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:70)[98:org.ops4j.pax.web.pax-web-jetty:1.1.11]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:534)[82:org.eclipse.jetty.security:7.6.7.v20120910]
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:117)[98:org.ops4j.pax.web.pax-web-jetty:1.1.11]
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374)[80:org.eclipse.jetty.servlet:7.6.7.v20120910]
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:972)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:75)[98:org.ops4j.pax.web.pax-web-jetty:1.1.11]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.server.Server.handle(Server.java:363)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:920)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:982)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)[79:org.eclipse.jetty.http:7.6.7.v20120910]
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)[79:org.eclipse.jetty.http:7.6.7.v20120910]
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)[84:org.eclipse.jetty.server:7.6.7.v20120910]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627)[81:org.eclipse.jetty.io:7.6.7.v20120910]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51)[81:org.eclipse.jetty.io:7.6.7.v20120910]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[90:org.eclipse.jetty.util:7.6.7.v20120910]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[90:org.eclipse.jetty.util:7.6.7.v20120910]
    at java.lang.Thread.run(Thread.java:722)[:1.7.0_21]
  • Why the Java Client also throws above exception when running this example.

Environment

  • JBoss Fuse
    • 6.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content