Problemas al crear aplicacion nueva en OX 4.6

2013-02-11
2013-06-21
  • Edgar Rojas

    Edgar Rojas - 2013-02-11

    Hola a todos!!! Hace poco comencé a probar las bondades de Openxava 4.6. Es primera vez que uso este tipo de herramientas. Siguiendo los tutoriales del site oficial, pude arrancar Miescuela sin problemas. El asunto comienza cuando creé una aplicación nueva y quise hacer que corriera con mysql.

    a continuación les copio el log de tomcat a ver si pueden ayudarme.

    Gracias de antemano.

    feb 10, 2013 7:25:52 PM org.openxava.controller.ModuleManager <clinit>
    INFO: OpenXava 4.6.1 (2013-1-9)
    feb 10, 2013 7:25:52 PM org.hibernate.annotations.common.Version <clinit>
    INFO: Hibernate Commons Annotations 3.2.0.Final
    feb 10, 2013 7:25:52 PM org.hibernate.cfg.Environment <clinit>
    INFO: Hibernate 3.6.10.Final
    feb 10, 2013 7:25:52 PM org.hibernate.cfg.Environment <clinit>
    INFO: hibernate.properties not found
    feb 10, 2013 7:25:52 PM org.hibernate.cfg.Environment buildBytecodeProvider
    INFO: Bytecode provider name : javassist
    feb 10, 2013 7:25:52 PM org.hibernate.cfg.Environment <clinit>
    INFO: using JDK 1.4 java.sql.Timestamp handling
    feb 10, 2013 7:25:53 PM org.hibernate.ejb.Version <clinit>
    INFO: Hibernate EntityManager 3.6.10.Final
    feb 10, 2013 7:25:53 PM org.hibernate.util.DTDEntityResolver resolveEntity
    WARNING: recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
    feb 10, 2013 7:25:54 PM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
    INFO: Mapping class: org.openxava.session.GalleryImage -> IMAGES
    feb 10, 2013 7:25:54 PM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.escuela.modelo.Profesor
    feb 10, 2013 7:25:54 PM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.escuela.modelo.Profesor on table Profesor
    feb 10, 2013 7:25:54 PM org.hibernate.validator.Version <clinit>
    INFO: Hibernate Validator 3.1.0.GA
    feb 10, 2013 7:25:54 PM org.hibernate.validator.util.Version <clinit>
    INFO: Hibernate Validator 4.1.0.Final
    feb 10, 2013 7:25:54 PM org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA
    INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
    feb 10, 2013 7:25:54 PM org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA
    INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
    feb 10, 2013 7:25:54 PM org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA
    INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
    feb 10, 2013 7:25:54 PM org.hibernate.cfg.search.HibernateSearchEventListenerRegister enableHibernateSearch
    INFO: Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
    feb 10, 2013 7:25:54 PM org.hibernate.util.NamingHelper getInitialContext
    INFO: JNDI InitialContext properties:{}
    feb 10, 2013 7:25:54 PM org.hibernate.connection.DatasourceConnectionProvider configure
    INFO: Using datasource: java:comp/env/jdbc/MiEscuelaDS
    feb 10, 2013 7:25:54 PM org.hibernate.dialect.Dialect <init>
    INFO: Using dialect: org.hibernate.dialect.HSQLDialect
    feb 10, 2013 7:25:55 PM org.hibernate.engine.jdbc.JdbcSupportLoader useContextualLobCreation
    INFO: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Database ->
    name : HSQL Database Engine
    version : 1.8.0
    major : 1
    minor : 8
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Driver ->
    name : HSQL Database Engine Driver
    version : 1.8.0
    major : 1
    minor : 8
    feb 10, 2013 7:25:55 PM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
    INFO: Using default transaction strategy (direct JDBC transactions)
    feb 10, 2013 7:25:55 PM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
    INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Automatic flush during beforeCompletion(): disabled
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Automatic session close at end of transaction: disabled
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: JDBC batch size: 15
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: JDBC batch updates for versioned data: disabled
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Scrollable result sets: enabled
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: JDBC3 getGeneratedKeys(): disabled
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Connection release mode: auto
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Default batch fetch size: 1
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Generate SQL with comments: disabled
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Order SQL updates by primary key: disabled
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Order SQL inserts for batching: disabled
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
    INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
    feb 10, 2013 7:25:55 PM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
    INFO: Using ASTQueryTranslatorFactory
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Query language substitutions: {}
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: JPA-QL strict compliance: enabled
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Second-level cache: enabled
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Query cache: disabled
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory createRegionFactory
    INFO: Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Optimize cache for minimal puts: disabled
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Structured second-level cache entries: disabled
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Statistics: disabled
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Deleted entity synthetic identifier rollback: disabled
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Default entity-mode: pojo
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Named query checking : enabled
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Check Nullability in Core (should be disabled when Bean Validation is on): disabled
    feb 10, 2013 7:25:55 PM org.hibernate.impl.SessionFactoryImpl <init>
    INFO: building session factory
    feb 10, 2013 7:25:55 PM org.hibernate.type.BasicTypeRegistry register
    INFO: Type registration [clob] overrides previous : org.hibernate.type.ClobType@17e25dd
    feb 10, 2013 7:25:55 PM org.hibernate.type.BasicTypeRegistry register
    INFO: Type registration [java.sql.Clob] overrides previous : org.hibernate.type.ClobType@17e25dd
    feb 10, 2013 7:25:55 PM org.hibernate.type.BasicTypeRegistry register
    INFO: Type registration [wrapper_characters_clob] overrides previous : org.hibernate.type.CharacterArrayClobType@e7f2c9
    feb 10, 2013 7:25:55 PM org.hibernate.type.BasicTypeRegistry register
    INFO: Type registration [wrapper_materialized_blob] overrides previous : org.hibernate.type.WrappedMaterializedBlobType@1f471c4
    feb 10, 2013 7:25:55 PM org.hibernate.type.BasicTypeRegistry register
    INFO: Type registration [materialized_blob] overrides previous : org.hibernate.type.MaterializedBlobType@1590a39
    feb 10, 2013 7:25:55 PM org.hibernate.type.BasicTypeRegistry register
    INFO: Type registration [characters_clob] overrides previous : org.hibernate.type.PrimitiveCharacterArrayClobType@ae3235
    feb 10, 2013 7:25:55 PM org.hibernate.type.BasicTypeRegistry register
    INFO: Type registration [materialized_clob] overrides previous : org.hibernate.type.MaterializedClobType@627065
    feb 10, 2013 7:25:55 PM org.hibernate.type.BasicTypeRegistry register
    INFO: Type registration [blob] overrides previous : org.hibernate.type.BlobType@c0fc36
    feb 10, 2013 7:25:55 PM org.hibernate.type.BasicTypeRegistry register
    INFO: Type registration [java.sql.Blob] overrides previous : org.hibernate.type.BlobType@c0fc36
    feb 10, 2013 7:25:55 PM org.hibernate.id.UUIDHexGenerator <init>
    WARNING: Using org.hibernate.id.UUIDHexGenerator which does not generate IETF RFC 4122 compliant UUID values; consider using org.hibernate.id.UUIDGenerator instead
    feb 10, 2013 7:25:55 PM org.hibernate.impl.SessionFactoryObjectFactory addInstance
    INFO: Not binding factory to JNDI, no JNDI name configured
    feb 10, 2013 7:25:59 PM org.directwebremoting.util.CommonsLoggingOutput info
    INFO: Exec: Module.getStrokeActions()
    feb 10, 2013 7:26:05 PM org.directwebremoting.util.CommonsLoggingOutput info
    INFO: Exec: Module.request()
    feb 10, 2013 7:26:15 PM org.directwebremoting.util.CommonsLoggingOutput info
    INFO: Exec: Module.request()
    feb 10, 2013 7:26:19 PM org.directwebremoting.util.CommonsLoggingOutput info
    INFO: Exec: Module.request()
    feb 10, 2013 7:26:22 PM org.directwebremoting.util.CommonsLoggingOutput info
    INFO: Exec: Module.request()

     
  • Javier Paniza

    Javier Paniza - 2013-02-13

    Hola Edgar,

    en el log no hay ninguna traza de excepción, así que no te puedo dar ninguna pista.

    ¿Qué pasos das con la aplicación?
    ¿En que momento falla?
    ¿Qué le aparece por pantalla al usuario?
    ¿Se produce alguna traza en el servidor en ese momento?


    Ayuda a otros en este foro como yo te ayudo a ti.
    Antes de poner una pregunta busca en este mismo foro la respuesta
    y lee la documentación de OpenXava en openxava.org.

     
  • alonso isidoro roman

    Buenas Edgar, dices que quieres correr la aplicacion sobre mysql, el caso es que veo en la traza que esta cargando el driver hsql:
    de tu traza:

    INFO: Database ->
    name : HSQL Database Engine
    version : 1.8.0
    major : 1
    minor : 8
    feb 10, 2013 7:25:55 PM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Driver ->
    name : HSQL Database Engine Driver
    version : 1.8.0
    major : 1
    minor : 8

    Puedes mostrarnos como es el fichero TuProyecto/persistence/META-INF/persistence.xml y el TuProyecto/persistence/hibernate.cfg.xml?

    y ya puestos el DONDE_SEA_QUE_TENGAS_INSTALADO_OX/openxava-4.6.1/tomcat/conf/context.xml

    Has creado la base de datos y le has asignado el usuario openxava? tiene los permisos adecuados de creacion de tablas, ademas de seleccion, borrado, actualizacion y creacion de tuplas?

    Cuentanos un poco mas y te podremos ayudar

     
  • Edgar Rojas

    Edgar Rojas - 2013-02-26

    Hola de Nuevo. He estado siguiendo las instrucciones que dan en este thread: http://sourceforge.net/p/openxava/discussion/437013/thread/250154fb y he cambiado los archivos como se indica ahi...

    Remito los archivos respectivos y la traza de Tomcat, a ver si me pueden ayudar. Saludos.

    P.D.: Estoy siguiendo el demo del libro (Invoicing) pero quiero hacerlo con MySQL y configurando los archivos es que he tenido problemas.

    -------------------------------------------------------------------------------------------

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

    <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence &lt;a href=" http:="" java.sun.com="" xml="" ns="" persistence="" persistence_1_0.xsd"="">http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">

    <!-- Tomcat + MySQL -->
    <persistence-unit name="default">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <non-jta-data-source>java:comp/env/jdbc/InvoicingDS</non-jta-data-source>
        <class>org.openxava.session.GalleryImage</class>
        <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
        </properties>
    </persistence-unit>
    
    <!-- JBoss + Hypersonic 
    <persistence-unit name="default">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <non-jta-data-source>java:/InvoicingDS</non-jta-data-source>
        <class>org.openxava.session.GalleryImage</class>
        <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
        </properties>
    </persistence-unit>    
    -->
    
    <!-- WebSphere + AS/400 
    <persistence-unit name="default">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <non-jta-data-source>jdbc/InvoicingDS</non-jta-data-source>
        <class>org.openxava.session.GalleryImage</class>
        <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.DB2400Dialect"/>
            <property name="hibernate.show_sql" value="false"/>
        </properties>
    </persistence-unit>
    -->
    
    <!-- JUnit Hypersonic -->
    <persistence-unit name="junit">
    
        <properties>
            <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
            <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/invoicing"/>
            <property name="hibernate.connection.username" value="root"/>
            <property name="hibernate.connection.password" value="paratodox"/>                     
        </properties>
    </persistence-unit>
    

    </persistence>

    hibernate.cfg.xml :

    <hibernate-configuration>

    <session-factory>
    
        <!-- Tomcat + Hypersonic -->
        <property name="hibernate.connection.datasource">java:comp/env/jdbc/Invoicing</property>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
        <property name="hibernate.jdbc.use_get_generated_keys">false</property>     
        <property name="hibernate.show_sql">false</property>
    
        <!-- WebSphere + AS/400 
        <property name="hibernate.connection.datasource">jdbc/InvoicingDS</property>
        <property name="hibernate.dialect">org.hibernate.dialect.DB2400Dialect</property>
        <property name="hibernate.jdbc.use_get_generated_keys">false</property>     
        <property name="hibernate.show_sql">false</property>        
        -->
    
        <!-- GalleryImage is needed only if you uses IMAGES_GALLERY/GALERIA_IMAGENES stereotype -->
        <mapping resource="GalleryImage.hbm.xml"/>
    
    </session-factory>
    

    </hibernate-configuration>

    y, por último, context.xml (el que se encuentra en Tomcat v6.0 Server at localhost-config)

    <Context>

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    
    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
    <Manager pathname="" />
    -->
    
    <!-- Uncomment this to enable Comet connection tacking (provides events
         on session expiration as well as webapp lifecycle) -->
    <!--
    <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
    -->
    
    <!--
    <Resource name="jdbc/OpenXavaTestDS" auth="Container" type="javax.sql.DataSource"
          maxActive="20" maxIdle="5" maxWait="10000"
          username="sa" password="" driverClassName="org.hsqldb.jdbcDriver"
          url="jdbc:hsqldb:file:../data/openxava-test-db"/>
    -->
    <!-- 
    <Resource auth="Container" driverClassName="org.hsqldb.jdbcDriver" maxActive="20" maxIdle="5" maxWait="10000" name="jdbc/OpenXavaTestDS" password="" type="javax.sql.DataSource" url="jdbc:hsqldb:hsql://localhost:1666" username="sa"/>
    
    <Resource auth="Container" driverClassName="org.hsqldb.jdbcDriver" maxActive="20" maxIdle="5" maxWait="10000" name="jdbc/MySchoolDS" password="" type="javax.sql.DataSource" url="jdbc:hsqldb:file:../data/my-school-db" username="sa"/>
    
    <Resource auth="Container" driverClassName="org.hsqldb.jdbcDriver" maxActive="20" maxIdle="5" maxWait="10000" name="jdbc/MiEscuelaDS" password="" type="javax.sql.DataSource" url="jdbc:hsqldb:file:../data/mi-escuela-db" username="sa"/>
     -->
     <!-- ***** Apuntar a MySql local ***** -->
    <Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxActive="20" maxIdle="5" maxWait="10000" 
        name="jdbc/invoicing" username="root" password="paratodox" type="javax.sql.DataSource"
        url="jdbc:mysql://localhost:3306/invoicing"/>
    

    </Context>

    Y he aquí también la traza de tomcat:

    feb 25, 2013 10:08:38 PM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    feb 25, 2013 10:08:38 PM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    feb 25, 2013 10:08:55 PM org.apache.catalina.core.ApplicationDispatcher invoke
    SEVERE: El Servlet.service() para servlet jsp lanzó una excepción
    javax.naming.NameNotFoundException: El nombre InvoicingDS no este asociado a este contexto
    at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
    at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:75)
    at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
    at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:51)
    at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:90)
    at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)
    at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:906)
    at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:57)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
    at org.openxava.jpa.XPersistence.getEntityManagerFactory(XPersistence.java:182)
    at org.openxava.jpa.XPersistence.createManager(XPersistence.java:108)
    at org.openxava.annotations.parse.AnnotatedClassParser.obtainManagedClassNamesUsingJPA(AnnotatedClassParser.java:2522)
    at org.openxava.annotations.parse.AnnotatedClassParser.getManagedClassNames(AnnotatedClassParser.java:2438)
    at org.openxava.annotations.parse.AnnotatedClassParser.getClassNameFor(AnnotatedClassParser.java:2390)
    at org.openxava.annotations.parse.AnnotatedClassParser.parse(AnnotatedClassParser.java:66)
    at org.openxava.component.ComponentParser.parseAnnotatedClass(ComponentParser.java:47)
    at org.openxava.component.ComponentParser.parse(ComponentParser.java:36)
    at org.openxava.component.MetaComponent.get(MetaComponent.java:60)
    at org.openxava.component.MetaComponent.exists(MetaComponent.java:75)
    at org.openxava.application.meta.MetaApplication.existsModel(MetaApplication.java:151)
    at org.openxava.application.meta.MetaApplication.getMetaModule(MetaApplication.java:140)
    at org.openxava.controller.ModuleManager.getMetaModule(ModuleManager.java:1024)
    at org.openxava.controller.ModuleManager.setupModuleControllers(ModuleManager.java:228)
    at org.openxava.controller.ModuleManager.setModuleName(ModuleManager.java:997)
    at org.apache.jsp.xava.module_jsp._jspService(module_jsp.java:166)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    at org.openxava.web.servlets.ModuleServlet.doGet(ModuleServlet.java:24)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
    at java.lang.Thread.run(Unknown Source)

    feb 25, 2013 10:08:55 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() para servlet module lanzó excepción
    javax.naming.NameNotFoundException: El nombre InvoicingDS no este asociado a este contexto
    at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
    at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:75)
    at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
    at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:51)
    at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:90)
    at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)
    at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:906)
    at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:57)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
    at org.openxava.jpa.XPersistence.getEntityManagerFactory(XPersistence.java:182)
    at org.openxava.jpa.XPersistence.createManager(XPersistence.java:108)
    at org.openxava.annotations.parse.AnnotatedClassParser.obtainManagedClassNamesUsingJPA(AnnotatedClassParser.java:2522)
    at org.openxava.annotations.parse.AnnotatedClassParser.getManagedClassNames(AnnotatedClassParser.java:2438)
    at org.openxava.annotations.parse.AnnotatedClassParser.getClassNameFor(AnnotatedClassParser.java:2390)
    at org.openxava.annotations.parse.AnnotatedClassParser.parse(AnnotatedClassParser.java:66)
    at org.openxava.component.ComponentParser.parseAnnotatedClass(ComponentParser.java:47)
    at org.openxava.component.ComponentParser.parse(ComponentParser.java:36)
    at org.openxava.component.MetaComponent.get(MetaComponent.java:60)
    at org.openxava.component.MetaComponent.exists(MetaComponent.java:75)
    at org.openxava.application.meta.MetaApplication.existsModel(MetaApplication.java:151)
    at org.openxava.application.meta.MetaApplication.getMetaModule(MetaApplication.java:140)
    at org.openxava.controller.ModuleManager.getMetaModule(ModuleManager.java:1024)
    at org.openxava.controller.ModuleManager.setupModuleControllers(ModuleManager.java:228)
    at org.openxava.controller.ModuleManager.setModuleName(ModuleManager.java:997)
    at org.apache.jsp.xava.module_jsp._jspService(module_jsp.java:166)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    at org.openxava.web.servlets.ModuleServlet.doGet(ModuleServlet.java:24)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
    at java.lang.Thread.run(Unknown Source)


    Gracias de nuevo por su atención, y disculpen las novatadas,

    Edgar Rojas

     
  • alonso isidoro roman

    Hola Edgar, en el context.xml declaras un recurso jndi tal que asi:

    <Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxActive="20" maxIdle="5" maxWait="10000" name="jdbc/invoicing" username="root" password="paratodox" type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/invoicing"/>

    en el hibernate.cfg.xml declaras algo asi:

    <session-factory>

    <!-- Tomcat + Hypersonic -->
    <property name="hibernate.connection.datasource">java:comp/env/jdbc/Invoicing</property>
    <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
    <property name="hibernate.jdbc.use_get_generated_keys">false</property>     
    <property name="hibernate.show_sql">false</property>
    

    ...
    </session-factory>

    Y por ultimo el persistence.xml

    <persistence-unit name="default">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <non-jta-data-source>java:comp/env/jdbc/InvoicingDS</non-jta-data-source>
    <class>org.openxava.session.GalleryImage</class>
    <properties>
    <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
    </properties>
    </persistence-unit>

    Ves las diferencias? Cuando el tomcat arranca y ha terminado de intentar levantar su contexto, el turno es del war y para arrancar este war intenta crear una unidad de persistencia default el cual necesita un recurso que tu has llamado InvoicingDS, cuando el que tienes declarado en el contexto de tomcat es Invoicing. Falla pq no encuentra ese recurso. Cambia en el persistence.xml la siguiente linea:

    <non-jta-data-source>java:comp/env/jdbc/InvoicingDS</non-jta-data-source>

    por esta:

    <non-jta-data-source>java:comp/env/jdbc/invoicing</non-jta-data-source>

    Otra cosa, has creado la base de datos y le has asignado el usuario root?

     
  • alonso isidoro roman

    otra cosa, has colocado el jar de mysql en el directorio lib del tomcat?

     
  • Edgar Rojas

    Edgar Rojas - 2013-02-26

    Gracias Alonso, por tu pronta respuesta!!
    Voy a probar los cambios que indicas. Respecto a lo de la base de datos, sí está creada con usuario root asignado y el jdbc connector está en la carpeta lib del tomcat de OX.

     
  • Edgar Rojas

    Edgar Rojas - 2013-02-28

    Hola de nuevo Alonso. Asunto Resuelto!!!!!!! Seguí al pie de la letra tus instrucciones y ya estoy conectado a la base de datos MySQL. Ahora a seguir experimentanto con las bondades de OX.

    Saludos desde Venezuela!!!!!

     
  • Carlos Torres

    Carlos Torres - 2013-06-19

    Buenas Tardes, yo también soy nuevo y también quiero trabajar con MySQL, hice todas las instrucciones del libro, más otras búsqueda en el foro y google y logré conectarme a la BD y crear las tablas sin problemas, pero a la hora de desplegar en el browser (http://localhost:8080/Invoicing/modules/Teacher) la aplicación me arroja una excepción SEVERE: El Servlet.service() para servlet jsp lanzó una excepción.

    Tengo una entidad con solo dos campos:

    import java.util.;
    import javax.persistence.
    ;
    import org.openxava.annotations.*;

    @Entity
    public class Teacher {

    @Id @Column(length=5) @Required   
    private Long id;
    
    @Column(length=40) @Required
    private String name;
    
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    

    }

    Y la traza del error es el siguiente:

    WARNING: Using org.hibernate.id.UUIDHexGenerator which does not generate IETF RFC 4122 compliant UUID values; consider using org.hibernate.id.UUIDGenerator instead
    jun 19, 2013 3:14:17 PM org.hibernate.impl.SessionFactoryObjectFactory addInstance
    INFO: Not binding factory to JNDI, no JNDI name configured
    jun 19, 2013 3:14:17 PM org.apache.catalina.core.ApplicationDispatcher invoke
    SEVERE: El Servlet.service() para servlet jsp lanzó una excepción
    java.lang.ClassNotFoundException: javax.transaction.SystemException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:112)
    at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:107)
    at org.openxava.jpa.XPersistence.createManager(XPersistence.java:108)
    at org.openxava.annotations.parse.AnnotatedClassParser.obtainManagedClassNamesUsingJPA(AnnotatedClassParser.java:2524)
    at org.openxava.annotations.parse.AnnotatedClassParser.getManagedClassNames(AnnotatedClassParser.java:2440)
    at org.openxava.annotations.parse.AnnotatedClassParser.getClassNameFor(AnnotatedClassParser.java:2392)
    at org.openxava.annotations.parse.AnnotatedClassParser.parse(AnnotatedClassParser.java:66)
    at org.openxava.component.ComponentParser.parseAnnotatedClass(ComponentParser.java:47)
    at org.openxava.component.ComponentParser.parse(ComponentParser.java:36)
    at org.openxava.component.MetaComponent.get(MetaComponent.java:60)
    at org.openxava.component.MetaComponent.exists(MetaComponent.java:75)
    at org.openxava.application.meta.MetaApplication.existsModel(MetaApplication.java:151)
    at org.openxava.application.meta.MetaApplication.getMetaModule(MetaApplication.java:140)
    at org.openxava.controller.ModuleManager.getMetaModule(ModuleManager.java:1039)
    at org.openxava.controller.ModuleManager.setupModuleControllers(ModuleManager.java:228)
    at org.openxava.controller.ModuleManager.setModuleName(ModuleManager.java:1012)
    at org.apache.jsp.xava.module_jsp._jspService(module_jsp.java:173)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
    at org.openxava.web.servlets.ModuleServlet.doGet(ModuleServlet.java:24)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    jun 19, 2013 3:14:17 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: El Servlet.service() para el servlet [module] en el contexto con ruta [/Invoicing] lanzó la excepción [javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/transaction/SystemException] con causa raíz
    java.lang.ClassNotFoundException: javax.transaction.SystemException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:112)
    at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:107)
    at org.openxava.jpa.XPersistence.createManager(XPersistence.java:108)
    at org.openxava.annotations.parse.AnnotatedClassParser.obtainManagedClassNamesUsingJPA(AnnotatedClassParser.java:2524)
    at org.openxava.annotations.parse.AnnotatedClassParser.getManagedClassNames(AnnotatedClassParser.java:2440)
    at org.openxava.annotations.parse.AnnotatedClassParser.getClassNameFor(AnnotatedClassParser.java:2392)
    at org.openxava.annotations.parse.AnnotatedClassParser.parse(AnnotatedClassParser.java:66)
    at org.openxava.component.ComponentParser.parseAnnotatedClass(ComponentParser.java:47)
    at org.openxava.component.ComponentParser.parse(ComponentParser.java:36)
    at org.openxava.component.MetaComponent.get(MetaComponent.java:60)
    at org.openxava.component.MetaComponent.exists(MetaComponent.java:75)
    at org.openxava.application.meta.MetaApplication.existsModel(MetaApplication.java:151)
    at org.openxava.application.meta.MetaApplication.getMetaModule(MetaApplication.java:140)
    at org.openxava.controller.ModuleManager.getMetaModule(ModuleManager.java:1039)
    at org.openxava.controller.ModuleManager.setupModuleControllers(ModuleManager.java:228)
    at org.openxava.controller.ModuleManager.setModuleName(ModuleManager.java:1012)
    at org.apache.jsp.xava.module_jsp._jspService(module_jsp.java:173)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
    at org.openxava.web.servlets.ModuleServlet.doGet(ModuleServlet.java:24)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    Por favor si me pueden ayudar se los agradecería.

     
  • Javier Paniza

    Javier Paniza - 2013-06-21

    Hola Carlos,

    te falta esta clase javax.transaction.SystemException. Es como si tuvieras el jta.jar.
    ¿Estás usando el Tomcat incluido con OpenXava?
    Si estás usando tu propio Tomcat tendrás que añadirles ejb.jar y jta.jar. Leete esto:
    http://openxava.wikispaces.com/tomcat-liferay-setup


    Ayuda a otros en este foro como yo te ayudo a ti.
    ¿Necesitas más ayuda? Usa el soporte profesional de OpenXava

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks