Springboot hit runtime error: could not resolve placeholder - spring-boot-gradle-plugin

I am hitting the following error when run the springboot gradle app. May i know if there is any way for external config to reference the the variable in application.properties?
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'default.user' in value "${default.user}"
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:180) ~[spring-core-5.3.24.jar:5.3.24]
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126) ~[spring-core-5.3.24.jar:5.3.24]
at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:239) ~[spring-core-5.3.24.jar:5.3.24]
at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210) ~[spring-core-5.3.24.jar:5.3.24]
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.lambda$processProperties$0(PropertySourcesPlaceholderConfigurer.java:191) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:936) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1332) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.24.jar:5.3.24]
... 17 common frames omitted
src/main/resources/application.properties
app.user=testaccount
src/main/resources/config/testing.properties
default.user=${app.user}
code
#Value("${default.user}") private String defaultUser;
i have tried by adding the following in the application.properties but it is still not working.
spring.config.location=/config/testing.properties
spring.config.additional-location=/config/testing.properties

Related

"java.lang.IllegalStateException: TableMetadataFactory cannot be used before it is started" running Gunit tests

When running Gunit tests for ClaimCenter using the following command and tomcat running we get an error related to the TableMetaDataFactory.
call ant -f Gunittestingtasks.xml rungunitReport -Dgunit.test.packages=com.lmig.pm.cl.cc.plugins >> d:\tmp\gunit.txt
Below is the full stack trace of a single error out of the Gunit test report XML file.
<testcase classname="com.lmig.claims.assignment.AssignmentFactoryTest" gosu="true" name="testAssignmentRepoInstantiation" time="0.013">
<error message="java.lang.IllegalStateException: TableMetadataFactory Caused by: java.lang.LinkageError type="java.lang.RuntimeException">java.lang.RuntimeException: java.lang.IllegalStateException: TableMetadataFactory cannot be used before it is started
at gw.testharness.v3.PLServerTestEnvironment.beforeTestSuite(PLServerTestEnvironment.java:50)
at com.guidewire.api.test.TestExecutionManager.maybeCallBeforeTestSuite(TestExecutionManager.java:206)
at com.guidewire.api.test.TestExecutionManager.runTestClass(TestExecutionManager.java:115)
at gw.api.test.TestClass.run(TestClass.java:318)
at com.guidewire.api.test.TestClassWrapper.runTest(TestClassWrapper.java:48)
at gw.test.Suite.run(Suite.java:385)
Caused by: java.lang.IllegalStateException: TableMetadataFactory cannot be used before it is started
at com.guidewire.pl.system.database.metadata.TableMetadataFactoryImpl.getTableMetadata(TableMetadataFactoryImpl.java:78)
at com.guidewire.pl.system.database.metadata.TableMetadataFactoryImpl.getColumn(TableMetadataFactoryImpl.java:102)
at com.guidewire.pl.system.database.impl.ForwardJoinCondition.<init>(ForwardJoinCondition.java:40)
at com.guidewire.pl.system.database.impl.TableObjectImpl.join(TableObjectImpl.java:225)
at com.guidewire.pl.domain.community.impl.AbstractUserFinder.getCredentialQuery(AbstractUserFinder.java:193)
at com.guidewire.pl.domain.community.impl.AbstractUserFinder.findByCredentialName(AbstractUserFinder.java:82)
at com.guidewire.pl.domain.community.impl.AbstractUserFinder.findSystemUser(AbstractUserFinder.java:53)
at com.guidewire.pl.system.security.impl.SuperUserIdentifierImpl.initIfNecessary(SuperUserIdentifierImpl.java:61)
at com.guidewire.pl.system.security.impl.SuperUserIdentifierImpl.getSystemServicesUserId(SuperUserIdentifierImpl.java:54)
at gw.testharness.v3.PLServerTestEnvironment.executeBeforeBackUpDatabase(PLServerTestEnvironment.java:73)
at gw.testharness.v3.PLServerTestEnvironment.afterServerStarted(PLServerTestEnvironment.java:55)
at gw.testharness.v3.PLServerTestEnvironment.beforeTestSuite(PLServerTestEnvironment.java:48)
</error>
<error message="java.lang.IllegalStateException: TableMetadataFactory cannot be used before it is started" type="java.lang.RuntimeException">java.lang.RuntimeException: java.lang.IllegalStateException: TableMetadataFactory cannot be used before it is started
at gw.testharness.v3.PLServerTestEnvironment.beforeTestSuite(PLServerTestEnvironment.java:50)
at com.guidewire.api.test.TestExecutionManager.maybeCallBeforeTestSuite(TestExecutionManager.java:206)
at com.guidewire.api.test.TestExecutionManager.runTestClass(TestExecutionManager.java:115)
at gw.api.test.TestClass.run(TestClass.java:318)
at com.guidewire.api.test.TestClassWrapper.runTest(TestClassWrapper.java:48)
at gw.test.Suite.run(Suite.java:385)
Caused by: java.lang.IllegalStateException: TableMetadataFactory cannot be used before it is started
at com.guidewire.pl.system.database.metadata.TableMetadataFactoryImpl.getTableMetadata(TableMetadataFactoryImpl.java:78)
at com.guidewire.pl.system.database.metadata.TableMetadataFactoryImpl.getColumn(TableMetadataFactoryImpl.java:102)
at com.guidewire.pl.system.database.impl.ForwardJoinCondition.<init>(ForwardJoinCondition.java:40)
at com.guidewire.pl.system.database.impl.TableObjectImpl.join(TableObjectImpl.java:225)
at com.guidewire.pl.domain.community.impl.AbstractUserFinder.getCredentialQuery(AbstractUserFinder.java:193)
at com.guidewire.pl.domain.community.impl.AbstractUserFinder.findByCredentialName(AbstractUserFinder.java:82)
at com.guidewire.pl.domain.community.impl.AbstractUserFinder.findSystemUser(AbstractUserFinder.java:53)
at com.guidewire.pl.system.security.impl.SuperUserIdentifierImpl.initIfNecessary(SuperUserIdentifierImpl.java:61)
at com.guidewire.pl.system.security.impl.SuperUserIdentifierImpl.getSystemServicesUserId(SuperUserIdentifierImpl.java:54)
at gw.testharness.v3.PLServerTestEnvironment.executeBeforeBackUpDatabase(PLServerTestEnvironment.java:73)
at gw.testharness.v3.PLServerTestEnvironment.afterServerStarted(PLServerTestEnvironment.java:55)
at gw.testharness.v3.PLServerTestEnvironment.beforeTestSuite(PLServerTestEnvironment.java:48)
</error>
</testcase>
All of the errors are coming from that issue for all of the GUnit tests
Not sure if it's a context.xml issue with configuration or something else at this point.

HTTP Status 500 - Servlet.init() for servlet search threw exception?

Im getting this exception,but im not sure where exactly the exception occured,Please help me in this guys.I know there are lot of posts on this related topic but none i found gives solution to my question.
HTTP Status 500 - Servlet.init() for servlet search threw exception
type Exception report
message Servlet.init() for servlet search threw exception
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet.init() for servlet search threw exception
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)
root cause
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Invocation of init method failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.lukup.smr.word.controller.ProgramUpdateController] for bean with name 'programUpdateController' defined in file [/usr/share/apache-tomcat-7.0.63/webapps/search/WEB-INF/classes/com/lukup/smr/word/controller/ProgramUpdateController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/lukup/smr/word/controller/ProgramUpdateController : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.controller.ProgramUpdateController)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.lukup.smr.word.controller.ProgramUpdateController] for bean with name 'programUpdateController' defined in file [/usr/share/apache-tomcat-7.0.63/webapps/search/WEB-INF/classes/com/lukup/smr/word/controller/ProgramUpdateController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/lukup/smr/word/controller/ProgramUpdateController : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.controller.ProgramUpdateController)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.lukup.smr.word.controller.CronJobController] for bean with name 'cronJobController' defined in file [/usr/share/apache-tomcat-7.0.63/webapps/search/WEB-INF/classes/com/lukup/smr/word/controller/CronJobController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/lukup/smr/word/controller/CronJobController : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.controller.CronJobController)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.lukup.smr.word.controller.WordSearchController] for bean with name 'wordSearchController' defined in file [/usr/share/apache-tomcat-7.0.63/webapps/search/WEB-INF/classes/com/lukup/smr/word/controller/WordSearchController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/lukup/smr/word/controller/WordSearchController : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.controller.WordSearchController)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.lukup.smr.word.service.CronJobService] for bean with name 'cronjobservice' defined in ServletContext resource [/WEB-INF/search-servlet.xml]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/lukup/smr/word/service/CronJobService : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.service.CronJobService)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.lukup.smr.word.service.ProgramUpdateService] for bean with name 'programupdateservice' defined in ServletContext resource [/WEB-INF/search-servlet.xml]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/lukup/smr/word/service/ProgramUpdateService : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.service.ProgramUpdateService)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.lukup.smr.word.service.WordSearchService] for bean with name 'wordsearchservice' defined in ServletContext resource [/WEB-INF/search-servlet.xml]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/lukup/smr/word/service/WordSearchService : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.service.WordSearchService)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
javax.servlet.GenericServlet.init(GenericServlet.java:158)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)
root cause
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.lukup.smr.word.controller.ProgramUpdateController] for bean with name 'programUpdateController' defined in file [/usr/share/apache-tomcat-7.0.63/webapps/search/WEB-INF/classes/com/lukup/smr/word/controller/ProgramUpdateController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/lukup/smr/word/controller/ProgramUpdateController : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.controller.ProgramUpdateController)
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1354)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:628)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:597)
org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1444)
org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:445)
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:423)
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:409)
org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:1141)
org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:178)
org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:163)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:133)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
javax.servlet.GenericServlet.init(GenericServlet.java:158)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)
root cause
java.lang.UnsupportedClassVersionError: com/lukup/smr/word/controller/ProgramUpdateController : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.controller.ProgramUpdateController)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2963)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1212)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1692)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1573)
org.springframework.util.ClassUtils.forName(ClassUtils.java:250)
org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:394)
org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1396)
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1343)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:628)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:597)
org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1444)
org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:445)
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:423)
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:409)
org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:1141)
org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:178)
org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:163)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:133)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
javax.servlet.GenericServlet.init(GenericServlet.java:158)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.63 logs.
Apache Tomcat/7.0.63
Recommended Options
Unsupported major.minor version 52.0 means you have JDK version compatibility issue with your Web/Application server.
Change it to higher JDK preferably JDK 1.8 (recommended) and re-compile your code will resolve your issue.
In this scenario it is highly recommended to use tomcat 8.X + JDK 1.8 to fix your problem.

How to set a bucket password with spring-data couchbase

I have followed the tutorial for spring-data couchbase and have a succesfull example project with unit tests for persisting a number of custom entities with a range of views implemented to query the entities.
This works correctly in both a local dev environment and a ci environment when using the "default" bucket name and no password as the authentication.
Moving beyond the example, I want to make use of a different bucket and ultimately make use of a password.
When I create a new bucket (named "test_bucket"), and update the property injected into the CouchbaseConfig (extends AbstractCouchbaseConfiguration) to use this new bucket inplace of the "default" I get the following exception when running the unit tests.
I also tried adding a password to the creation script and adding the same password ("psswd" string in both cases) to the properties used in the CouchbaseConfig but get the same exception shown below.
So is it possible to use another bucket than "default" (and its no-authorisation required) and how do I configure a password for use on this bucket ?
I have verified that the bucket(s) and the expected views have been created correctly in couchbase from the Admin GUI.
2015-06-09 16:41:40 INFO ClasspathLoggingApplicationListener:55 - Application failed to start with classpath: [file:/C:/tools/cmd/cygwin64/home/akirby/workspaces/repos/blackjack/persistence/target/surefire/surefirebooter7615727324811258159.jar]
2015-06-09 16:41:40 INFO AutoConfigurationReportLoggingInitializer:107 -
Error starting ApplicationContext. To display the auto-configuration report enabled debug logging (start with --debug)
2015-06-09 16:41:40 ERROR SpringApplication:338 - Application startup failed
java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.encodeBase64String([B)Ljava/lang/String;
at com.couchbase.client.http.HttpUtil.buildAuthHeader(HttpUtil.java:55)
at com.couchbase.client.ViewConnection.addOp(ViewConnection.java:205)
at com.couchbase.client.CouchbaseClient.addOp(CouchbaseClient.java:803)
at com.couchbase.client.CouchbaseClient.asyncGetView(CouchbaseClient.java:342)
at com.couchbase.client.CouchbaseClient.getView(CouchbaseClient.java:430)
at org.springframework.data.couchbase.core.CouchbaseTemplate$2.doInBucket(CouchbaseTemplate.java:223)
at org.springframework.data.couchbase.core.CouchbaseTemplate$2.doInBucket(CouchbaseTemplate.java:220)
at org.springframework.data.couchbase.core.CouchbaseTemplate.execute(CouchbaseTemplate.java:244)
at org.springframework.data.couchbase.core.CouchbaseTemplate.queryView(CouchbaseTemplate.java:220)
at org.springframework.data.couchbase.repository.support.SimpleCouchbaseRepository.deleteAll(SimpleCouchbaseRepository.java:168)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:416)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:401)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:373)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$DefaultMethodInvokingMethodInterceptor.invoke(RepositoryFactorySupport.java:486)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.data.couchbase.repository.support.ViewPostProcessor$ViewInterceptor.invoke(ViewPostProcessor.java:87)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy50.deleteAll(Unknown Source)
at com.pubtech.cms.persistence.RepositoryService.doWork(RepositoryService.java:47)
at com.pubtech.cms.persistence.ApplicationRepository.lambda$commandLineRunner$0(ApplicationRepository.java:83)
at com.pubtech.cms.persistence.ApplicationRepository$$Lambda$9/594916129.run(Unknown Source)
at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:672)
at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:690)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:101)
at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:68)
at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:86)
at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72)
at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:170)
at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:110)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:200)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:259)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:261)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:219)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
2015-06-09 16:41:40 INFO GenericWebApplicationContext:862 - Closing org.springframework.web.context.support.GenericWebApplicationContext#6302bbb1: startup date [Tue Jun 09 16:41:33 BST 2015]; root of context hierarchy
2015-06-09 16:41:40 INFO CouchbaseConnection:87 - Shut down Couchbase client
2015-06-09 16:41:40 INFO ViewConnection:87 - I/O reactor terminated
when using a bucket name that requires a password (bucket "t1", password "pswd") I see this authentication error in the logs, is there some format. other than plain text that the passsord should be encoded with ?
2015-06-10 10:55:58 INFO DefaultListableBeanFactory:822 - Overriding bean definition for bean 'beanNameViewResolver': replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]
2015-06-10 10:55:59 INFO Version:27 - HV000001: Hibernate Validator 5.1.3.Final
2015-06-10 10:56:00 ERROR SASLStepOperationImpl:93 - Error: Auth failure
2015-06-10 10:56:00 WARN BinaryMemcachedNodeImpl:90 - Discarding partially completed op: SASL steps operation
2015-06-10 10:56:00 WARN AuthThread:90 - Authentication failed to localhost/127.0.0.1:11210, Status: {OperationStatus success=false: cancelled}
2015-06-10 10:56:02 WARN AuthThread:90 - Authentication failed to localhost/127.0.0.1:11210, Status: {OperationStatus success=false: Invalid arguments}
2015-06-10 10:56:02 WARN AuthThread:90 - Authentication failed to localhost/127.0.0.1:11210, Status: {OperationStatus success=false: Invalid arguments}
I use the couchbase-cli to create the buckets from a script, using the same script to create the working "default" and not working "test_bucket", (properties are correctly injected using mvn filter) :
# Create Bucket
couchbase-cli bucket-create -c $COUCHBASE_HOST:$COUCHBASE_PORT -u $CB_REST_USERNAME -p $CB_REST_PASSWORD \
--bucket=$BUCKET_NAME \
--bucket-type=couchbase \
--bucket-ramsize=200 \
--bucket-replica=1 \
--wait
CouchbaseConfig class:
..
#Configuration
#EnableCouchbaseRepositories(basePackages = {"com.persistence.db"})
#EnableAutoConfiguration
public class CouchbaseConfig extends AbstractCouchbaseConfiguration {
#Value("${couchbase.bucket:boris}")
private String bucketName;
#Value("${couchbase.bucket.password:nopwd}")
private String password;
#Value("${couchbase.host:127.0.0.1}")
private String ip;
..
I think you got a similar issue to what i was experiencing, the issue for me was using #Value in an #Configuration class has a slight special requirement. I was using YAML for my properties file if that matters at all.
add this to your class (must be static as well)
/**
* this is required for some reason: https://jira.spring.io/browse/SPR-11773
*
* #return
*/
#Bean
public static PropertySourcesPlaceholderConfigurer propertyPlaceholderConfigurer() {
return new PropertySourcesPlaceholderConfigurer();

jboss javax.persistence.OptimisticLockException

I am using jboss version 5.1.0.GA and am running gss service on it (https://code.google.com/p/gss/).
I ran into problem of javax.persistence OptimisticLockException.
Stack trace is as following:
07 Jan 2014 00:06:15,966 pool-45617-thread-1 WARN () [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_2] TwoPhaseCoordinator.beforeC
ompletion - failed for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple#417f3b89
javax.persistence.OptimisticLockException
at org.hibernate.ejb.AbstractEntityManagerImpl.wrapStaleStateException(AbstractEntityManagerImpl.java:627)
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:588)
at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:513)
at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:101)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:269)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:89)
at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1423)
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:137)
at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:170)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:176)
at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:216)
at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
at $Proxy379.updateFileContents(Unknown Source)
at org.gss_project.gss.server.webdav.milton.GssFolderResource$5.call(GssFolderResource.java:305)
at org.gss_project.gss.server.webdav.milton.GssFolderResource$5.call(GssFolderResource.java:302)
at org.gss_project.gss.server.ejb.TransactionHelper$1.call(TransactionHelper.java:78)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.gss_project.gss.server.domain.Folder#7857644]
All of the project source is available here: https://code.google.com/p/gss/source/browse/
Can you please point me in some direction and help out with this problem?
An javax.persistence.OptimisticLockException is throwed when a user tries to update a record in database after some other user has modified it. This is handled automatically by the JPA provider if the Entity has one field (column) annotated with #Version.
Here is full explanation: http://gerrydevstory.com/2012/06/23/optimistic-locking-with-jpa/

Accessing Apache ActiveMQ via JMX throws Exception

I'm using a fresh ActiveMQ 5.8.0 installation, where I have a message in a queue called 'testing'. I also replaced the ACTIVEMQ_SUNJMX line in bin/activemq to enable JMX:
ACTIVEMQ_SUNJMX_START="-Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
Then I query JMX via the following code:
try {
JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"));
connector.connect();
MBeanServerConnection connection = connector.getMBeanServerConnection();
ObjectName mbeanName = new ObjectName("org.apache.activemq:BrokerName=localhost,Type=Broker");
BrokerViewMBean mbean = MBeanServerInvocationHandler.newProxyInstance(connection, mbeanName, BrokerViewMBean.class, true);
System.out.println("Id:" + mbean.getBrokerId()); // here the exception will be thrown
}
catch (Exception x) {
x.printStackTrace();
}
The Exception is thrown when accessing the mbean.
java.lang.reflect.UndeclaredThrowableException
at $Proxy0.getBrokerId(Unknown Source)
at testing.TestJmx.main(TestJmx.java:25)
Caused by: javax.management.InstanceNotFoundException: org.apache.activemq:BrokerName=localhost,Type=Broker
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1095)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:643)
at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:668)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1424)
at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:89)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1292)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1380)
at javax.management.remote.rmi.RMIConnectionImpl.getAttribute(RMIConnectionImpl.java:621)
at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at sun.rmi.transport.Transport$1.run(Transport.java:174)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:160)
at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl_Stub.getAttribute(Unknown Source)
at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.getAttribute(RMIConnector.java:901)
at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:280)
... 2 more
I checked that that port is listening, VisualVM also shows me the mbeans, ideas?
The fact that bean names have changed is documented on the 5.8.0 release page.
So your ObjectName should be of the form:
ObjectName mbeanName = new ObjectName("org.apache.activemq:type=Broker,brokerName=localhost");
Excellent answer. Here you have an example of use: API Docs
There is also something important that changes from 5.7 to 5.8. The default URL for JMX services goes from:
service:jmx:rmi://localhost/jndi/rmi://localhost:1099/jmxrmi
to:
service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
Lovely question and answer too, I was having a hard time configuring JMX. ActiveMQ docs isn't up-to-date in this regard. Eg : http://activemq.apache.org/jmx.html doesn't say that from 5.8.0 onwards "SUNJMX" becomes "ACTIVEMQ_SUNJMX_START".
The config provided by OP , ie :
ACTIVEMQ_SUNJMX_START="-Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
, and the corresponding code is the one that really worked for me. Thanks ! ( I am using ActiveMQ 5.8)