Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - bertamax

#1
Hola. Estoy intentando hacer una aplicación web y para ello uso tomee y persistencia EJB y me da error al intentar obtener el EntityManager porque no encuentra el JDBC.
Mi fichero tomee.xml es el siguiente:
<?xml version="1.0" encoding="UTF-8"?>
<tomee>
  <!-- see http://tomee.apache.org/containers-and-resources.html -->

  <!-- activate next line to be able to deploy applications in apps -->
  <!-- <Deployments dir="apps" /> -->
   <Resource id="TestDS" type="DataSource">
     JdbcDriver com.mysql.jdbc.Driver
     JdbcUrl jdbc:mysql://localhost:3306/databaseName
     UserName user
     Password 123
     JtaManaged true
   </Resource>
</tomee>
Y el fichero persistence.xml el siguiente:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" 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 http://java.sun.com/xml/ns/persistence/persistence_2_1.xsd">
        <persistence-unit name="TestDSunit" transaction-type="JTA">
          <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
          <jta-data-source>TestDS</jta-data-source>
          <class>dao.User</class>
     <properties>
            <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
          </properties>
        </persistence-unit>
</persistence>
He probado poniendo en jta-data-source las siguientes opciones
java:openejb/Resource/TestDS
java:comp/env/TestDS
java/TestDS
Y siempre me da el mismo error:
<openjpa-2.4.0-nonfinal-1598334-r422266:1599166 fatal user error> org.apache.openjpa.persistence.ArgumentException: The persistence provider is attempting to use properties in the persistence.xml file to resolve the data source. A Java Database Connectivity (JDBC) driver or data source class name must be specified in the openjpa.ConnectionDriverName or javax.persistence.jdbc.driver property. The following properties are available in the configuration: "org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl@fdaf18ee".
Y es que ya no sé como solucionar para que lo pueda localizar, ¿alguna ayuda? gracias
#2
Desarrollo Web / Termometro en JSF
15 Diciembre 2014, 13:43 PM
¿Conocéis algún termómetro que pueda funcionar en JSF?
#3
Desarrollo Web / Excepción con TomEE
10 Diciembre 2014, 13:01 PM
Soy nueva con TomEE, me he creado un proyecto web vacío, lo he ejecutado con el servidor TomEE y me sale la siguiente excepción:

java.lang.NoClassDefFoundError: org/apache/tomee/TomEELogConfigurer
   at org.apache.tomee.catalina.ServerListener.install(ServerListener.java:170)
   at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:55)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
   at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
   at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:379)
   at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
   at org.apache.catalina.startup.Catalina.load(Catalina.java:572)
   at org.apache.catalina.startup.Catalina.load(Catalina.java:595)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:262)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:430)
Caused by: java.lang.ClassNotFoundException: org.apache.tomee.TomEELogConfigurer
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 14 more
#4
Desarrollo Web / Excepción con TomEE
9 Diciembre 2014, 10:20 AM
Soy nueva con TomEE, siguiendo este tutorial: http://jaxenter.com/getting-started-with-apache-tomee-105824.html he intentado implementarlo en mi proyecto, pero me da la siguiente excepción:
Código (exception) [Seleccionar]
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/MyProject]]
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:816)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/MyProject]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
... 7 more
Caused by: org.apache.tomee.catalina.TomEERuntimeException: org.apache.openejb.OpenEJBException: Cannot unmarshall the faces configuration file: file:/home/user/MyWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/MyProject/WEB-INF/faces-config.xml: Unexpected element {http://xmlns.jcp.org/xml/ns/javaee}protected-views, expected [{http://java.sun.com/xml/ns/javaee}application, {http://java.sun.com/xml/ns/javaee}ordering, {http://java.sun.com/xml/ns/javaee}absolute-ordering, {http://java.sun.com/xml/ns/javaee}factory, {http://java.sun.com/xml/ns/javaee}component, {http://java.sun.com/xml/ns/javaee}converter, {http://java.sun.com/xml/ns/javaee}managed-bean, {http://java.sun.com/xml/ns/javaee}name, {http://java.sun.com/xml/ns/javaee}navigation-rule, {http://java.sun.com/xml/ns/javaee}referenced-bean, {http://java.sun.com/xml/ns/javaee}render-kit, {http://java.sun.com/xml/ns/javaee}lifecycle, {http://java.sun.com/xml/ns/javaee}validator, {http://java.sun.com/xml/ns/javaee}behavior, {http://java.sun.com/xml/ns/javaee}faces-config-extension]
at org.apache.tomee.catalina.TomcatWebAppBuilder.loadApplication(TomcatWebAppBuilder.java:2150)
at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1134)
at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1087)
at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:130)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5378)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
Caused by: org.apache.openejb.OpenEJBException: Cannot unmarshall the faces configuration file: file:/home/user/MyWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/MyProject/WEB-INF/faces-config.xml: Unexpected element {http://xmlns.jcp.org/xml/ns/javaee}protected-views, expected [{http://java.sun.com/xml/ns/javaee}application, {http://java.sun.com/xml/ns/javaee}ordering, {http://java.sun.com/xml/ns/javaee}absolute-ordering, {http://java.sun.com/xml/ns/javaee}factory, {http://java.sun.com/xml/ns/javaee}component, {http://java.sun.com/xml/ns/javaee}converter, {http://java.sun.com/xml/ns/javaee}managed-bean, {http://java.sun.com/xml/ns/javaee}name, {http://java.sun.com/xml/ns/javaee}navigation-rule, {http://java.sun.com/xml/ns/javaee}referenced-bean, {http://java.sun.com/xml/ns/javaee}render-kit, {http://java.sun.com/xml/ns/javaee}lifecycle, {http://java.sun.com/xml/ns/javaee}validator, {http://java.sun.com/xml/ns/javaee}behavior, {http://java.sun.com/xml/ns/javaee}faces-config-extension]
at org.apache.openejb.config.ReadDescriptors.readFacesConfig(ReadDescriptors.java:831)
at org.apache.openejb.config.DeploymentLoader.addFacesConfigs(DeploymentLoader.java:1396)
at org.apache.openejb.config.DeploymentLoader.createWebModule(DeploymentLoader.java:1044)
at org.apache.openejb.config.DeploymentLoader.createWebModule(DeploymentLoader.java:779)
at org.apache.openejb.config.DeploymentLoader.load(DeploymentLoader.java:213)
at org.apache.tomee.catalina.TomcatWebAppBuilder.loadApplication(TomcatWebAppBuilder.java:2148)
... 14 more
Caused by: javax.xml.bind.UnmarshalException: Unexpected element {http://xmlns.jcp.org/xml/ns/javaee}protected-views, expected [{http://java.sun.com/xml/ns/javaee}application, {http://java.sun.com/xml/ns/javaee}ordering, {http://java.sun.com/xml/ns/javaee}absolute-ordering, {http://java.sun.com/xml/ns/javaee}factory, {http://java.sun.com/xml/ns/javaee}component, {http://java.sun.com/xml/ns/javaee}converter, {http://java.sun.com/xml/ns/javaee}managed-bean, {http://java.sun.com/xml/ns/javaee}name, {http://java.sun.com/xml/ns/javaee}navigation-rule, {http://java.sun.com/xml/ns/javaee}referenced-bean, {http://java.sun.com/xml/ns/javaee}render-kit, {http://java.sun.com/xml/ns/javaee}lifecycle, {http://java.sun.com/xml/ns/javaee}validator, {http://java.sun.com/xml/ns/javaee}behavior, {http://java.sun.com/xml/ns/javaee}faces-config-extension]
at org.metatype.sxc.jaxb.RuntimeContext.validationError(RuntimeContext.java:390)
at org.metatype.sxc.jaxb.RuntimeContext.validationError(RuntimeContext.java:379)
at org.metatype.sxc.jaxb.RuntimeContext.unexpectedElement(RuntimeContext.java:225)
at org.apache.openejb.jee.FacesConfig$JAXB._read(FacesConfig$JAXB.java:343)
at org.apache.openejb.jee.FacesConfig$JAXB.read(FacesConfig$JAXB.java:399)
at org.apache.openejb.jee.FacesConfig$JAXB.read(FacesConfig$JAXB.java:61)
at org.apache.openejb.sxc.Sxc.unmarshall(Sxc.java:167)
at org.apache.openejb.sxc.Sxc.unmarhsal(Sxc.java:158)
at org.apache.openejb.sxc.Sxc.unmarshalJavaee(Sxc.java:143)
at org.apache.openejb.sxc.FacesConfigXml.unmarshal(FacesConfigXml.java:34)
at org.apache.openejb.config.ReadDescriptors.readFacesConfig(ReadDescriptors.java:827)
... 19 more
Dec 5, 2014 2:42:38 PM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:739)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:816)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
Dec 5, 2014 2:42:38 PM org.apache.catalina.startup.Catalina start
SEVERE: The required Server component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: Failed to start component [StandardServer[9005]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:739)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 9 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more


No entiendo qué es lo que puede fallar.




I delete The Servers folder and I configure again to run with TomEE, I get the following exception:
Código (out) [Seleccionar]
java.lang.IncompatibleClassChangeError: class org.apache.bcel.util.ClassPath$2 has interface org.apache.bcel.util.ClassPath$ClassFile as super class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1148)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1643)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:1956)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1919)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1806)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1765)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1751)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1255)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:882)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:317)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5081)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.startup.Catalina.start(Catalina.java:620)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)





The problem is with the xalan-2.7.1.jar library. I do not know how to make it works with TomEE.

Mod: No hacer doble post. Utilizar etiquetas [code][/code] para publicar output.
#5
Java / Re: Drag and Drop API
11 Septiembre 2012, 11:48 AM
Gracias, es verdad, sólo es necesario el import:
import java.awt.dnd.*;
#6
Java / Drag and Drop API
10 Septiembre 2012, 17:19 PM
¿De dónde me puedo descargar la API de Java llamada Drag and Drop?
#7
Java / Re: Ejecutar un comando en java
10 Septiembre 2012, 17:17 PM
Muchas gracias
#8
Java / Ejecutar un comando en java
9 Septiembre 2012, 16:58 PM
Dentro de un programa en java, ¿cómo podría ejecutar un comando, por ejemplo reset?
#9
Java / Re: Exception NullPointerException
9 Septiembre 2012, 16:57 PM
Tienes razón, tendría que instanciarlo antes.
Lo que quería hacer array1=array2.

Muchas gracias.
#10
Java / Exception NullPointerException
8 Septiembre 2012, 16:53 PM
Al ejecutar este codigo me salta una excepción NullPointerException:

      for (int i = 0; i <= array1.length; i++) {
         array2 = array1;
      }

¿Por qué?