Wildcard bean loading in JBoss 5.1.0.GA - jboss

We have this in config.xml, which loads OK in JBoss 4.2.2.GA
<import resource="classpath*:/META-INF/apollo/babel-*-beans.xml"/>
However in JBoss 5.1.0.GA, it does not load (as I am aware things are stricter)
Offending resource: ServletContext resource [/WEB-INF/config/catalog-config.xml];
nested exception is org.springframework.beans.factory.BeanDefinitionStoreException:
Could not resolve bean definition resource pattern [classpath*:/META-INF/apollo/babel-*-beans.xml];
nested exception is java.io.FileNotFoundException:
I followed the advice here http://community.jboss.org/message/6502 to disable validation,
%JBOSS_HOME%/server/< serverName>/deployers/ear-deployer-jboss-beans.xml, uncommentthe commented out lines:
<property name="useValidation">false</property>
but the error stays.
So how do I make JBoss 5.1.0.GA less strict and able to load using wildcard?

Related

Maven SpringBoot app starts up from mvn spring-boot:run, but fails with Websphere errors running Spring Boot from Eclipse

I work on quite a few services with similar architectures, with small differences. They all use Java 8, Maven, SpringBoot, and Jersey.
I normally debug them in Eclipse (currently on 2021-06) using "Run As->SpringBoot". This works perfectly fine. I can also run them from a command line using "mvn spring-boot:run", but that's just an academic exercise, because I prefer to run them from Eclipse.
When I run it from mvn, it successfully starts up, and I can hit listener endpoints (test case is actuator/info right now) with no problem.
When I run it from Eclipse, I get the following mystifying error:
BeanCreationException: Error creating bean with name 'mbeanExporter' defined in class path resource [org/springframework/boot/autoconfigure/jmx/JmxAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.jmx.export.annotation.AnnotationMBeanExporter]: Factory method 'mbeanExporter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mbeanServer' defined in class path resource [org/springframework/boot/autoconfigure/jmx/JmxAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.management.MBeanServer]: Factory method 'mbeanServer' threw exception; nested exception is org.springframework.jmx.MBeanServerNotFoundException: Could not access WebSphere's AdminServiceFactory.getMBeanFactory/getMBeanServer method; nested exception is java.lang.NullPointerException
Notice the last couple of phrases in that.
This service uses an ejb client class that is configured to connect to Websphere EJBs. One side effect of this is that jmx is not available. I have to set "spring.jmx.enabled=false".
Note that I went to the trouble of storing the log file for both runs, and I painstakingly compared them, verifying that they were logging the same information (varying by timestamps). That stacktrace above is the first place where they truly vary.
Curiously, although the Eclipse run shows this error, and listeners do not respond, it doesn't terminate the startup attempt. The service just sits there, sort of brain-dead.
I'm sure what I've provided isn't enough information, but I'm not sure what else would be useful information.

jbossfuse: Cannot find the declaration of element 'blueprint'

While Deploying a War application into fuse container, Im getting the Exception: cvc-elt.1.a: Cannot find the declaration of element 'blueprint'
My blueprint schema is:
<blueprint
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
Exception detail:
org.ops4j.pax.web.pax-web-extender-war - 4.3.0 | Error deploying web application
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 12 in XML document from ServletContext resource [/WEB-INF/camel-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1.a: Cannot find the declaration of element 'blueprint'.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:397)[203:org.apache.servicemix.bundles.spring-beans:3.2.16.RELEASE_1]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)[203:org.apache.servicemix.bundles.spring-beans:3.2.16.RELEASE_1]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)[203:org.apache.servicemix.bundles.spring-beans:3.2.16.RELEASE_1]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)[203:org.apache.servicemix.bundles.spring-beans:3.2.16.RELEASE_1]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)[203:org.apache.servicemix.bundles.spring-beans:3.2.16.RELEASE_1]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)[203:org.apache.servicemix.bundles.spring-beans:3.2.16.RELEASE_1]
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)[310:org.apache.servicemix.bundles.spring-web:3.2.16.RELEASE_1]
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)[310:org.apache.servicemix.bundles.spring-web:3.2.16.RELEASE_1]
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)[205:org.apache.servicemix.bundles.spring-context:3.2.16.RELEASE_1]
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:542)[205:org.apache.servicemix.bundles.spring-context:3.2.16.RELEASE_1]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)[205:org.apache.servicemix.bundles.spring-context:3.2.16.RELEASE_1]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)[310:org.apache.servicemix.bundles.spring-web:3.2.16.RELEASE_1]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)[310:org.apache.servicemix.bundles.spring-web:3.2.16.RELEASE_1]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)[310:org.apache.servicemix.bundles.spring-web:3.2.16.RELEASE_1]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext$3.call(HttpServiceContext.java:354)[117:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext$3.call(HttpServiceContext.java:350)[117:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.ops4j.pax.swissbox.core.ContextClassLoaderUtils.doWithClassLoader(ContextClassLoaderUtils.java:60)[117:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.callContextInitialized(HttpServiceContext.java:349)[117:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:791)[93:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:294)[94:org.eclipse.jetty.servlet:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.startContext(HttpServiceContext.java:601)[117:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)[93:org.eclipse.jetty.server:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doStart(HttpServiceContext.java:260)[117:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)[96:org.eclipse.jetty.util:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(JettyServerImpl.java:279)[117:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.ops4j.pax.web.service.internal.HttpServiceStarted.end(HttpServiceStarted.java:1096)[116:org.ops4j.pax.web.pax-web-runtime:4.3.0]
at org.ops4j.pax.web.service.internal.HttpServiceProxy.end(HttpServiceProxy.java:417)[116:org.ops4j.pax.web.pax-web-runtime:4.3.0]
at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.end(RegisterWebAppVisitorWC.java:380)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:692)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:237)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:182)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:135)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf.jar:2.4.0.redhat-630187]
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)[karaf.jar:2.4.0.redhat-630187]
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[karaf.jar:2.4.0.redhat-630187]
at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[karaf.jar:2.4.0.redhat-630187]
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:317)[karaf.jar:2.4.0.redhat-630187]
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)[karaf.jar:2.4.0.redhat-630187]
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:101)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.ops4j.pax.web.extender.war.internal.WebObserver.deploy(WebObserver.java:219)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.ops4j.pax.web.extender.war.internal.WebObserver$1.doStart(WebObserver.java:179)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.ops4j.pax.web.extender.war.internal.extender.SimpleExtension.start(SimpleExtension.java:59)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender$1.run(AbstractExtender.java:281)[276:org.ops4j.pax.web.pax-web-extender-war:4.3.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_121]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_121]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
Caused by: org.xml.sax.SAXParseException: cvc-elt.1.a: Cannot find the declaration of element 'blueprint'.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:201)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:132)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:394)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:282)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2143)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:788)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:875)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:798)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)[:2.11.0.SP4-redhat-1]
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)[:2.11.0.SP4-redhat-1]
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)[203:org.apache.servicemix.bundles.spring-beans:3.2.16.RELEASE_1]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:389)[203:org.apache.servicemix.bundles.spring-beans:3.2.16.RELEASE_1]
... 49 more
Can anyone give a clue in this scenario?
In JBoss FUSE the war isn't a preferred way, you should use bundle instead, and use blueprint to configure the route. Please take a look at the camel quickstarts in JBoss FUSE kit.

Issue JNDI resource initialization - DB connection #"DB2 on Cloud - BLUEMIX

We are unable to make DB2 database connection from Java application deployed on "Liberty on Java" using JNDI resource at Bluemix.
It is not able to initialize the resource.
My server.xml file is
"<dataSource id="eVotingDataSource" jdbcDriverRef="db2-driver" jndiName="jdbc/DatabaseName" type="javax.sql.DataSource">
<properties.db2.jcc id="eVotingDataSource-props" databaseName="*******" user="db2inst1" password="******" portNumber="50001" serverName="********" sslConnection="true"/>
</dataSource>
<jdbcDriver id="db2-driver" libraryRef="db2-library"/>
<library id="db2-library">
<fileset id="db2-fileset" dir="${server.config.dir}/lib" includes="db2jcc4.jar db2jcc_license_cu.jar"/>
</library>
Web.xml file
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/DatabaseName</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
applicationContext.xml file
<jee:jndi-lookup id="eVotingDataSource"
jndi-name="jdbc/DatabaseName"
expected-type="javax.sql.DataSource" />
Below is output of messages.log
org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory com.nl.abnamro.evoting.dao.IssuerDAOImpl.eVotingSessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eVotingSessionFactory' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'eVotingDataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eVotingDataSource': Invocation of init method failed; nested exception is javax.naming.NamingException: CWWKN0008E: An object could not be obtained for name jdbc/DatabaseName.
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eVotingDataSource': Invocation of init method failed; nested exception is javax.naming.NamingException: CWWKN0008E: An object could not be obtained for name jdbc/DatabaseName.
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eVotingMailSource': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Intermediate context does not exist: mail/Session
When we load the application we receive the following error:
Error 500: javax.servlet.ServletException: Filter [springSecurityFilterChain]: could not be initialized
Could you please assist?
The error you are receiving is related with this configuration from your server.xml
jndiName="**jdbc/DatabaseName**"
CWWKN0008E: An object could not be obtained for name **jdbc/DatabaseName**.
If you are using a DB service bound using Bluemix, the runtime is automatically configured when your application is staging, so you usually don't need to provide your own configuration in your server.xml overwriting the Bluemix configuration.
Instead, if you need to overwrite the server.xml for your own configurations, you could access the DB service references on your Bluemix page, on the Bluemix console under the 'Environment Variables' section
You could retrieve the DBService name to use inside your server.xml as JNDI/[DBNAME]
You could also retrieve the right Datasource to use simply deploying your app on Bluemix without overwriting the server.xml and check on the Bluemix UI (under Files section) the value of the Datasource on the produced server.xml
Just a little question: Could you confirm that you are pushing your application along with your server.xml, within a packaged version of your liberty run-time ?

How to change the liferay database to mysql database

I have downloaded the liferay6 bundle with tomcat.I need to change the liferay database to mysql database.I have searched in google and as per information i have created the portal-ext.properties with below lines of code.
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=root123
jdbc.default.jndi.name=jdbc/LiferayPool
schema.run.enabled=true
schema.run.minimal=true
and i modified the ROOT.xml.Now the code in that file is :
<Context path="" crossContext="true">
<Resource
name="jdbc/LiferayPool"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8"
username="root"
password="root123"
maxActive="20"
/>
</Context>
and i have created the lportal database in mysql.Do i need to modify anything more.If i do like this i am not even able to see the default login page of liferay.Can anyone point me where i am doing wrong.Thank You.
I am getting the below Exception if i am doing like this.
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:241)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2744)
at com.mysql.jdbc.Connection.<init>(Connection.java:1553)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:148)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.spring.aop.ServiceBeanAutoProxyCreator#0' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'serviceAdvice' while setting bean property 'methodInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'asyncAdvice' while setting bean property 'nextMethodInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'asyncAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'threadLocalCacheAdvice' while setting bean property 'nextMethodInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'threadLocalCacheAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'bufferedIncrementAdvice' while setting bean property 'nextMethodInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bufferedIncrementAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'indexableAdvice' while setting bean property 'nextMethodInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'indexableAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'transactionAdvice' while setting bean property 'nextMethodInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'liferayTransactionManager' while setting bean property 'platformTransactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liferayTransactionManager' defined in class path resource [META-INF/hibernate-spring.xml]: Cannot resolve reference to bean 'liferayHibernateSessionFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liferayHibernateSessionFactory' defined in class path resource [META-INF/hibernate-spring.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1327)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1085)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:516)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:710)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:410)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:172)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1585)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
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)
1-updating java connector driver
be sure that the liferay portal is not started ! if it does, then shut down.
download and install MySQL and HeidiSQL, you can simply create mysql database via HeidiSql.
download mysql.jar (Connector/J) from dev.mysql.com
you may not login just go below in page and click link: No thanks, just start my download.
delete mysql.jar in liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\lib\ext
copy mysql-connector-java-some version-bin.jar in
\Program Files(x86)\MySQL\Connector J folder and
paste it in liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\lib\ext .(don't forget to rename it to mysql.jar)
2- work with control panel of liferay
now you can start liferay portal
open in browser localhost:8080/
go to -> control panel -> server administration -> Data Migration
JDBC Driver Class Name:
com.mysql.jdbc.Driver
JDBC URL:
jdbc:mysql://localhost:3306/DB-NAME?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
DB-NAME - name of database you've created earlier.
write MySQL username and password then click the button below.
now in the next page you can see some text in the *red border*like : The system is currently undergoing maintenance. Please try again later.
It's allright. just wait for .. may be half an hour or more or less, just wait, and be patient))
while process is going, you can do the next last step:
3- change portal properties
open file portal-ext.properties (create it if doesn't exist) in liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\webapps\ROOT\WEB-INF\classes and paste to this file following text:
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost:here must be DB port, by default it's 3306/*DB_NAME*?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=username of MySQL user
jdbc.default.password=password of MySQL user
THAT'S IT
RESTART TOMCAT SERVER
In your portal-ext.properties file, it should be enough if you specif JNDI name to lookup.
jdbc.default.jndi.name=MyDataSource
In your Tomcat's xml file,
<Resource
name="MyDataSource"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8"
username="root"
password="root123"
maxActive="20"
/>
Make sure that the user you are using above (root) has privilege to create the tables.
Also, don't forget to restart your Tomcat container.
Even on top of this if it doesn't work, share the exceptions in your (bin) logs.

Trying to configure an active MQ broker with a plugin in Java, where should <bean class="..."> attribute be pointing to?

I'm trying to configure an activemq broker with a plugin installed, but can't seem to get the qualified name of the plugin class right in the broker configuration file.
I have pasted the error message followed by the broker config below. Basicallly in the element I'm specifying
class="file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin"
which is absolute path to the XmlValidationPlugin.class file(have tried appending .class to path above but I get the same error).
Initially I assumed that the class attribute should be pointing to the .class file but have tried pointing it to .java and still doesn't work.
I have read the active MQ faq on developing plugins, FAQs, spring documentation etc.
My class path is
.;JAVA_HOME\lib;C:\Marcus\JavaProjects\Project;C:\Marcus\JavaProjects\Project\build\prod\classes
and JAVA_HOME is:
C:\Program Files\Java\jdk1.7.0_03
all the java source resides in
C:\Marcus\JavaProjects\Project\src
and the .class files are in
C:\Marcus\JavaProjects\Project\build\prod\classes
( file structure in classes mirrors that in src,so for example
com.foo.jms.amqplugin.XmlValidationPlugin
will have its .class file in
classes/com/foo/jms/amqplugin )
the plugin in question is XmlValidationPlugin.java, and is in folder src in package:
com.foo.jms.amqplugin
I have tried putting XmlValidationPlugin.class in a JAR and putting the JAR in activemqinstalldir/lib,( as was recommended to other people who had a similar problem) but this has not helped.
I have spent a day and a half on this already, and would really appreciate if anyone has any idea what the value of the plugins class attribute should be, as I have tried everything... Thanks in advance!
TOP OF ERROR OUTPUT:
C:\Program Files\apache-activemq-5.5.1>bin\activemq xbean:file:C:/Marcus/JavaProjects/Project/config/custom-broker.xml
Java Runtime: Oracle Corporation 1.7.0_03 C:\Program Files\Java\jdk1.7.0_03\jre
Heap sizes: current=15872k free=14246k max=506816k
JVM args: -Dcom.sun.management.jmxremote -Xmx512M -Dorg.apache.activemq.UseDedicatedTaskRunner=true -Djava.util.logging.config.file=logging.properties -Dactivemq.classpath=C:\Program Files\apache-
activemq-5.5.1\bin\../conf;C:\Program Files\apache-activemq-5.5.1\bin\../conf; -Dactivemq.home=C:\Program Files\apache-activemq-5.5.1\bin\.. -Dactivemq.base=C:\Program Files\apache-activemq-5.5.1\bin\
..
ACTIVEMQ_HOME: C:\Program Files\apache-activemq-5.5.1\bin\..
ACTIVEMQ_BASE: C:\Program Files\apache-activemq-5.5.1\bin\..
Loading message broker from: xbean:file:C:/Marcus/JavaProjects/Project/config/custom-broker.xml
INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1#7a8ba4: startup date [Thu Apr 12 10:38:26 CEST 2012]; root of context hierarchy
ERROR: java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load type: file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin. Reason: java.lang.ClassNotFoundException: file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin; nested exception is java.lang.ClassNotFoundException: file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin
java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load type: file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin.
Reason: java.lang.ClassNotFoundException: file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin; nested exception is java.lang.ClassNotFoundException: file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin
at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:98)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:143)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
...
BROKER CONFIG FILE:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.apache.org/schema/core"
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-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:${activemq.base}/conf/credentials.properties</value>
</property>
</bean>
<!--The <broker> element is used to configure the ActiveMQ broker. -->
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost"
dataDirectory="${activemq.base}/data">
...
<!--plugin-->
<plugins>
<bean xmlns="http://www.springframework.org/schema/beans"
id="xmlValidationPlugin"
class="com.foo.jms.amqplugin.XmlValidationPlugin"/>
</plugins>
</broker>
</beans>
Basicallly in the element I'm specifying class="file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin" which is absolute path to the XmlValidationPlugin.class file(have tried appending .class to path above but I get the same error). Initially I assumed that the class attribute should be pointing to the .class file but have tried pointing it to .java and still doesn't work.
It seems that the error you are getting is from the classloader.
Reason: java.lang.ClassNotFoundException: file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin; nested exception is java.lang.ClassNotFoundException: file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin
Classloader expects a fully qualified class-name instead of a path to the class file. Try to specify the fully qualified class name instead of the path to the class file .
Instead of:
file:C:/Marcus/JavaProjects/Project/build/prod/classes/com/foo/jms/amqplugin/XmlValidationPlugin
Use:
com.foo.jms.amqplugin.XmlValidationPlugin
and do make sure that CLASSPATH environment variable will contain: C:/Marcus/JavaProjects/Project/build/prod/classes
If ActiveMQ uses some custom classloader for loading plug-ins (I do not know the details), you might need to specify the classpath in some ActivemMQ-specific way.