La mia webapp con spring 3.2.4 funziona correttamente. Ma quando inizio su esso, mi metterò informazioni di debug:spring jndi NamingException: Nome [spring.liveBeansView.mbeanDomain] non è vincolato in questo contesto
2014-05-20 11:11:47 DEBUG JndiTemplate:150 - Looking up JNDI object with name [java:comp/env/spring.liveBeansView.mbeanDomain]
2014-05-20 11:11:47 DEBUG JndiLocatorDelegate:101 - Converted JNDI name [java:comp/env/spring.liveBeansView.mbeanDomain] not found - trying original name [spring.liveBeansView.mbeanDomain]. javax.naming.NameNotFoundException: Name [spring.liveBeansView.mbeanDomain] is not bound in this Context. Unable to find [spring.liveBeansView.mbeanDomain].
2014-05-20 11:11:47 DEBUG JndiTemplate:150 - Looking up JNDI object with name [spring.liveBeansView.mbeanDomain]
2014-05-20 11:11:47 DEBUG JndiPropertySource:87 - JNDI lookup for name [spring.liveBeansView.mbeanDomain] threw NamingException with message: Name [spring.liveBeansView.mbeanDomain] is not bound in this Context. Unable to find [spring.liveBeansView.mbeanDomain].. Returning null.
2014-05-20 11:11:47 DEBUG PropertySourcesPropertyResolver:81 - Searching for key 'spring.liveBeansView.mbeanDomain' in [systemProperties]
2014-05-20 11:11:47 DEBUG PropertySourcesPropertyResolver:81 - Searching for key 'spring.liveBeansView.mbeanDomain' in [systemEnvironment]
2014-05-20 11:11:47 DEBUG PropertySourcesPropertyResolver:103 - Could not find key 'spring.liveBeansView.mbeanDomain' in any property source. Returning [null]
2014-05-20 11:11:47 DEBUG DispatcherServlet:533 - Published WebApplicationContext of servlet 'spring' as ServletContext attribute with name [org.springframework.web.servlet.FrameworkServlet.CONTEXT.spring]
Non so che cosa significano le informazioni. Io uso c3p0
come mio dataSource
, e la configurazione è:
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>/WEB-INF/config/jdbc.properties</value>
</list>
</property>
</bean>
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="${jdbc.driverClassName}" />
<property name="jdbcUrl" value="${jdbc.url}" />
<property name="user" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="autoCommitOnClose" value="true"/>
<property name="checkoutTimeout" value="${cpool.checkoutTimeout}"/>
<property name="initialPoolSize" value="${cpool.minPoolSize}"/>
<property name="minPoolSize" value="${cpool.minPoolSize}"/>
<property name="maxPoolSize" value="${cpool.maxPoolSize}"/>
<property name="maxIdleTime" value="${cpool.maxIdleTime}"/>
<property name="acquireIncrement" value="${cpool.acquireIncrement}"/>
<property name="maxIdleTimeExcessConnections" value="${cpool.maxIdleTimeExcessConnections}"/>
</bean>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="simpleJdbcTemplate" class="org.springframework.jdbc.core.simple.SimpleJdbcTemplate">
<constructor-arg ref="jdbcTemplate" />
</bean>
ho cant't trovare dove JNDI
viene utilizzato in Ho ricerca alcune domande su questa eccezione.. Ma sono sempre associati a @Profile
o @Configuration
. Non c'è @Profile
o @Configuration
nel mio codice.
Nella mia classe bean, non è presente l'annotazione @Bean
. Le informazioni sono correlate a questo? Ma non ho bisogno di iniettare la mia classe di fagioli.
Come posso farlo con l'annotazione? –
Funziona bene. Dopo aver aggiunto questo in web.xml spettacoli console '[artefatto: mvn] DEBUG: org.springframework.core.env.PropertySourcesPropertyResolver - Ricerca di chiave 'spring.liveBeansView.mbeanDomain' in [servletConfigInitParams] [artefatto: mvn] debug: org.springframework.core.env.PropertySourcesPropertyResolver - Ricerca di chiave 'spring.liveBeansView.mbeanDomain' in [servletContextInitParams] [artefatto: mvn] DEBUG: org.springframework.core.env.PropertySourcesPropertyResolver - chiave 'spring.liveBeansView.mbeanDomain' in [servletContextInitParams] con Trovato digita [String] e valorizza 'dev'' – Lucky
Grazie anche a te. Questa risposta è l'unica in grado di funzionare bene. Penso che dovrei google alcune conoscenze su liveBeansView. – MageXellos