After camel upgrade to 3.1.0 weblogic 12c getting error : java.lang.IllegalStateException: Default configuration hasn't been specified - spring

After camel upgrade to 3.1.0 weblogic 12c getting error : java.lang.IllegalStateException: Default configuration hasn't been specified
<Oct 14, 2020 10:07:10,690 AM IST> <Error> <HTTP> <BEA-101216> <Servlet: "JAX-RS/Jersey#1" failed to preload on startup in Web application: "finnone-integration".
java.lang.IllegalStateException: Default configuration hasn't been specified!
at org.redisson.jcache.JCacheManager.createCache(JCacheManager.java:118)
at org.apache.cxf.jaxrs.client.cache.CacheControlFeature.createCache(CacheControlFeature.java:119)
at org.apache.cxf.jaxrs.client.cache.CacheControlFeature.configure(CacheControlFeature.java:53)
at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:730)
at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:648)
Truncated. see log file for complete stacktrace
>
<Oct 14, 2020 10:07:18,068 AM IST> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application "finnone-integration_INTG".
weblogic.application.ModuleException: java.lang.IllegalStateException: Default configuration hasn't been specified!
at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:233)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:228)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalStateException: Default configuration hasn't been specified!
at org.redisson.jcache.JCacheManager.createCache(JCacheManager.java:118)
at org.apache.cxf.jaxrs.client.cache.CacheControlFeature.createCache(CacheControlFeature.java:119)
at org.apache.cxf.jaxrs.client.cache.CacheControlFeature.configure(CacheControlFeature.java:53)
at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:730)
at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:648)
Truncated. see log file for complete stacktrace
>

Related

Error while starting Admin server on WebLogic 12c server

After starting the Node Manager when I'm going to start the startWeblogic.sh this happens and the server failed to start. (username, password is correct)
Starting WLS with line:
/home/app/oracle/java/jdk1.8.0_171/bin/java -server -Xms256m -Xmx512m -XX:CompileThreshold=8000 -cp /home/12c/app/oracle/product/12.2.1/wlserver/server/lib/weblogic-launcher.jar -Dlaunch.use.env.classpath=true -Dweblogic.Name=AdminServer -Djava.security.policy=/home/12c/app/oracle/product/12.2.1/wlserver/server/lib/weblogic.policy -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader -javaagent:/home/12c/app/oracle/product/12.2.1/wlserver/server/lib/debugpatch-agent.jar -da -Dwls.home=/home/12c/app/oracle/product/12.2.1/wlserver/server -Dweblogic.home=/home/12c/app/oracle/product/12.2.1/wlserver/server -Dweblogic.management.username=weblogic -Dweblogic.management.password=mydomain123 weblogic.Server
<Nov 5, 2020 10:59:22 PM IST> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.>
<Nov 5, 2020 10:59:22 PM IST> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to HMACDRBG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.>
<Nov 5, 2020 10:59:23 PM IST> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.171-b11 from Oracle Corporation.>
<Nov 5, 2020 10:59:23 PM IST> <"ResourceManagement" is not enabled in this JVM. Enable "ResourceManagement" to use the WebLogic Server "Resource Consumption Management" feature. To enable "ResourceManagement", you must specify the following JVM options in the WebLogic Server instance in which the JVM runs: -XX:+UnlockCommercialFeatures -XX:+ResourceManagement.>
<Nov 5, 2020 10:59:23 PM IST> <Version: WebLogic Server 12.2.1.3.0 Thu Aug 17 13:39:49 PDT 2017 1882952>
<Nov 5, 2020 11:01:59 PM IST>
<Nov 5, 2020 11:01:59 PM IST>
<Nov 5, 2020 11:01:59 PM IST> <CMM memory level becomes 0. Setting standby thread pool size to 256.>
<Nov 5, 2020 11:02:00,625 PM IST>
<Nov 5, 2020 11:02:01,159 PM IST>
<Nov 5, 2020 11:02:01,719 PM IST>
<Nov 5, 2020 11:02:03,669 PM IST>
<Nov 5, 2020 11:02:03,692 PM IST>
<Nov 5, 2020 11:02:03,732 PM IST> <Server subsystem failed. Reason: A MultiException has 6 exceptions. They are:
weblogic.security.SecurityInitializationException: Authentication for user weblogic denied.
java.lang.IllegalStateException: Unable to perform operation: post construct on weblogic.security.SecurityService
java.lang.IllegalArgumentException: While attempting to resolve the dependencies of weblogic.jndi.internal.RemoteNamingService errors were found
java.lang.IllegalStateException: Unable to perform operation: resolve on weblogic.jndi.internal.RemoteNamingService
java.lang.IllegalArgumentException: While attempting to resolve the dependencies of weblogic.deployment.DeploymentRegistrationService errors were found
java.lang.IllegalStateException: Unable to perform operation: resolve on weblogic.deployment.DeploymentRegistrationService
A MultiException has 6 exceptions. They are:
weblogic.security.SecurityInitializationException: Authentication for user weblogic denied.
java.lang.IllegalStateException: Unable to perform operation: post construct on weblogic.security.SecurityService
java.lang.IllegalArgumentException: While attempting to resolve the dependencies of weblogic.jndi.internal.RemoteNamingService errors were found
java.lang.IllegalStateException: Unable to perform operation: resolve on weblogic.jndi.internal.RemoteNamingService
java.lang.IllegalArgumentException: While attempting to resolve the dependencies of weblogic.deployment.DeploymentRegistrationService errors were found
java.lang.IllegalStateException: Unable to perform operation: resolve on weblogic.deployment.DeploymentRegistrationService
at org.jvnet.hk2.internal.Collector.throwIfErrors(Collector.java:89)
at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:250)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:358)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487)
at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:305)
Truncated. see log file for complete stacktrace
Caused By: weblogic.security.SecurityInitializationException: Authentication for user weblogic denied.
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.doBootAuthorization(CommonSecurityServiceManagerDelegateImpl.java:1158)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.postInitialize(CommonSecurityServiceManagerDelegateImpl.java:1272)
at weblogic.security.service.SecurityServiceManager.postInitialize(SecurityServiceManager.java:586)
at weblogic.security.SecurityService.start(SecurityService.java:130)
at weblogic.server.AbstractServerService.postConstruct(AbstractServerService.java:76)
Truncated. see log file for complete stacktrace
Caused By: javax.security.auth.login.FailedLoginException: [Security:090938]Authentication failure: The specified user failed to log in. javax.security.auth.login.FailedLoginException: [Security:090302]Authentication Failed: User specified user denied
at com.bea.common.security.utils.ExceptionHandler.throwFailedLoginException(ExceptionHandler.java:62)
at weblogic.security.providers.authentication.LDAPAtnLoginModuleImpl.login(LDAPAtnLoginModuleImpl.java:380)
at com.bea.common.security.internal.service.LoginModuleWrapper$1.run(LoginModuleWrapper.java:117)
at java.security.AccessController.doPrivileged(Native Method)
at com.bea.common.security.internal.service.LoginModuleWrapper.login(LoginModuleWrapper.java:114)
Truncated. see log file for complete stacktrace
<Nov 5, 2020 11:02:03,760 PM IST>
<Nov 5, 2020 11:02:03,760 PM IST>
<Nov 5, 2020 11:02:03,763 PM IST>
Stopping Derby server...
Derby server stopped.
Any help would be great. Thanks!
1)Open a cmd and paste this :
MKDIR C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\servers\AdminServer\security
echo username=weblogic> C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\servers\AdminServer\security\boot.properties
echo password=YOUR_WEBLOGIC_PASSWORD>> C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\servers\AdminServer\security\boot.properties
MKDIR C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\servers\WLS_FORMS\security
echo username=weblogic> C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\servers\WLS_FORMS\security\boot.properties
echo password=YOUR_WEBLOGIC_PASSWORD>> C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\servers\WLS_FORMS\security\boot.properties
2)Open folder C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\servers\AdminServer\security.
And open the boot.properties file.
3)Enter your weblogic password and insure that there are no spaces after it.
Save the file and rerun your weblogic server
Hello this is santosh kumar and I have resolved the problem
Steps
Rename the file name "ldap" to "ldap_bkp"
C:\Oracle\Middleware\user_projects\domains\ClassicDomain\servers\AdminServer\data\
Copy the location path of ldap field:
"C:\Oracle\Middleware\user_projects\domains\ClassicDomain\servers\AdminServer\data\"
Open command prompt in administration mode
it will open like this "c:\Windows\system32>" as bellow:
c:\Windows\system32> cd C:\Oracle\Middleware\user_projects\domains\ClassicDomain\bin press enter
c:\Windows\system32> cd C:\Oracle\Middleware\user_projects\domains\ClassicDomain\bin> set DomainEnv.cmd
c:\Windows\system32> cd C:\Oracle\Middleware\user_projects\domains\ClassicDomain> -- disappear bin
c:\Windows\system32> cd C:\Oracle\Middleware\user_projects\domains\ClassicDomain> cd C:\Oracle\Middleware\user_projects\domains\ClassicDomain\security press enter
c:\Oracle\Middleware\user_projects\domains\ClassicDomain\security> java weblogic.sercurity.utils.AdminAccount weblogic weblogic123 press enter -- (weblogic user and pass "weblogic and weblogic123")
c:\Oracle\Middleware\user_projects\domains\ClassicDomain\security>cd.. press enter
c:\Oracle\Middleware\user_projects\domains\ClassicDomain>cd servers\AdminServer\security
c:\Oracle\Middleware\user_projects\domains\ClassicDomain\servers\AdminServer\security>notepad boot.properties
It will open file in notepad if file is blanck write there password and username like. If contents availabale edit the user and password as new (see below) and then save and exit notepad:
password=weblogic123
username=weblogic
In the command prompt in administration mode type: C:\Oracle\Middleware\user_projects\domains\ClassicDomain\servers\AdminServer\security> cd C:\Oracle\Middleware\user_projects\domains\ClassicDomain\bin press enter
In the command prompt in administration mode type: C:\Oracle\Middleware\user_projects\domains\ClassicDomain\bin>startWeblogic.cmd press enter
It will run with default loging and password : weblogic/weblogic123.

Failed to initialize the application "DataSource" due to error weblogic.application.ModuleException

When I am trying to restart the Application server getting below error. If I manually deploy the datasource.ear file, it is working fine. But it fails during server restart.
<Error> <Deployer> <BEA-149205> <Failed to initialize the application "Datasource" due to error weblogic.application.ModuleException:
weblogic.application.ModuleException:
at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:337)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:172)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:167)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
Truncated. see log file for complete stacktrace
Caused By: weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection. The DBMS driver exception was: IO Error: Connection reset
at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:288)
at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1310)
at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1227)
at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:250)
at weblogic.jdbc.common.internal.ConnectionPool.doStart(ConnectionPool.java:1396)
Truncated. see log file for complete stacktrace
>

TomEE DataSource Resource gets "NoWait: Pool empty. Unable to fetch a connection, none available[5 in use]."

I'm running TomEE 7.0.1 in Eclipse Neon. I've defined a DataSource resource in the "tomee.xml" file. The DataSource connects to an Oracle DB, and I'm getting the driver from my local Maven repo.
When TomEE starts up, I get the following error in the console:
org.apache.tomcat.jdbc.pool.PoolExhaustedException: [main] NoWait: Pool empty. Unable to fetch a connection, none available[5 in use].
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:679)
at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:468)
at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:143)
at org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEConnectionPool.<init>(TomEEDataSourceCreator.java:221)
Here is my Resource definition:
<Resource id="global/foo/bar" type="DataSource" classpath="mvn:oracle:ojdbc6:11.2.0.3">
JdbcDriver = oracle.jdbc.driver.OracleDriver
MaxActive = 5
MinIdle = 2
MaxIdle = 2
MaxWait = 10000
JdbcUrl = jdbc:oracle:thin:#<host>:1521:sus2
UserName = <userid>
Password = <password>
</Resource>
I've elided the host, user, and password, but the id is as written. I'm still unsure about the JNDI lookup, but that's obviously a separate problem.
Here's my JNDI lookup reference in my Spring context:
<jee:jndi-lookup jndi-name="java:global/foo/bar" id="sus2ds"/>
And here is more of the Tomcat console output:
INFO: Configuring Service(id=global/foo/bar, type=Resource, provider-id=Default JDBC Database)
...
INFO: Creating Resource(id=global/foo/bar)
Aug 03, 2016 11:08:27 AM org.apache.tomcat.jdbc.pool.ConnectionPool checkPoolConfiguration
WARNING: initialSize is larger than maxActive, setting initialSize to: 5
Aug 03, 2016 11:08:27 AM org.apache.tomcat.jdbc.pool.ConnectionPool init
SEVERE: Unable to create initial connections of pool.
org.apache.tomcat.jdbc.pool.PoolExhaustedException: [main] NoWait: Pool empty. Unable to fetch a connection, none available[5 in use].
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:679)
at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:468)
at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:143)
at org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEConnectionPool.<init>(TomEEDataSourceCreator.java:221)
...
Aug 03, 2016 11:08:27 AM org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource <init>
SEVERE: Can't create DataSource
org.apache.tomcat.jdbc.pool.PoolExhaustedException: [main] NoWait: Pool empty. Unable to fetch a connection, none available[5 in use].
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:679)
at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:468)
at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:143)
at org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEConnectionPool.<init>(TomEEDataSourceCreator.java:221)
...
...
2016-08-03 11:08:30,080 WARN [localhost-startStop-1] support.AbstractApplicationContext (AbstractApplicationContext.java:549) - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sus2ds': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name "foo/bar" not found.
2016-08-03 11:08:30,084 ERROR [localhost-startStop-1] context.ContextLoader (ContextLoader.java:351) - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sus2ds': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name "foo/bar" not found.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
...
Caused by: javax.naming.NameNotFoundException: Name "foo/bar" not found.
at org.apache.openejb.core.ivm.naming.IvmContext.federate(IvmContext.java:199)
at org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:151)
at org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:291)
at org.apache.naming.NamingContext.lookup(NamingContext.java:828)
...
Aug 03, 2016 11:08:30 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sus2ds': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name "foo/bar" not found.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
...
Caused by: javax.naming.NameNotFoundException: Name "foo/bar" not found.
at org.apache.openejb.core.ivm.naming.IvmContext.federate(IvmContext.java:199)
at org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:151)
at org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:291)
at org.apache.naming.NamingContext.lookup(NamingContext.java:828)
...
I would start the server and use an MBean explorer, or the JNDI explorer webapp, to take a look at the JNDI tree and get the correct name. My suspicion is you do not need id="global/foo/bar" but id="foo/bar" and keep the lookup the same in your Spring code.

NettyConnectorFactory error

I have a Jms Listener inside a tomcat application. The JMS server is a hornetQ server and I use netty connector to connect to it. The connection is successful and works fine, but when tomcat stops, I see the following error in catalina.out
Dec 11, 2014 4:31:40 PM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load org.hornetq.core.remoting.impl.netty.NettyConnectorFactory. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1245)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
at org.hornetq.utils.ClassloadingUtil.newInstanceFromClassLoader(ClassloadingUtil.java:24)
at org.hornetq.core.client.impl.ClientSessionFactoryImpl$2.run(ClientSessionFactoryImpl.java:1466)
at org.hornetq.core.client.impl.ClientSessionFactoryImpl$2.run(ClientSessionFactoryImpl.java:1463)
at java.security.AccessController.doPrivileged(Native Method)
at org.hornetq.core.client.impl.ClientSessionFactoryImpl.instantiateConnectorFactory(ClientSessionFactoryImpl.java:1462)
at org.hornetq.core.client.impl.ClientSessionFactoryImpl.<init>(ClientSessionFactoryImpl.java:203)
at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:864)
at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:583)
at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:107)
at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:102)
at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
at org.springframework.jms.listener.AbstractJmsListeningContainer.createSharedConnection(AbstractJmsListeningContainer.java:405)
at org.springframework.jms.listener.AbstractJmsListeningContainer.refreshSharedConnection(AbstractJmsListeningContainer.java:390)
at org.springframework.jms.listener.DefaultMessageListenerContainer.refreshConnectionUntilSuccessful(DefaultMessageListenerContainer.java:880)
at org.springframework.jms.listener.DefaultMessageListenerContainer.recoverAfterListenerSetupFailure(DefaultMessageListenerContainer.java:856)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1007)
at java.lang.Thread.run(Thread.java:636)
Dec 11, 2014 4:31:40 PM org.jboss.netty.util.ThreadRenamingRunnable
WARNING: Failed to determine the thread name
java.lang.NullPointerException
at org.jboss.netty.util.ThreadRenamingRunnable.getNewThreadName(ThreadRenamingRunnable.java:126)
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:91)
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
at org.jboss.netty.util.VirtualExecutorService$ChildExecutorRunnable.run(VirtualExecutorService.java:175)
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:636)
I know this is because tomcat illegally stops the connector but I am not sure how to fix this!

Cloudfoundry Spring MongoDB sample application fails to deploy

When I try to deploy the sample Java Spring application with MongoDB (hello-spring-mongodb) I get the error pasted below, which suggests the MongoDB service is failing to bind. I have been getting this error in all my own applications too, deploying both from the command line and from STS 3.0.0. The key error is:
Error creating bean with name 'mongoDbFactory': Invocation of init method failed; nested exception is
org.cloudfoundry.runtime.env.CloudServiceException: Expected 1 service of class org.cloudfoundry.runtime.env.MongoServiceInfo type, but found0
Full trace:
Bind existing services to 'hello-weeels'? [yN]:
Create services to bind to 'hello-weeels'? [yN]: y
1: mongodb
2: mysql
3: postgresql
4: rabbitmq
5: redis
What kind of service?: 1
Specify the name of the service [mongodb-9c56b]:
Create another? [yN]: n
Would you like to save this configuration? [yN]: y
Manifest written to manifest.yml.
Creating Application: OK
Creating Service [mongodb-9c56b]: OK
Binding Service [mongodb-9c56b]: OK
Uploading Application:
Checking for available resources: OK
Processing resources: OK
Packing application: OK
Uploading (3K): OK
Push Status: OK
Staging Application 'hello-weeels': OK
Starting Application 'hello-weeels': ..
Error: Application [hello-weeels] failed to start, logs information below.
====> /logs/stderr.log <====
Aug 27, 2012 9:17:24 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-54519
Aug 27, 2012 9:17:24 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 392 ms
Aug 27, 2012 9:17:24 PM org.apache.catalina.realm.JAASRealm setContainer
INFO: Set JAAS app name Catalina
Aug 27, 2012 9:17:24 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Aug 27, 2012 9:17:24 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.35
Aug 27, 2012 9:17:24 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Aug 27, 2012 9:17:24 PM org.cloudfoundry.reconfiguration.CloudAutoStagingBeanFactoryPostProcessor usingCloudService
INFO: Found an instance of org.cloudfoundry.runtime.service.AbstractCloudServiceFactory. Autostaging will be skipped.
Aug 27, 2012 9:17:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Aug 27, 2012 9:17:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [] startup failed due to previous errors
====> /logs/stdout.log <====
INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization started
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Mon Aug 27 21:17:24 UTC 2012]; root of context hierarchy
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [root-context.xml]
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [META-INF/cloud/cloudfoundry-auto-reconfiguration-context.xml]
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#c292cb2: defining beans [mongoTemplate,mongoDbFactory,__appCloudJpaPostgreSQLReplacementProperties,__appCloudJpaMySQLReplacementProperties,__appCloudHibernatePostgreSQLReplacementProperties,__appCloudHibernateMySQLReplacementProperties,org.cloudfoundry.reconfiguration.CloudAutoStagingBeanFactoryPostProcessor#0]; root of factory hierarchy
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#c292cb2: defining beans [mongoTemplate,mongoDbFactory,__appCloudJpaPostgreSQLReplacementProperties,__appCloudJpaMySQLReplacementProperties,__appCloudHibernatePostgreSQLReplacementProperties,__appCloudHibernateMySQLReplacementProperties,org.cloudfoundry.reconfiguration.CloudAutoStagingBeanFactoryPostProcessor#0]; root of factory hierarchy
ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoTemplate' defined in class path resource [root-context.xml]: Cannot resolve reference to bean 'mongoDbFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoDbFactory': Invocation of init method failed; nested exception is org.cloudfoundry.runtime.env.CloudServiceException: Expected 1 service of class org.cloudfoundry.runtime.env.MongoServiceInfo type, but found0
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.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:630)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035)
Replace:
<beans profile="default">
<mongo:db-factory id="mongoDbFactory" dbname="pwdtest" host="127.0.0.1" port="27017" username="mongo_user" password="passwd"/>
</beans>
<beans profile="cloud">
<cloud:mongo-db-factory id="mongoDbFactory"/>
</beans>
With:
<mongo:db-factory
id="mongoDbFactory"
dbname="${mongo.name}"
host="${mongo.host}"
port="27017"
username="${mongo.username}"
password="${mongo.password}" />
...and cloudfoundry auto reconfig will do it's job properly. If you still have a problem, Right-click on your project in the Spring Explorer View > Properties, and enable the "Beans Validator".
Did you change the name of the expected mongo db? The hello-spring-mondgodb app is configured to to look for a db named 'hello' (The second constructor arg of SimpleMongoDbFactory). Maybe try updating this property to reflect the name of your mongo db and re-push.
Hope this helps
Chris
The hello-spring-mongodb runs without configuration changes. It deploys successfully on my CF installation. First, I create a mongoDB service with:
vmc create-service mongoDB
and then I run: vmc push hello-sping-mongodb from the target directory
C:\eclipseWork\Indigo\hello-spring-mongodb\target>vmc push hello-spring-mongodb
Would you like to deploy from the current directory? [Yn]:
Detected a Java SpringSource Spring Application, is this correct? [Yn]:
Application Deployed URL [hello-spring-mongodb.vcap.me]:
Memory reservation (128M, 256M, 512M, 1G, 2G) [512M]:
How many instances? [1]:
Bind existing services to 'hello-spring-mongodb'? [yN]: y
1: mongodb-86f0e
Which one?: 1
Create services to bind to 'hello-spring-mongodb'? [yN]:
Would you like to save this configuration? [yN]:
Creating Application: OK
Binding Service [mongodb-86f0e]: OK
Uploading Application:
Checking for available resources: OK
Processing resources: OK
Packing application: OK
Uploading (2K): OK
Push Status: OK
Staging Application 'hello-spring-mongodb': OK
Starting Application 'hello-spring-mongodb': OK
Can you try to create the mongoDB service first and then push the application?
It seems that the cloud profile configuration isn't defined in your root-context.xml. Check again that you have the following configuration:
<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
<constructor-arg ref="mongoDbFactory"/>
</bean>
<beans profile="default">
<mongo:db-factory id="mongoDbFactory" dbname="pwdtest" host="127.0.0.1" port="27017" username="mongo_user" password="passwd"/>
</beans>
<beans profile="cloud">
<cloud:mongo-db-factory id="mongoDbFactory"/>
</beans>
Make sure the service name matches, and update the cloudfoundry-runtime version. See my answer to another question with the same exception here.

Resources