Java Spring Web App-CannotLoadBeanClassException找不到名为';somename';
如果有人能解决我的问题,我将不胜感激。我搜索了一下,发现了很多类似的问题。但无法找到解决方案。我很抱歉问了同样的问题。但我正在为这个问题而挣扎和沮丧 我有一个web应用程序,在eclipse上部署了许多项目。我使用的是spring框架。一切正常。我清理了eclipse中的所有项目,并启动了服务器。我的浏览器抛出了这个错误。我尝试重新启动服务器和所有可能的修复,但没有任何效果Java Spring Web App-CannotLoadBeanClassException找不到名为';somename';,java,eclipse,spring-mvc,Java,Eclipse,Spring Mvc,如果有人能解决我的问题,我将不胜感激。我搜索了一下,发现了很多类似的问题。但无法找到解决方案。我很抱歉问了同样的问题。但我正在为这个问题而挣扎和沮丧 我有一个web应用程序,在eclipse上部署了许多项目。我使用的是spring框架。一切正常。我清理了eclipse中的所有项目,并启动了服务器。我的浏览器抛出了这个错误。我尝试重新启动服务器和所有可能的修复,但没有任何效果 SEVERE: Context initialization failed org.springframework.bea
SEVERE: Context initialization failed
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class[org.company.ain.authenticate.AuthenticateUser] for bean with name 'authenticate'
这是我的.xml文件
<bean name="authenticate" class="org.company.ain.authenticate.AuthenticateUser">
<property name="dataSource" ref="dataSource"/>
</bean>
我想知道两件事
- 一旦我清理了所有项目,eclipse是否会删除我的类路径
- 我上述问题的解决办法是什么
<!-- DATA SOURCE -->
<bean id="_dataSourceProxy"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="resourceRef" value="true" />
<property name="jndiName" value="${connection.jndiName}"></property>
<property name="lookupOnStartup" value="false"></property>
<property name="cache" value="false"></property>
<property name="proxyInterface" value="javax.sql.DataSource"></property>
</bean>
冬眠
<!-- HIBERNATE -->
<bean id="_hibernateSessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="_dataSourceProxy"></ref>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
<prop key="hibernate.connection.SetBigStringTryClob">true</prop>
<prop key="hibernate.jdbc.batch_size">0</prop>
<prop key="hibernate.jdbc.use_streams_for_binary">false</prop>
<prop key="javax.persistence.validation.mode">none</prop>
<prop key="connection.useUnicode">true</prop>
<prop key="connection.characterEncoding">utf-8</prop>
<prop key="hibernate.connection.defaultNChar">true</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>hibernate/content/Content.hbm.xml</value>
<value>hibernate/content/ContentMeta.hbm.xml</value>
</list>
</property>
</bean>
org.hibernate.dialen.oracle10galent
符合事实的
0
错误的
没有一个
符合事实的
utf-8
符合事实的
符合事实的
hibernate/content/content.hbm.xml
hibernate/content/ContentMeta.hbm.xml
Hibernate-Conf用于多线程
<!-- Content Repo -->
<bean id="_contentRepository"
class="XXXX">
<aop:scoped-proxy/>
<property name="_senderEmail" value="${smtp.senderEmail}"></property>
<property name="_hibernateSessionFactory">
<ref bean="_hibernateSessionFactory"></ref>
</property>
<property name="_authService">
<ref bean="_authService"></ref>
</property>
<property name="_languageRepository">
<ref bean="_languageRepository"></ref>
</property>
<property name="_locationRepository">
<ref bean="_locationRepository"></ref>
</property>
<property name="_velocityEngine">
<ref bean="_velocityEngine"></ref>
</property>
<property name="_mailSender">
<ref bean="_mailSender"></ref>
</property>
</bean>
回购示例:
<!-- Location Repo -->
<bean id="_locationRepository"
class="XXXX">
<property name="_hibernateSessionFactory">
<ref bean="_hibernateSessionFactory"></ref>
</property>
</bean>
如果问题解决,请尝试重新部署。还要检查org.company.ain.authenticate.AuthenticateUser是否确实存在。两种方法都试过了。是的,在那里。不起作用。它会抛出相同的错误。好吧,你将不得不发布导致问题的代码。这不是代码的问题。这些天我的代码运行得很好。只是我清理了eclipse上的所有项目。所以它抛出了这个错误。清理不会导致问题,肯定是你的设置或代码有问题。