1 Reply Latest reply on Sep 9, 2013 10:19 AM by Tom Cunningham

    Dependency Issue with JAAS Auth

    Reji Mathews Newbie

      Hey

       

      I am trying to create a JAAS AUTH on my CXF endpoint which is exposed as service to another application..

      I get following error

       

      ERROR

      -----------------------------------

      org.osgi.framework.BundleException: Unresolved constraint in bundle com.outotec.mes-bw-copper_recovery_perc_ssl_JAAS [458]: Unable to resolve 458.0: missing requirement [458.0] osgi.wiring.package; (osgi.wiring.package=org.eclipse.jetty.http.security)

        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4054)

        at org.apache.felix.framework.Felix.startBundle(Felix.java:1959)

        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:947)

        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:934)

       

      I have included every possible related dependency in my POM file.. POM File attached below. Could anybody please help me resolve this problem. Its really urgent..

       

       

      POM FILE

      -----------------------------------

       

      <?xml version="1.0" encoding="UTF-8" standalone="no"?>

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

       

       

        <modelVersion>4.0.0</modelVersion>

       

       

       

       

       

       

        <version>1.0.0</version>

        <groupId>com.outotec</groupId>

        <artifactId>mes-bw-copper_recovery_perc_ssl_JAAS</artifactId>

        <name>Copper_Recovery_Percentage_Ssl_JAAS</name>

        <description>Creates a web service using the WSDL contract first</description>

        <packaging>bundle</packaging>

       

       

       

       

        <repositories>

        <repository>

        <id>fusesource</id>

        <name>FuseSource Release Repository</name>

        <url>http://repo.fusesource.com/nexus/content/groups/public/</url>

        <snapshots>

        <enabled>false</enabled>

        </snapshots>

        <releases>

        <enabled>true</enabled>

        </releases>

        </repository>

        <repository>

        <id>fusesource.ea</id>

        <name>FuseSource Community Early Access Release Repository</name>

        <url>http://repo.fusesource.com/nexus/content/groups/ea</url>

        <snapshots>

        <enabled>false</enabled>

        </snapshots>

        <releases>

        <enabled>true</enabled>

        </releases>

        </repository>

        <repository>

        <id>jboss-public-repository-group</id>

        <name>JBoss Public Repository Group</name>

        <url>http://repository.jboss.org/nexus/content/groups/public/</url>

        <layout>default</layout>

        <releases>

        <enabled>true</enabled>

        <updatePolicy>never</updatePolicy>

        </releases>

        <snapshots>

        <enabled>true</enabled>

        <updatePolicy>daily</updatePolicy>

        </snapshots>

        </repository>

       

       

       

       

        <!-- <repository> <id>jetty-releases</id> <name>Jetty Releases</name> <url>https://oss.sonatype.org/content/repositories/jetty-releases</url>

        </repository> -->

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

        </repositories>

       

       

        <pluginRepositories>

        <pluginRepository>

        <id>fusesource</id>

        <name>FuseSource Release Repository</name>

        <url>http://repo.fusesource.com/nexus/content/groups/public/</url>

        <snapshots>

        <enabled>false</enabled>

        </snapshots>

        <releases>

        <enabled>true</enabled>

        </releases>

        </pluginRepository>

        <pluginRepository>

        <id>fusesource.ea</id>

        <name>FuseSource Community Early Access Release Repository</name>

        <url>http://repo.fusesource.com/nexus/content/groups/ea</url>

        <snapshots>

        <enabled>false</enabled>

        </snapshots>

        <releases>

        <enabled>true</enabled>

        </releases>

        </pluginRepository>

        </pluginRepositories>

       

       

       

       

        <dependencies>

       

       

        <dependency>

        <groupId>org.apache.camel</groupId>

        <artifactId>camel-core</artifactId>

        <version>2.10.0.fuse-71-047</version>

        </dependency>

       

       

        <dependency>

        <groupId>org.apache.camel</groupId>

        <artifactId>camel-cxf</artifactId>

        <version>2.10.0.fuse-71-047</version>

        </dependency>

       

       

        <dependency>

        <groupId>log4j</groupId>

        <artifactId>log4j</artifactId>

        <version>1.2.16</version>

        </dependency>

       

       

        <!-- cxf using slf4j -->

        <dependency>

        <groupId>org.slf4j</groupId>

        <artifactId>slf4j-api</artifactId>

        <version>1.7.5</version>

        </dependency>

        <dependency>

        <groupId>org.slf4j</groupId>

        <artifactId>slf4j-log4j12</artifactId>

        <version>1.6.1</version>

        </dependency>

       

       

        <!-- using Jetty with CXF -->

        <dependency>

        <groupId>org.apache.cxf</groupId>

        <artifactId>cxf-rt-transports-http-jetty</artifactId>

        <version>2.6.0.fuse-71-047</version>

        </dependency>

       

       

        <dependency>

        <groupId>org.apache.camel</groupId>

        <artifactId>camel-test-spring</artifactId>

        <version>2.10.0.fuse-71-047</version>

        <scope>test</scope>

        </dependency>

       

       

        <dependency>

        <groupId>junit</groupId>

        <artifactId>junit</artifactId>

        <version>4.10</version>

        <scope>test</scope>

        </dependency>

       

       

        <dependency>

        <groupId>com.google.code.maven-play-plugin.hsqldb</groupId>

        <artifactId>hsqldb</artifactId>

        <version>1.8.1.2</version>

        </dependency>

       

       

        <dependency>

        <groupId>org.eclipse.jetty</groupId>

        <artifactId>jetty-server</artifactId>

        <version>8.0.0.M3</version>

        </dependency>

       

       

        <!-- DONE TILL HERE -->

       

       

        <!-- <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-security</artifactId>

        <version>8.1.12.v20130726</version> </dependency> -->

        <dependency>

        <groupId>org.eclipse.jetty</groupId>

        <artifactId>jetty-http</artifactId>

        <version>9.0.0.RC2</version>

        </dependency>

       

       

       

       

        <dependency>

        <groupId>org.eclipse.jetty.aggregate</groupId>

        <artifactId>jetty-webapp</artifactId>

        <version>8.0.0.RC0</version>

        </dependency>

       

       

        <dependency>

        <groupId>org.eclipse.jetty.aggregate</groupId>

        <artifactId>jetty-plus</artifactId>

        <version>8.0.0.M3</version>

        </dependency>

        </dependencies>

       

       

        <build>

        <plugins>

        <plugin>

        <groupId>org.apache.felix</groupId>

        <artifactId>maven-bundle-plugin</artifactId>

        <version>2.3.4</version>

        <extensions>true</extensions>

        <configuration>

        <jettyXml>jetty.xml,jetty-ssl.xml,jetty-https.xml</jettyXml>

       

       

        <instructions>

        <Import-Package> javax.security.auth,

        javax.security.auth.callback,

        javax.security.auth.login,

        javax.security.auth.spi,

        org.apache.karaf.jaas.modules,

        org.eclipse.jetty.plus.jaas;version="8.0.0.M3",

        org.eclipse.jetty.security;version="7.6.7",

        org.eclipse.jetty.http.security;

        *

        </Import-Package>

        </instructions>

        </configuration>

        </plugin>

       

       

       

       

        <plugin>

        <groupId>org.apache.cxf</groupId>

        <artifactId>cxf-codegen-plugin</artifactId>

        <version>2.7.6</version>

        <executions>

        <execution>

        <id>generate-sources</id>

        <phase>generate-sources</phase>

        <configuration>

        <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>

        <wsdlOptions>

        <wsdlOption>

        <wsdl>${basedir}/src/main/resources/wsdl/SI_ID56_CopperRecovery_async_outService.wsdl</wsdl>

        <extraargs>

        <extraarg>-impl</extraarg>

        </extraargs>

        </wsdlOption>

        </wsdlOptions>

        </configuration>

        <goals>

        <goal>wsdl2java</goal>

        </goals>

        </execution>

        </executions>

        </plugin>

       

       

        <plugin>

        <groupId>org.apache.maven.plugins</groupId>

        <artifactId>maven-compiler-plugin</artifactId>

        <version>3.1</version>

        <configuration>

        <source>1.6</source>

        <target>1.6</target>

        </configuration>

        </plugin>

       

       

        <plugin>

        <groupId>org.apache.maven.plugins</groupId>

        <artifactId>maven-resources-plugin</artifactId>

        <version>2.6</version>

        </plugin>

       

       

        <!-- allows the route to be ran via 'mvn camel:run' -->

        <plugin>

        <groupId>org.apache.camel</groupId>

        <artifactId>camel-maven-plugin</artifactId>

        <version>2.10.0.fuse-71-047</version>

        </plugin>

       

       

        <plugin>

        <!-- This plugin is needed for the servlet example -->

        <groupId>org.mortbay.jetty</groupId>

        <artifactId>jetty-maven-plugin</artifactId>

        <version>8.1.0.RC5</version>

        </plugin>

       

       

       

       

       

       

        </plugins>

        </build>

        <properties>

       

       

        <jettyVersion>7.6.7.v20120910</jettyVersion>

        </properties>

      </project>

       

       

       

       

      JETTY-SPRING.XML

      -------------------------------

      <?xml version="1.0" encoding="UTF-8"?>

      <beans xmlns="http://www.springframework.org/schema/beans"

        xmlns:camel="http://camel.apache.org/schema/spring" xmlns:osgi="http://www.springframework.org/schema/osgi"

        xmlns:sec="http://cxf.apache.org/configuration/security"

        xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

             http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd

              http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd

               http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd

          http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd

             ">

       

        <import resource="classpath:META-INF/spring/camel-route.xml" />

        <import resource="classpath:META-INF/spring/camel-cxf.xml" />

       

       

        <!-- -->

        <bean id="loginService" class="org.eclipse.jetty.plus.jaas.JAASLoginService">

        <property name="name" value="karaf" />

        <property name="loginModuleName" value="karaf" />

        <property name="roleClassNames">

        <list>

        <value>org.apache.karaf.jaas.modules.RolePrincipal</value>

        </list>

        </property>

        </bean>

       

       

        <bean id="identityService" class="org.eclipse.jetty.security.DefaultIdentityService" />

       

       

        <bean id="constraint" class="org.eclipse.jetty.http.security.Constraint">

        <property name="name" value="BASIC" />

        <property name="roles" value="admin" />

        <property name="authenticate" value="true" />

        </bean>

       

       

        <bean id="constraintMapping" class="org.eclipse.jetty.security.ConstraintMapping">

        <property name="constraint" ref="constraint" />

        <property name="pathSpec" value="/*" />

        </bean>

       

       

        <bean id="securityHandler" class="org.eclipse.jetty.security.ConstraintSecurityHandler">

        <property name="authenticator">

        <bean class="org.eclipse.jetty.security.authentication.BasicAuthenticator" />

        </property>

        <property name="constraintMappings">

        <list>

        <ref bean="constraintMapping" />

        </list>

        </property>

        <property name="loginService" ref="loginService" />

        <property name="strict" value="false" />

        <property name="identityService" ref="DefaultIdentiyService" />

        </bean>

       

       

       

       

       

       

      <!--

      <camelContext trace="true" xmlns="http://camel.apache.org/schema/spring">

              <route>

                  <from uri="jetty:http://0.0.0.0:8282/services?handlers=securityHandler&matchOnUriPrefix=true"/>

                  <transform>

                      <constant>&lt;html>&lt;body>Hello from Fuse ESB server&lt;/body>&lt;/html></constant>

                  </transform>

              </route>

          </camelContext> -->

       

       

       

      </beans>