elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Rompecabezas de Bitcoin, Medio millón USD en premios


  Mostrar Mensajes
Páginas: [1] 2 3
1  Programación / Bases de Datos / Error al intentar especificar el JDBC con tomee y JTA en: 25 Mayo 2015, 00:07 am
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  Programación / Desarrollo Web / Termometro en JSF en: 15 Diciembre 2014, 13:43 pm
¿Conocéis algún termómetro que pueda funcionar en JSF?
3  Programación / Desarrollo Web / Excepción con TomEE en: 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  Programación / Desarrollo Web / Excepción con TomEE en: 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
  1. java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/MyProject]]
  2. at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
  3. at java.util.concurrent.FutureTask.get(Unknown Source)
  4. at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
  5. at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:816)
  6. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  7. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
  8. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
  9. at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
  10. at java.util.concurrent.FutureTask.run(Unknown Source)
  11. at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
  12. at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  13. at java.lang.Thread.run(Unknown Source)
  14. Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/MyProject]]
  15. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
  16. ... 7 more
  17. 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]
  18. at org.apache.tomee.catalina.TomcatWebAppBuilder.loadApplication(TomcatWebAppBuilder.java:2150)
  19. at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1134)
  20. at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1087)
  21. at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:130)
  22. at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
  23. at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
  24. at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5378)
  25. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  26. ... 7 more
  27. 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]
  28. at org.apache.openejb.config.ReadDescriptors.readFacesConfig(ReadDescriptors.java:831)
  29. at org.apache.openejb.config.DeploymentLoader.addFacesConfigs(DeploymentLoader.java:1396)
  30. at org.apache.openejb.config.DeploymentLoader.createWebModule(DeploymentLoader.java:1044)
  31. at org.apache.openejb.config.DeploymentLoader.createWebModule(DeploymentLoader.java:779)
  32. at org.apache.openejb.config.DeploymentLoader.load(DeploymentLoader.java:213)
  33. at org.apache.tomee.catalina.TomcatWebAppBuilder.loadApplication(TomcatWebAppBuilder.java:2148)
  34. ... 14 more
  35. 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]
  36. at org.metatype.sxc.jaxb.RuntimeContext.validationError(RuntimeContext.java:390)
  37. at org.metatype.sxc.jaxb.RuntimeContext.validationError(RuntimeContext.java:379)
  38. at org.metatype.sxc.jaxb.RuntimeContext.unexpectedElement(RuntimeContext.java:225)
  39. at org.apache.openejb.jee.FacesConfig$JAXB._read(FacesConfig$JAXB.java:343)
  40. at org.apache.openejb.jee.FacesConfig$JAXB.read(FacesConfig$JAXB.java:399)
  41. at org.apache.openejb.jee.FacesConfig$JAXB.read(FacesConfig$JAXB.java:61)
  42. at org.apache.openejb.sxc.Sxc.unmarshall(Sxc.java:167)
  43. at org.apache.openejb.sxc.Sxc.unmarhsal(Sxc.java:158)
  44. at org.apache.openejb.sxc.Sxc.unmarshalJavaee(Sxc.java:143)
  45. at org.apache.openejb.sxc.FacesConfigXml.unmarshal(FacesConfigXml.java:34)
  46. at org.apache.openejb.config.ReadDescriptors.readFacesConfig(ReadDescriptors.java:827)
  47. ... 19 more
  48. Dec 5, 2014 2:42:38 PM org.apache.catalina.core.ContainerBase startInternal
  49. SEVERE: A child container failed during start
  50. java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
  51. at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
  52. at java.util.concurrent.FutureTask.get(Unknown Source)
  53. at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
  54. at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
  55. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  56. at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
  57. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  58. at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:739)
  59. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  60. at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
  61. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  62. at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  63. at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  64. at java.lang.reflect.Method.invoke(Unknown Source)
  65. at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
  66. at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
  67. Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
  68. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
  69. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
  70. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
  71. at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
  72. at java.util.concurrent.FutureTask.run(Unknown Source)
  73. at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
  74. at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  75. at java.lang.Thread.run(Unknown Source)
  76. Caused by: org.apache.catalina.LifecycleException: A child container failed during start
  77. at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
  78. at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:816)
  79. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  80. ... 7 more
  81. Dec 5, 2014 2:42:38 PM org.apache.catalina.startup.Catalina start
  82. SEVERE: The required Server component failed to start so Tomcat is unable to start.
  83. org.apache.catalina.LifecycleException: Failed to start component [StandardServer[9005]]
  84. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
  85. at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
  86. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  87. at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  88. at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  89. at java.lang.reflect.Method.invoke(Unknown Source)
  90. at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
  91. at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
  92. Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
  93. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
  94. at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:739)
  95. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  96. ... 7 more
  97. Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
  98. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
  99. at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
  100. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  101. ... 9 more
  102. Caused by: org.apache.catalina.LifecycleException: A child container failed during start
  103. at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
  104. at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
  105. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  106. ... 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
  1. java.lang.IncompatibleClassChangeError: class org.apache.bcel.util.ClassPath$2 has interface org.apache.bcel.util.ClassPath$ClassFile as super class
  2. at java.lang.ClassLoader.defineClass1(Native Method)
  3. at java.lang.ClassLoader.defineClassCond(Unknown Source)
  4. at java.lang.ClassLoader.defineClass(Unknown Source)
  5. at java.security.SecureClassLoader.defineClass(Unknown Source)
  6. at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
  7. at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1148)
  8. at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1643)
  9. at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
  10. at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:1956)
  11. at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1919)
  12. at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1806)
  13. at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1765)
  14. at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1751)
  15. at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1255)
  16. at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:882)
  17. at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:317)
  18. at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
  19. at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
  20. at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5081)
  21. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
  22. at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
  23. at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
  24. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
  25. at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
  26. at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
  27. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
  28. at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
  29. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
  30. at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
  31. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
  32. at org.apache.catalina.startup.Catalina.start(Catalina.java:620)
  33. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  34. at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  35. at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  36. at java.lang.reflect.Method.invoke(Unknown Source)
  37. at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303)
  38. 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  Programación / Java / Re: Drag and Drop API en: 11 Septiembre 2012, 11:48 am
Gracias, es verdad, sólo es necesario el import:
import java.awt.dnd.*;
6  Programación / Java / Drag and Drop API en: 10 Septiembre 2012, 17:19 pm
¿De dónde me puedo descargar la API de Java llamada Drag and Drop?
7  Programación / Java / Re: Ejecutar un comando en java en: 10 Septiembre 2012, 17:17 pm
Muchas gracias
8  Programación / Java / Ejecutar un comando en java en: 9 Septiembre 2012, 16:58 pm
Dentro de un programa en java, ¿cómo podría ejecutar un comando, por ejemplo reset?
9  Programación / Java / Re: Exception NullPointerException en: 9 Septiembre 2012, 16:57 pm
Tienes razón, tendría que instanciarlo antes.
Lo que quería hacer array1=array2.

Muchas gracias.
10  Programación / Java / Exception NullPointerException en: 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é?
Páginas: [1] 2 3
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines