Announcement Announcement Module
Collapse
No announcement yet.
class not found whay Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • class not found whay

    i have got a problem

    16:17:17,923 ERROR [DispatcherServlet] Context initialization failed
    org.springframework.beans.factory.BeanDefinitionSt oreException: Error registering bean with name 'pp' defined in ServletContext resource [/WEB-INF/springapp-servlet.xml]: Bean class [org.springframework.ejb.access.LocalStatelessSessi onProxyFactoryBean] not found; nested exception is java.lang.ClassNotFoundException: org.springframework.ejb.access.LocalStatelessSessi onProxyFactoryBean
    java.lang.ClassNotFoundException: org.springframework.ejb.access.LocalStatelessSessi onProxyFactoryBean
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 199)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:187)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 89)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 35)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:302)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:219)
    at org.springframework.beans.factory.support.BeanDefi nitionReaderUtils.createBeanDefinition(BeanDefinit ionReaderUtils.java:60)
    at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.parseBeanDefinition(DefaultXmlB eanDefinitionParser.java:306)
    at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.parseBeanDefinition(DefaultXmlB eanDefinitionParser.java:274)
    at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.registerBeanDefinitions(Default XmlBeanDefinitionParser.java:186)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registerBeanDefinitions(XmlBeanDefinit ionReader.java:175)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:133)

    this is part of my >xml file i have put the spirng.jar in the lib but the still cant find this class. other class in the spring.jar work just fine why

    <bean id="pp"
    class="org.springframework.ejb.access.LocalStatele ssSessionProxyFactoryBean">
    <property name="jndiName">
    <value>ejb/ProductDelegate</value>
    </property>
    <property name="resourceRef">
    <value>true</value>
    </property>
    <property name="businessInterface">
    <value>db.ProductManagerDao</value>
    </property>
    </bean>

  • #2
    AOPALLIANCE.JAR

    If you are using spring v115 then be sure to deploy aopalliance.jar into jboss server/default/lib etc..

    You can find that jar on sourceforge .

    -Johnson

    Comment


    • #3
      java.lang.NoClassDefFoundError in Eclipse 3.2

      Saludos,

      Soy nuevo en la tecnologíoa JSF-Spring-Hibernate y el problema es que tengo creado un proyecto en Eclipse 3.2 y tengo la
      siguiente página:

      index.jsp:

      <html>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>

      <f:view>
      <body>
      <table>
      <tr>
      <td>Documentos : </td>
      <td>
      <h:selectOneMenu id="documento" value="#{accesoInscripcion.documentosItems}">
      </h:selectOneMenu>
      </td>
      </tr>
      <tr>
      </tr>
      </table>
      </body>
      </f:view>
      </html>

      pero cuando intento ejecutarla me sale el siguiente error:

      11/07/2007 08:31:33 AM org.apache.myfaces.shared_impl.util.ClassUtils newInstance
      GRAVE: Class : co.edu.uis.admisiones.vista.beans.AccesoInscripcio nBean not found.
      java.lang.NoClassDefFoundError
      at co.edu.uis.admisiones.vista.beans.BaseBean.<init>( BaseBean.java:14)
      at co.edu.uis.admisiones.vista.beans.AccesoInscripcio nBean.<init>(AccesoInscripcionBean.java:12)
      at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Construc tor.java:494)
      at java.lang.Class.newInstance0(Class.java:350)
      at java.lang.Class.newInstance(Class.java:303)
      at org.apache.myfaces.shared_impl.util.ClassUtils.new Instance


      Pero la clase mencionada que no encuentra si está en el paquete señalado. Podrían decirme cual es la solución?

      Los siguientes son los archivos de configuracion y las clases:


      faces-config.xml:

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">

      <faces-config>
      <managed-bean>
      <managed-bean-name>
      documento</managed-bean-name>
      <managed-bean-class>
      co.edu.uis.admisiones.modelo.bo.Documento</managed-bean-class>
      <managed-bean-scope>
      request</managed-bean-scope>
      </managed-bean>

      <managed-bean>
      <managed-bean-name>accesoInscripcion</managed-bean-name>
      <managed-bean-class>
      co.edu.uis.admisiones.vista.beans.AccesoInscripcio nBean
      </managed-bean-class>
      <managed-bean-scope>
      request</managed-bean-scope>

      <managed-property>
      <property-name>initAware</property-name>
      <value>true</value>
      </managed-property>
      </managed-bean>

      </faces-config>


      BaseBean.java:

      package co.edu.uis.admisiones.vista.beans;

      import co.edu.uis.admisiones.vista.ServiceLocatorAdmision es;

      public class BaseBean
      {
      private boolean initAware = false;
      protected ServiceLocatorAdmisiones serviceLocator;

      public BaseBean()
      {
      try
      {
      this.setServiceLocator(ServiceLocatorAdmisiones.ge tInstance());
      }
      catch (Exception e)
      {
      e.printStackTrace();
      throw new RuntimeException("Error inicializando serviceLocator", e);
      }
      }

      public boolean isInitAware()
      {
      return initAware;
      }

      public void setInitAware(boolean initAware)
      {
      this.initAware = initAware;
      if (this.initAware)
      {
      this.init();
      }
      }

      protected void init(){}

      public ServiceLocatorAdmisiones getServiceLocator()
      {
      return serviceLocator;
      }

      public void setServiceLocator(ServiceLocatorAdmisiones serviceLocator)
      {
      this.serviceLocator = serviceLocator;
      }
      }


      AccesoInscripcionBean.java:

      package co.edu.uis.admisiones.vista.beans;

      import java.util.*;
      import co.edu.uis.admisiones.vista.*;

      public class AccesoInscripcionBean extends BaseBean
      {
      private List documentosItems;

      public AccesoInscripcionBean()
      {
      super();
      documentosItems = new ArrayList();
      }

      public List getDocumentosItems()
      {
      return documentosItems;
      }

      public void setDocumentosItems(List listaDocumentos)
      {
      this.documentosItems = listaDocumentos;
      }

      private void initItemsDocumentos()
      {
      this.documentosItems = Listados.ListaDocumentos(
      this.getServiceLocator().getServicioConsultasGen() .getDocumentos());
      }

      protected void init()
      {
      try
      {
      super.init();
      initItemsDocumentos();
      }
      catch(Exception e)
      {
      System.err.println("Error en el método init() de AccesoInscripcionBean.java: "+e.toString());
      }
      }
      }


      admisiones.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN/EN" "http://www.springframework.org/dtd/spring-beans.dtd" >

      <beans>
      <!-- DataSource Definition -->
      <bean id="dataSourceAdmisiones"
      class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
      <property name="driverClassName">
      <value>com.informix.jdbc.IfxDriver</value>
      </property>
      <property name="url">
      <value>jdbc:informix-sqli://192.168.19.6:12010/academic:INFORMIXSERVER=UI;SelectMethod=cursor</value>
      </property>
      <property name="username">
      <value>admis</value>
      </property>
      <property name="password">
      <value>sdlfkseic</value>
      </property>
      </bean>

      <!-- Spring Data Access Exception Translator Defintion -->
      <bean id="jdbcExceptionTranslator" class="org.springframework.jdbc.support.SQLErrorCo deSQLExceptionTranslator">
      <property name="dataSource"><ref bean="dataSourceAdmisiones"/></property>
      </bean>

      <!-- Hibernate SessionFactory Definition -->
      <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
      <property name="mappingResources">
      <list>
      <value>co/edu/uis/admisiones/modelo/bo/Documento.hbm.xml</value>
      </list>
      </property>

      <property name="hibernateProperties">
      <props>
      <prop key="hibernate.dialect">org.hibernate.dialect.Info rmixDialect</prop>
      <prop key="hibernate.show_sql">false</prop>
      <prop key="hibernate.cglib.use_reflection_optimizer">fal se</prop>
      <prop key="hibernate.cache.provider_class">org.hibernate .cache.EhCacheProvider</prop>
      </props>
      </property>

      <property name="dataSource">
      <ref bean="dataSourceAdmisiones"/>
      </property>
      </bean>

      <!-- INTERCEPTORS -->
      <bean id="transactionManager" class="org.springframework.orm.hibernate3.Hibernat eTransactionManager">
      <property name="sessionFactory"><ref local="sessionFactory"/></property>
      </bean>

      <bean id="transactionInterceptor" class="org.springframework.transaction.interceptor .TransactionInterceptor">
      <property name="transactionManager"><ref bean="transactionManager"/></property>
      <property name="transactionAttributes">
      <props>
      <prop key="*">PROPAGATION_REQUIRED</prop>
      </props>
      </property>
      </bean>


      <bean id="hibernateInterceptor" class="org.springframework.orm.hibernate3.Hibernat eInterceptor">
      <property name="sessionFactory">
      <ref bean="sessionFactory"></ref>
      </property>
      </bean>

      <!-- Hibernate Template Defintion -->
      <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.Hibernat eTemplate">
      <property name="sessionFactory"><ref bean="sessionFactory"/></property>
      <property name="jdbcExceptionTranslator"><ref bean="jdbcExceptionTranslator"/></property>
      </bean>

      <!--DAO'S-->

      <bean id="DocumentoDao" class="co.edu.uis.admisiones.modelo.dao.hibernate. DocumentoDaoHibernateImpl">
      <property name="hibernateTemplate"><ref bean="hibernateTemplate"/></property>
      </bean>

      <!-- SERVICIOS-->

      <!-- Servicio de consultas -->
      <bean id="servicioConsultasGenTarget" class="co.edu.uis.admisiones.modelo.servicios.impl ementaciones.ServicioConsultasGenImpl">

      <property name="DocumentoDao">
      <ref bean="DocumentoDao"/>
      </property>
      </bean>

      <!-- Servicio consultas Proxy Transaccional-->
      <bean id="servicioConsultasGen" class="org.springframework.aop.framework.ProxyFact oryBean">
      <property name="target">
      <ref bean="servicioConsultasGenTarget"/>
      </property>

      <property name="proxyInterfaces">
      <value>co.edu.uis.admisiones.modelo.servicios.Serv icioConsultasGen</value>
      </property>

      <property name="interceptorNames">
      <list>
      <value>hibernateInterceptor</value>
      <value>transactionInterceptor</value>
      </list>
      </property>
      </bean>
      </beans>


      web.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
      <web-app id="WebApp_ID">
      <display-name>jsf</display-name>

      <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/admisiones.xml</param-value>
      </context-param>

      <servlet>
      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>
      javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
      </servlet>

      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.faces</url-pattern>
      </servlet-mapping>

      <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
      </web-app>

      Comment


      • #4
        Hola tio!

        Tienes que hablar ingles aqui...
        You have to speak in english

        Comment


        • #5
          java.lang.NoClassDefFoundError

          Hi,

          I am new en the JSF-Spring-Hibernate and the problem is that I created a proyect in Eclipse 3.2 and I have the page:

          index.jsp:

          <html>
          <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
          <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>

          <f:view>
          <body>
          <table>
          <tr>
          <td>Documents : </td>
          <td>
          <h:selectOneMenu id="documento" value="#{accesoInscripcion.documentosItems}">
          </h:selectOneMenu>
          </td>
          </tr>
          <tr>
          </tr>
          </table>
          </body>
          </f:view>
          </html>

          but I try to execute the nex error appear:

          11/07/2007 08:31:33 AM org.apache.myfaces.shared_impl.util.ClassUtils newInstance
          GRAVE: Class : co.edu.uis.admisiones.vista.beans.AccesoInscripcio nBean not found.
          java.lang.NoClassDefFoundError
          at co.edu.uis.admisiones.vista.beans.BaseBean.<init>( BaseBean.java:14)
          at co.edu.uis.admisiones.vista.beans.AccesoInscripcio nBean.<init>(AccesoInscripcionBean.java:12)
          at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
          at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
          at java.lang.reflect.Constructor.newInstance(Construc tor.java:494)
          at java.lang.Class.newInstance0(Class.java:350)
          at java.lang.Class.newInstance(Class.java:303)
          at org.apache.myfaces.shared_impl.util.ClassUtils.new Instance(ClassUtils.java:277)
          at org.apache.myfaces.shared_impl.util.ClassUtils.new Instance(ClassUtils.java:268)
          at org.apache.myfaces.config.ManagedBeanBuilder.build ManagedBean(ManagedBeanBuilder.java:49)
          at org.apache.myfaces.el.VariableResolverImpl.resolve Variable(VariableResolverImpl.java:314)
          at org.apache.myfaces.el.ValueBindingImpl$ELVariableR esolver.resolveVariable(ValueBindingImpl.java:570)
          at org.apache.commons.el.NamedValue.evaluate(NamedVal ue.java:124)
          at org.apache.myfaces.el.ValueBindingImpl.resolveToBa seAndProperty(ValueBindingImpl.java:458)
          at org.apache.myfaces.el.ValueBindingImpl.getType(Val ueBindingImpl.java:175)




          But the class is in the package. Sombody could tell me what is the solution?

          The configuration files are:


          faces-config.xml:

          <?xml version="1.0" encoding="UTF-8"?>

          <!DOCTYPE faces-config PUBLIC
          "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
          "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">

          <faces-config>
          <managed-bean>
          <managed-bean-name>
          documento</managed-bean-name>
          <managed-bean-class>
          co.edu.uis.admisiones.modelo.bo.Documento</managed-bean-class>
          <managed-bean-scope>
          request</managed-bean-scope>
          </managed-bean>

          <managed-bean>
          <managed-bean-name>accesoInscripcion</managed-bean-name>
          <managed-bean-class>
          co.edu.uis.admisiones.vista.beans.AccesoInscripcio nBean
          </managed-bean-class>
          <managed-bean-scope>
          request</managed-bean-scope>

          <managed-property>
          <property-name>initAware</property-name>
          <value>true</value>
          </managed-property>
          </managed-bean>

          </faces-config>


          BaseBean.java:

          package co.edu.uis.admisiones.vista.beans;

          import co.edu.uis.admisiones.vista.ServiceLocatorAdmision es;

          public class BaseBean
          {
          private boolean initAware = false;
          protected ServiceLocatorAdmisiones serviceLocator;

          public BaseBean()
          {
          try
          {
          this.setServiceLocator(ServiceLocatorAdmisiones.ge tInstance());
          }
          catch (Exception e)
          {
          e.printStackTrace();
          throw new RuntimeException("Error inicializando serviceLocator", e);
          }
          }

          public boolean isInitAware()
          {
          return initAware;
          }

          public void setInitAware(boolean initAware)
          {
          this.initAware = initAware;
          if (this.initAware)
          {
          this.init();
          }
          }

          protected void init(){}

          public ServiceLocatorAdmisiones getServiceLocator()
          {
          return serviceLocator;
          }

          public void setServiceLocator(ServiceLocatorAdmisiones serviceLocator)
          {
          this.serviceLocator = serviceLocator;
          }
          }


          AccesoInscripcionBean.java:

          package co.edu.uis.admisiones.vista.beans;

          import java.util.*;
          import co.edu.uis.admisiones.vista.*;

          public class AccesoInscripcionBean extends BaseBean
          {
          private List documentosItems;

          public AccesoInscripcionBean()
          {
          super();
          documentosItems = new ArrayList();
          }

          public List getDocumentosItems()
          {
          return documentosItems;
          }

          public void setDocumentosItems(List listaDocumentos)
          {
          this.documentosItems = listaDocumentos;
          }

          private void initItemsDocumentos()
          {
          this.documentosItems = Listados.ListaDocumentos(
          this.getServiceLocator().getServicioConsultasGen() .getDocumentos());
          }

          protected void init()
          {
          try
          {
          super.init();
          initItemsDocumentos();
          }
          catch(Exception e)
          {
          System.err.println("Error en el método init() de AccesoInscripcionBean.java: "+e.toString());
          }
          }
          }


          admisiones.xml:

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN/EN" "http://www.springframework.org/dtd/spring-beans.dtd" >

          <beans>
          <!-- DataSource Definition -->
          <bean id="dataSourceAdmisiones"
          class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
          <property name="driverClassName">
          <value>com.informix.jdbc.IfxDriver</value>
          </property>
          <property name="url">
          <value>jdbc:informix-sqli://192.168.19.6:12010/academic:INFORMIXSERVER=UI;SelectMethod=cursor</value>
          </property>
          <property name="username">
          <value>admis</value>
          </property>
          <property name="password">
          <value>sdlfkseic</value>
          </property>
          </bean>

          <!-- Spring Data Access Exception Translator Defintion -->
          <bean id="jdbcExceptionTranslator" class="org.springframework.jdbc.support.SQLErrorCo deSQLExceptionTranslator">
          <property name="dataSource"><ref bean="dataSourceAdmisiones"/></property>
          </bean>

          <!-- Hibernate SessionFactory Definition -->
          <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
          <property name="mappingResources">
          <list>
          <value>co/edu/uis/admisiones/modelo/bo/Documento.hbm.xml</value>
          </list>
          </property>

          <property name="hibernateProperties">
          <props>
          <prop key="hibernate.dialect">org.hibernate.dialect.Info rmixDialect</prop>
          <prop key="hibernate.show_sql">false</prop>
          <prop key="hibernate.cglib.use_reflection_optimizer">fal se</prop>
          <prop key="hibernate.cache.provider_class">org.hibernate .cache.EhCacheProvider</prop>
          </props>
          </property>

          <property name="dataSource">
          <ref bean="dataSourceAdmisiones"/>
          </property>
          </bean>

          <!-- INTERCEPTORS -->
          <bean id="transactionManager" class="org.springframework.orm.hibernate3.Hibernat eTransactionManager">
          <property name="sessionFactory"><ref local="sessionFactory"/></property>
          </bean>

          <bean id="transactionInterceptor" class="org.springframework.transaction.interceptor .TransactionInterceptor">
          <property name="transactionManager"><ref bean="transactionManager"/></property>
          <property name="transactionAttributes">
          <props>
          <prop key="*">PROPAGATION_REQUIRED</prop>
          </props>
          </property>
          </bean>


          <bean id="hibernateInterceptor" class="org.springframework.orm.hibernate3.Hibernat eInterceptor">
          <property name="sessionFactory">
          <ref bean="sessionFactory"></ref>
          </property>
          </bean>

          <!-- Hibernate Template Defintion -->
          <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.Hibernat eTemplate">
          <property name="sessionFactory"><ref bean="sessionFactory"/></property>
          <property name="jdbcExceptionTranslator"><ref bean="jdbcExceptionTranslator"/></property>
          </bean>

          <!--DAO'S-->

          <bean id="DocumentoDao" class="co.edu.uis.admisiones.modelo.dao.hibernate. DocumentoDaoHibernateImpl">
          <property name="hibernateTemplate"><ref bean="hibernateTemplate"/></property>
          </bean>

          <!-- SERVICIOS-->

          <!-- Servicio de consultas -->
          <bean id="servicioConsultasGenTarget" class="co.edu.uis.admisiones.modelo.servicios.impl ementaciones.ServicioConsultasGenImpl">

          <property name="DocumentoDao">
          <ref bean="DocumentoDao"/>
          </property>
          </bean>

          <!-- Servicio consultas Proxy Transaccional-->
          <bean id="servicioConsultasGen" class="org.springframework.aop.framework.ProxyFact oryBean">
          <property name="target">
          <ref bean="servicioConsultasGenTarget"/>
          </property>

          <property name="proxyInterfaces">
          <value>co.edu.uis.admisiones.modelo.servicios.Serv icioConsultasGen</value>
          </property>

          <property name="interceptorNames">
          <list>
          <value>hibernateInterceptor</value>
          <value>transactionInterceptor</value>
          </list>
          </property>
          </bean>
          </beans>


          web.xml:

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
          <web-app id="WebApp_ID">
          <display-name>jsf</display-name>

          <context-param>
          <param-name>contextConfigLocation</param-name>
          <param-value>/WEB-INF/admisiones.xml</param-value>
          </context-param>

          <servlet>
          <servlet-name>Faces Servlet</servlet-name>
          <servlet-class>
          javax.faces.webapp.FacesServlet</servlet-class>
          <load-on-startup>1</load-on-startup>
          </servlet>

          <servlet-mapping>
          <servlet-name>Faces Servlet</servlet-name>
          <url-pattern>*.faces</url-pattern>
          </servlet-mapping>

          <welcome-file-list>
          <welcome-file>index.jsp</welcome-file>
          </welcome-file-list>
          </web-app>

          Comment

          Working...
          X