Hi,

We are trying to build aai traversal and use it in deployment.

We cut our local branch from the master branch for aai-traversal(commit id
- 27f98af97a3cf47d9a8e370dab1d077b355bcdbe).

The build process went through fine but the image on deployment was
giving the below error

java.lang.NoClassDefFoundError: org/keycloak/common/enums/SslRequired
>
>         at
>> org.keycloak.adapters.KeycloakDeployment.<init>(KeycloakDeployment.java:75)
>
>         at
>> org.keycloak.adapters.KeycloakDeploymentBuilder.<init>(KeycloakDeploymentBuilder.java:50)
>
>         at
>> org.keycloak.adapters.KeycloakDeploymentBuilder.build(KeycloakDeploymentBuilder.java:202)
>
>         at
>> org.keycloak.adapters.springboot.KeycloakSpringBootConfigResolver.resolve(KeycloakSpringBootConfigResolver.java:41)
>
>         at
>> org.keycloak.adapters.springsecurity.config.KeycloakSpringConfigResolverWrapper.resolve(KeycloakSpringConfigResolverWrapper.java:40)
>
>         at
>> org.keycloak.adapters.AdapterDeploymentContext.resolveDeployment(AdapterDeploymentContext.java:89)
>
>         at
>> org.keycloak.adapters.jetty.core.AbstractKeycloakJettyAuthenticator.validateRequest(AbstractKeycloakJettyAuthenticator.java:287)
>
>         at
>> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:525)
>
>         at
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
>
>         at
>> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
>
>         at
>> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1607)
>
>         at
>> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
>
>         at
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1297)
>
>         at
>> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
>
>         at
>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
>
>         at
>> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1577)
>
>         at
>> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
>
>         at
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1212)
>
>         at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>
>         at
>> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
>
>         at
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
>
>         at org.eclipse.jetty.server.Server.handle(Server.java:500)
>
>         at
>> org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
>
>         at
>> org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)
>
>         at
>> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
>
>         at
>> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
>
>         at
>> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
>
>         at
>> org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
>
>         at
>> org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:543)
>
>         at
>> org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:398)
>
>         at
>> org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:161)
>
>         at
>> org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
>
>         at
>> org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
>
>         at
>> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
>
>         at
>> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
>
>         at
>> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
>
>         at
>> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
>
>         at
>> org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
>
>         at
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
>
>         at
>> org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
>
>         at java.lang.Thread.run(Thread.java:748)
>
>
>> 2021-09-06 09:31:30.725  WARN 10 --- [tp1430861186-34]
>> org.eclipse.jetty.server.HttpChannel     : /aai/util/echo
>
>
>> java.lang.NoClassDefFoundError: org/keycloak/common/enums/SslRequired
>
>
After some digging around, we added the keycloak-common dependency into the
aai-traversal/pom.xml file as shown below

<dependency>
>
>     <groupId>org.keycloak</groupId>
>
>     <artifactId>keycloak-common</artifactId>
>
>     <version>11.0.2</version>
>
> </dependency>
>
>
After this, the above error is not thrown anymore but we are getting the
below error.

java.lang.RuntimeException: Must set 'realm' in config
>
>         at
>> org.keycloak.adapters.KeycloakDeploymentBuilder.internalBuild(KeycloakDeploymentBuilder.java:57)
>
>         at
>> org.keycloak.adapters.KeycloakDeploymentBuilder.build(KeycloakDeploymentBuilder.java:202)
>
>         at
>> org.keycloak.adapters.springboot.KeycloakSpringBootConfigResolver.resolve(KeycloakSpringBootConfigResolver.java:41)
>
>         at
>> org.keycloak.adapters.springsecurity.config.KeycloakSpringConfigResolverWrapper.resolve(KeycloakSpringConfigResolverWrapper.java:40)
>
>         at
>> org.keycloak.adapters.AdapterDeploymentContext.resolveDeployment(AdapterDeploymentContext.java:89)
>
>         at
>> org.keycloak.adapters.jetty.core.AbstractKeycloakJettyAuthenticator.validateRequest(AbstractKeycloakJettyAuthenticator.java:287)
>
>         at
>> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:525)
>
>         at
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
>
>         at
>> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
>
>         at
>> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1607)
>
>         at
>> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
>
>         at
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1297)
>
>         at
>> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
>
>         at
>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
>
>         at
>> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1577)
>
>         at
>> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
>
>         at
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1212)
>
>         at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>
>         at
>> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
>
>         at
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
>
>         at org.eclipse.jetty.server.Server.handle(Server.java:500)
>
>         at
>> org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
>
>         at
>> org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)
>
>         at
>> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
>
>         at
>> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
>
>         at
>> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
>
>         at
>> org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
>
>         at
>> org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:543)
>
>         at
>> org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:398)
>
>         at
>> org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:161)
>
>         at
>> org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
>
>         at
>> org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
>
>         at
>> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
>
>         at
>> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
>
>         at
>> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
>
>         at
>> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
>
>         at
>> org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
>
>         at
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
>
>         at
>> org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
>
>         at java.lang.Thread.run(Thread.java:748)
>
>
The application.properties file inside the container has the below settings

# Start of Internal Specific Properties
>
> # Switch to one-way-ssl
>
> spring.profiles.active=production,one-way-ssl
>
> # Switch to keycloak
>
> #spring.profiles.active=production, keycloak
>
>

The application-keycloak.properties have the realm and everything set
properly

spring.autoconfigure.exclude=\
>
>   org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,\
>
>
>> org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
>
>
>> multi.tenancy.enabled=true
>
> keycloak.auth-server-url=http://localhost:8180/auth
>
> keycloak.realm=aai-traversal
>
> keycloak.resource=aai-traversal-app
>
> keycloak.public-client=false
>
> keycloak.principal-attribute=preferred_username
>
>
>> keycloak.ssl-required=external
>
> keycloak.bearer-only=true
>
>
Are we missing something? We have not made any other changes to the pom.xml.


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#23536): https://lists.onap.org/g/onap-discuss/message/23536
Mute This Topic: https://lists.onap.org/mt/85453857/21656
Group Owner: [email protected]
Unsubscribe: https://lists.onap.org/g/onap-discuss/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to