New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing process spring boot has many ERRORs logged to console #2555

Closed
davsclaus opened this Issue Sep 18, 2014 · 19 comments

Comments

Projects
None yet
2 participants
@davsclaus
Member

davsclaus commented Sep 18, 2014

such as

[org.springframework.boot:type=Endpoint,name=healthEndpoint]
2014-09-18 09:53:37.838 ERROR 19364 --- [           main] o.s.b.a.e.jmx.EndpointMBeanExporter      : Could not register MBean for endpoint [healthEndpoint]

org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [org.springframework.boot.actuate.endpoint.jmx.DataEndpointMBean@9af3f7] with key 'healthEndpoint'; nested exception is javax.management.InstanceAlreadyExistsException: org.springframework.boot:type=Endpoint,name=healthEndpoint
    at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:609)
@davsclaus

This comment has been minimized.

Show comment
Hide comment
@davsclaus

davsclaus Sep 18, 2014

Member

@hekonsek have you spotted the many ERRORs being logged when you test spring boot.

And btw we got a bit of dependency hell with spring boot BOM vs fabric8 BOM

The spring guys has amq 5.9.1
http://search.maven.org/remotecontent?filepath=org/springframework/boot/spring-boot-dependencies/1.1.6.RELEASE/spring-boot-dependencies-1.1.6.RELEASE.pom

Which causes the spring boot modules to build and test against the wrong AMQ version as we use 5.10.0, and we will upgrade to 5.11.0 when its released etc.

So if you flip the order of the BOMs in
https://github.com/fabric8io/fabric8/blob/master/process/process-spring-boot/process-spring-boot-bom/pom.xml#L82

Then AMQ 5.10.0 is picked up, but then you get some mysterious errors about Type errors as reported here: spring-projects/spring-boot#150

Member

davsclaus commented Sep 18, 2014

@hekonsek have you spotted the many ERRORs being logged when you test spring boot.

And btw we got a bit of dependency hell with spring boot BOM vs fabric8 BOM

The spring guys has amq 5.9.1
http://search.maven.org/remotecontent?filepath=org/springframework/boot/spring-boot-dependencies/1.1.6.RELEASE/spring-boot-dependencies-1.1.6.RELEASE.pom

Which causes the spring boot modules to build and test against the wrong AMQ version as we use 5.10.0, and we will upgrade to 5.11.0 when its released etc.

So if you flip the order of the BOMs in
https://github.com/fabric8io/fabric8/blob/master/process/process-spring-boot/process-spring-boot-bom/pom.xml#L82

Then AMQ 5.10.0 is picked up, but then you get some mysterious errors about Type errors as reported here: spring-projects/spring-boot#150

@davsclaus

This comment has been minimized.

Show comment
Hide comment
@davsclaus

davsclaus Sep 18, 2014

Member

Anyway the goal is to make the spring boot quickstart works as both the shipped quickstarts, but also if you create a new projects using the archetype - and today that is not the case.

Member

davsclaus commented Sep 18, 2014

Anyway the goal is to make the spring boot quickstart works as both the shipped quickstarts, but also if you create a new projects using the archetype - and today that is not the case.

@davsclaus

This comment has been minimized.

Show comment
Hide comment
@davsclaus

davsclaus Sep 18, 2014

Member

Looks like I can get process-spring-boot to use our version of ActiveMQ by adjusting a pom.xml to refer to 5.10.0.

Just one more BOM hell to work around. Another is Spring 3.x vs 4.x that has caused a bit of pain to ensure we use spring 4 in the spring-boot examples.

Member

davsclaus commented Sep 18, 2014

Looks like I can get process-spring-boot to use our version of ActiveMQ by adjusting a pom.xml to refer to 5.10.0.

Just one more BOM hell to work around. Another is Spring 3.x vs 4.x that has caused a bit of pain to ensure we use spring 4 in the spring-boot examples.

@hekonsek

This comment has been minimized.

Show comment
Hide comment
@hekonsek

hekonsek Sep 18, 2014

Contributor

Hi,

Some of the errors are the "good errors" - for example demonstrating that Spring Boot falls back to regular properties resolver if the ZooKeeper is not available. If this is the case, I'll hide the stack traces on the logback level.

I'll review all the other cases, see what's happening and fix the errors.

I'll also help you the Spring Boot BOM hell. The main issue here is that we should do our best to use dependencies provided by Spring Boot BOM and change only the dependencies we really need to (like AMQ). Otherwise it is really easy to break Spring Boot app - one dependency in wrong version is sometimes enough.

Cheers.

Contributor

hekonsek commented Sep 18, 2014

Hi,

Some of the errors are the "good errors" - for example demonstrating that Spring Boot falls back to regular properties resolver if the ZooKeeper is not available. If this is the case, I'll hide the stack traces on the logback level.

I'll review all the other cases, see what's happening and fix the errors.

I'll also help you the Spring Boot BOM hell. The main issue here is that we should do our best to use dependencies provided by Spring Boot BOM and change only the dependencies we really need to (like AMQ). Otherwise it is really easy to break Spring Boot app - one dependency in wrong version is sometimes enough.

Cheers.

@davsclaus

This comment has been minimized.

Show comment
Hide comment
@davsclaus

davsclaus Sep 18, 2014

Member

Okay spotted that maybe the type issue is due
spring-projects/spring-boot#1065

And found that they have deprecated by type

public @interface ConditionalOnMissingClass {

    /**
     * The classes that must not be present. Since this annotation parsed by loading class
     * bytecode it is safe to specify classes here that may ultimately not be on the
     * classpath.
     * @return the classes that must be present
     * @deprecated Since 1.1.0 due to the fact that the reflection errors can occur when
     * beans containing the annotation remain in the context. Use {@link #name()} instead.
     */
    @Deprecated
    public Class<?>[] value() default {};

    /**
     * The classes names that must not be present.
     * @return the class names that must be present.
     */
    public String[] name() default {};

}

So switching the activemq-starter to use string name instead

Member

davsclaus commented Sep 18, 2014

Okay spotted that maybe the type issue is due
spring-projects/spring-boot#1065

And found that they have deprecated by type

public @interface ConditionalOnMissingClass {

    /**
     * The classes that must not be present. Since this annotation parsed by loading class
     * bytecode it is safe to specify classes here that may ultimately not be on the
     * classpath.
     * @return the classes that must be present
     * @deprecated Since 1.1.0 due to the fact that the reflection errors can occur when
     * beans containing the annotation remain in the context. Use {@link #name()} instead.
     */
    @Deprecated
    public Class<?>[] value() default {};

    /**
     * The classes names that must not be present.
     * @return the class names that must be present.
     */
    public String[] name() default {};

}

So switching the activemq-starter to use string name instead

@davsclaus

This comment has been minimized.

Show comment
Hide comment
@davsclaus

davsclaus Sep 18, 2014

Member

Yay that seems to work better now I got #2556

Member

davsclaus commented Sep 18, 2014

Yay that seems to work better now I got #2556

@davsclaus

This comment has been minimized.

Show comment
Hide comment
@davsclaus

davsclaus Sep 18, 2014

Member

@hekonsek yeah see it seems you do that by importing the spring boot BOM first, and then fabric8 as 2nd. Though not sure if they can overlay correctly, as it seems that the 1st BOM always wins, so in this case for AMQ you need to add those explicit in our pom.xml as part of fabric8. But I guess we can manage this, if this is the way. I guess spring boot dont have CXF or Camel or Karaf in their pom.xml.

But anyway maybe you can get the spring boot guys to upgrade to AMQ 5.10.0 at least?
And btw why are they having AMQ in there?

Member

davsclaus commented Sep 18, 2014

@hekonsek yeah see it seems you do that by importing the spring boot BOM first, and then fabric8 as 2nd. Though not sure if they can overlay correctly, as it seems that the 1st BOM always wins, so in this case for AMQ you need to add those explicit in our pom.xml as part of fabric8. But I guess we can manage this, if this is the way. I guess spring boot dont have CXF or Camel or Karaf in their pom.xml.

But anyway maybe you can get the spring boot guys to upgrade to AMQ 5.10.0 at least?
And btw why are they having AMQ in there?

@hekonsek

This comment has been minimized.

Show comment
Hide comment
@hekonsek

hekonsek Sep 18, 2014

Contributor

@davsclaus #2556 is Spring Boot related? When can you see it?

I'll create PR to upgrade AMQ version in Spring Boot. I'll also check why they have it in the first place. For now maintaining AMQ in our pom.xml should be way to go.

Contributor

hekonsek commented Sep 18, 2014

@davsclaus #2556 is Spring Boot related? When can you see it?

I'll create PR to upgrade AMQ version in Spring Boot. I'll also check why they have it in the first place. For now maintaining AMQ in our pom.xml should be way to go.

@davsclaus

This comment has been minimized.

Show comment
Hide comment
@davsclaus

davsclaus Sep 18, 2014

Member

I see #2556 when I create the spring boot activemq quickstart from fabric8, and I can see it in the logs from the logs dir.

Not sure if it before by mistake picked the osgi version, and now it uses the ZK one which seems to not work btw - maybe due something with security. I now get

2014-09-18 11:22:09.234  WARN 22123 --- [ActiveMQ Task-1] o.a.a.t.failover.FailoverTransport       : Failed to connect to [] after: 40 attempt(s) continuing to retry.
Member

davsclaus commented Sep 18, 2014

I see #2556 when I create the spring boot activemq quickstart from fabric8, and I can see it in the logs from the logs dir.

Not sure if it before by mistake picked the osgi version, and now it uses the ZK one which seems to not work btw - maybe due something with security. I now get

2014-09-18 11:22:09.234  WARN 22123 --- [ActiveMQ Task-1] o.a.a.t.failover.FailoverTransport       : Failed to connect to [] after: 40 attempt(s) continuing to retry.
@davsclaus

This comment has been minimized.

Show comment
Hide comment
@davsclaus

davsclaus Sep 18, 2014

Member

On lunch break

Member

davsclaus commented Sep 18, 2014

On lunch break

@hekonsek

This comment has been minimized.

Show comment
Hide comment
@hekonsek

hekonsek Sep 18, 2014

Contributor

I'll check this out. To be honest I haven't tried AMQ and Camel quickstarts so far. I only reviewed, improved and testes webmvc after James crated them.

Contributor

hekonsek commented Sep 18, 2014

I'll check this out. To be honest I haven't tried AMQ and Camel quickstarts so far. I only reviewed, improved and testes webmvc after James crated them.

@davsclaus

This comment has been minimized.

Show comment
Hide comment
@davsclaus

davsclaus Sep 18, 2014

Member

Ah okay, so the AMQ may be broken due that ZK stuff. Will try the others to ensure they work still.

Member

davsclaus commented Sep 18, 2014

Ah okay, so the AMQ may be broken due that ZK stuff. Will try the others to ensure they work still.

@davsclaus

This comment has been minimized.

Show comment
Hide comment
@davsclaus

davsclaus Sep 18, 2014

Member

Okay the mvc works. AMQ has the ZK issue. And Camel 2.13.2 doesn't run with spring 4, got some weird error. Though as we want to upgrade to Camel 2.14 it may be easier when that release is out.

Member

davsclaus commented Sep 18, 2014

Okay the mvc works. AMQ has the ZK issue. And Camel 2.13.2 doesn't run with spring 4, got some weird error. Though as we want to upgrade to Camel 2.14 it may be easier when that release is out.

@hekonsek

This comment has been minimized.

Show comment
Hide comment
@hekonsek

hekonsek Sep 18, 2014

Contributor

I tested it with Camel 2.13.x, so I guess it's another classpath issue. Need to nail it. I'll start to handle all this stuff later today. Thanks for all the comments!

Contributor

hekonsek commented Sep 18, 2014

I tested it with Camel 2.13.x, so I guess it's another classpath issue. Need to nail it. I'll start to handle all this stuff later today. Thanks for all the comments!

@hekonsek

This comment has been minimized.

Show comment
Hide comment
@hekonsek

hekonsek Sep 18, 2014

Contributor

@davsclaus I've fixed the [org.springframework.boot:type=Endpoint,name=healthEndpoint] exceptions by disabling JMX actuators for the time of the tests. Each JUnit test execution started new Spring Boot context (for purpose) and tried to registered the same Spring Boot's MBeans many times. We don't need JMX in these tests.

I'll look up for the other issues later today and tomorrow.

Cheers.

Contributor

hekonsek commented Sep 18, 2014

@davsclaus I've fixed the [org.springframework.boot:type=Endpoint,name=healthEndpoint] exceptions by disabling JMX actuators for the time of the tests. Each JUnit test execution started new Spring Boot context (for purpose) and tried to registered the same Spring Boot's MBeans many times. We don't need JMX in these tests.

I'll look up for the other issues later today and tomorrow.

Cheers.

@davsclaus

This comment has been minimized.

Show comment
Hide comment
@davsclaus

davsclaus Sep 19, 2014

Member

Okay the spring boot activemq archetype now only need to have some username/password setup for the ZK login

Caused by: javax.jms.IllegalStateException: javax.jms.JMSSecurityException: User name [null] or password is invalid.
    at org.apache.activemq.jms.pool.ConnectionPool.createSession(ConnectionPool.java:135)
    at org.apache.activemq.jms.pool.PooledConnection.createSession(PooledConnection.java:167)
    at org.springframework.jms.support.JmsAccessor.createSession(JmsAccessor.java:197)
    at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:482)
    ... 26 more
Caused by: javax.jms.JMSSecurityException: User name [null] or password is invalid.
    at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:52)
    at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1417)
    at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1522)
    at org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:328)
    at org.apache.activemq.jms.pool.ConnectionPool.makeSession(ConnectionPool.java:104)
    at org.apache.activemq.jms.pool.ConnectionPool$1.makeObject(ConnectionPool.java:81)
    at org.apache.activemq.jms.pool.ConnectionPool$1.makeObject(ConnectionPool.java:66)
    at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220)
    at org.apache.activemq.jms.pool.ConnectionPool.createSession(ConnectionPool.java:133)
    ... 29 more
Caused by: java.lang.SecurityException: User name [null] or password is invalid.
    at org.apache.activemq.security.JaasAuthenticationBroker.addConnection(JaasAuthenticationBroker.java:80)
    at org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:97)
    at org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:764)
    at org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:79)
    at org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:139)
    at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:294)
    at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:148)
    at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)
    at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
    at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:270)
    at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
    at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:214)
    at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196)
    at java.lang.Thread.run(Thread.java:744)
Caused by: javax.security.auth.login.FailedLoginException: user name is null
    at io.fabric8.jaas.ZookeeperLoginModule.login(ZookeeperLoginModule.java:111)
    at org.apache.karaf.jaas.boot.ProxyLoginModule.login(ProxyLoginModule.java:83)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:784)
    at javax.security.auth.login.LoginContext.access$000(LoginContext.java:203)
    at javax.security.auth.login.LoginContext$4.run(LoginContext.java:698)
    at javax.security.auth.login.LoginContext$4.run(LoginContext.java:696)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:695)
    at javax.security.auth.login.LoginContext.login(LoginContext.java:594)
    at org.apache.activemq.security.JaasAuthenticationBroker.addConnection(JaasAuthenticationBroker.java:73)
    ... 13 more
Member

davsclaus commented Sep 19, 2014

Okay the spring boot activemq archetype now only need to have some username/password setup for the ZK login

Caused by: javax.jms.IllegalStateException: javax.jms.JMSSecurityException: User name [null] or password is invalid.
    at org.apache.activemq.jms.pool.ConnectionPool.createSession(ConnectionPool.java:135)
    at org.apache.activemq.jms.pool.PooledConnection.createSession(PooledConnection.java:167)
    at org.springframework.jms.support.JmsAccessor.createSession(JmsAccessor.java:197)
    at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:482)
    ... 26 more
Caused by: javax.jms.JMSSecurityException: User name [null] or password is invalid.
    at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:52)
    at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1417)
    at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1522)
    at org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:328)
    at org.apache.activemq.jms.pool.ConnectionPool.makeSession(ConnectionPool.java:104)
    at org.apache.activemq.jms.pool.ConnectionPool$1.makeObject(ConnectionPool.java:81)
    at org.apache.activemq.jms.pool.ConnectionPool$1.makeObject(ConnectionPool.java:66)
    at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220)
    at org.apache.activemq.jms.pool.ConnectionPool.createSession(ConnectionPool.java:133)
    ... 29 more
Caused by: java.lang.SecurityException: User name [null] or password is invalid.
    at org.apache.activemq.security.JaasAuthenticationBroker.addConnection(JaasAuthenticationBroker.java:80)
    at org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:97)
    at org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:764)
    at org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:79)
    at org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:139)
    at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:294)
    at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:148)
    at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)
    at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
    at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:270)
    at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
    at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:214)
    at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196)
    at java.lang.Thread.run(Thread.java:744)
Caused by: javax.security.auth.login.FailedLoginException: user name is null
    at io.fabric8.jaas.ZookeeperLoginModule.login(ZookeeperLoginModule.java:111)
    at org.apache.karaf.jaas.boot.ProxyLoginModule.login(ProxyLoginModule.java:83)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:784)
    at javax.security.auth.login.LoginContext.access$000(LoginContext.java:203)
    at javax.security.auth.login.LoginContext$4.run(LoginContext.java:698)
    at javax.security.auth.login.LoginContext$4.run(LoginContext.java:696)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:695)
    at javax.security.auth.login.LoginContext.login(LoginContext.java:594)
    at org.apache.activemq.security.JaasAuthenticationBroker.addConnection(JaasAuthenticationBroker.java:73)
    ... 13 more
@hekonsek

This comment has been minimized.

Show comment
Hide comment
@hekonsek

hekonsek Sep 22, 2014

Contributor

Fixed yet another ugly stracktrace from the tests. Will take a look at the Boot AMQ quickstart soon.

Contributor

hekonsek commented Sep 22, 2014

Fixed yet another ugly stracktrace from the tests. Will take a look at the Boot AMQ quickstart soon.

@davsclaus davsclaus added this to the 1.2.0.Beta5 milestone Sep 23, 2014

@davsclaus

This comment has been minimized.

Show comment
Hide comment
@davsclaus

davsclaus Sep 23, 2014

Member

The spring boot quickstarts are working fine now. Thanks for the help.

Member

davsclaus commented Sep 23, 2014

The spring boot quickstarts are working fine now. Thanks for the help.

@davsclaus davsclaus closed this Sep 23, 2014

@hekonsek

This comment has been minimized.

Show comment
Hide comment
@hekonsek

hekonsek Sep 23, 2014

Contributor

Cool. Ping me if spot anything ugly in Spring Boot stuff.

Contributor

hekonsek commented Sep 23, 2014

Cool. Ping me if spot anything ugly in Spring Boot stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment