Advertisement
Guest User

Untitled

a guest
Jun 16th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.42 KB | None | 0 0
  1. 16:35:04,655 INFO [org.jboss.modules] (main) JBoss Modules version 1.4.3.Final
  2. 16:35:05,321 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
  3. 16:35:05,550 INFO [org.jboss.as] (MSC service thread 1-7) WFLYSRV0049: WildFly Full 9.0.2.Final (WildFly Core 1.0.2.Final) starting
  4. Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
  5. 16:35:07,362 INFO [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 26) WFLYCTL0028: Attribute 'enabled' in the resource at address '/subsystem=datasources/data-source=ExampleDS' is deprecated, and may be removed in future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
  6. 16:35:07,374 INFO [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 3) WFLYCTL0028: Attribute 'job-repository-type' in the resource at address '/subsystem=batch' is deprecated, and may be removed in future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
  7. 16:35:07,415 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
  8. 16:35:07,447 INFO [org.xnio] (MSC service thread 1-7) XNIO version 3.3.1.Final
  9. 16:35:07,464 INFO [org.xnio.nio] (MSC service thread 1-7) XNIO NIO Implementation Version 3.3.1.Final
  10. 16:35:07,539 INFO [org.jboss.remoting] (MSC service thread 1-7) JBoss Remoting version 4.0.9.Final
  11. 16:35:07,549 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 33) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
  12. 16:35:07,551 INFO [org.wildfly.extension.io] (ServerService Thread Pool -- 37) WFLYIO001: Worker 'default' has auto-configured to 8 core threads with 64 task threads based on your 4 available processors
  13. 16:35:07,554 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 38) WFLYCLINF0001: Activating Infinispan subsystem.
  14. 16:35:07,634 INFO [org.jboss.as.security] (ServerService Thread Pool -- 53) WFLYSEC0002: Activating Security Subsystem
  15. 16:35:07,635 WARN [org.jboss.as.txn] (ServerService Thread Pool -- 54) WFLYTX0013: Node identifier property is set to the default value. Please make sure it is unique.
  16. 16:35:07,657 INFO [org.jboss.as.security] (MSC service thread 1-4) WFLYSEC0001: Current PicketBox version=4.9.2.Final
  17. 16:35:07,668 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 56) WFLYWS0002: Activating WebServices Extension
  18. 16:35:07,675 INFO [org.jboss.as.jsf] (ServerService Thread Pool -- 44) WFLYJSF0007: Activated the following JSF Implementations: [main]
  19. 16:35:07,680 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 46) WFLYNAM0001: Activating Naming Subsystem
  20. 16:35:07,733 INFO [org.jboss.as.connector] (MSC service thread 1-5) WFLYJCA0009: Starting JCA Subsystem (IronJacamar 1.2.5.Final)
  21. 16:35:07,741 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 55) WFLYUT0003: Undertow 1.2.9.Final starting
  22. 16:35:07,741 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0003: Undertow 1.2.9.Final starting
  23. 16:35:07,762 INFO [org.jboss.as.naming] (MSC service thread 1-8) WFLYNAM0003: Starting Naming Service
  24. 16:35:07,776 INFO [org.jboss.as.mail.extension] (MSC service thread 1-2) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
  25. 16:35:07,800 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-8) WFLYJCA0018: Started Driver service with driver-name = h2
  26. 16:35:08,124 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 55) WFLYUT0014: Creating file handler for path /home/menas/WebDev/wildfly-9.0.2.Final/welcome-content
  27. 16:35:08,145 INFO [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0012: Started server default-server.
  28. 16:35:08,152 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0018: Host default-host starting
  29. 16:35:08,380 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0006: Undertow HTTP listener default listening on /127.0.0.1:8080
  30. 16:35:08,900 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-6) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
  31. 16:35:09,094 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) WFLYDS0013: Started FileSystemDeploymentService for directory /home/menas/WebDev/wildfly-9.0.2.Final/standalone/deployments
  32. 16:35:09,323 INFO [org.jboss.ws.common.management] (MSC service thread 1-7) JBWS022052: Starting JBoss Web Services - Stack CXF Server 5.0.0.Final
  33. 16:35:09,710 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
  34. 16:35:09,711 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
  35. 16:35:09,712 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 9.0.2.Final (WildFly Core 1.0.2.Final) started in 5707ms - Started 203 of 379 services (210 services are lazy, passive or on-demand)
  36. Connected to server
  37. [2016-06-16 04:35:10,321] Artifact testJPA:war exploded: Artifact is being deployed, please wait...
  38. 16:35:10,652 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of "testJPA" (runtime-name: "testJPA.war")
  39. 16:35:12,933 INFO [org.jboss.as.jpa] (MSC service thread 1-4) WFLYJPA0002: Read persistence.xml for jpaPU
  40. 16:35:13,177 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 58) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'testJPA#jpaPU'
  41. 16:35:13,212 INFO [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 58) HHH000204: Processing PersistenceUnitInfo [
  42. name: jpaPU
  43. ...]
  44. 16:35:13,266 INFO [org.jboss.weld.deployer] (MSC service thread 1-5) WFLYWELD0003: Processing weld deployment testJPA.war
  45. 16:35:13,322 INFO [org.hibernate.Version] (ServerService Thread Pool -- 58) HHH000412: Hibernate Core {4.3.10.Final}
  46. 16:35:13,324 INFO [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 58) HHH000206: hibernate.properties not found
  47. 16:35:13,326 INFO [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 58) HHH000021: Bytecode provider name : javassist
  48. 16:35:13,368 INFO [org.hibernate.validator.internal.util.Version] (MSC service thread 1-5) HV000001: Hibernate Validator 5.1.3.Final
  49. 16:35:13,506 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-5) JNDI bindings for session bean named PersonDAO in deployment unit deployment "testJPA.war" are as follows:
  50.  
  51. java:global/testJPA/PersonDAO!PersonDAO
  52. java:app/testJPA/PersonDAO!PersonDAO
  53. java:module/PersonDAO!PersonDAO
  54. java:global/testJPA/PersonDAO
  55. java:app/testJPA/PersonDAO
  56. java:module/PersonDAO
  57.  
  58. 16:35:14,157 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-6) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
  59. 16:35:14,158 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-6) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.fabric.jdbc.FabricMySQLDriver (version 5.1)
  60. 16:35:14,161 INFO [org.jboss.weld.deployer] (MSC service thread 1-6) WFLYWELD0006: Starting Services for CDI deployment: testJPA.war
  61. 16:35:14,203 INFO [org.jboss.weld.Version] (MSC service thread 1-6) WELD-000900: 2.2.16 (SP1)
  62. 16:35:14,240 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) WFLYJCA0018: Started Driver service with driver-name = testJPA.war_com.mysql.jdbc.Driver_5_1
  63. 16:35:14,240 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) WFLYJCA0018: Started Driver service with driver-name = testJPA.war_com.mysql.fabric.jdbc.FabricMySQLDriver_5_1
  64. 16:35:14,243 INFO [org.jboss.weld.deployer] (MSC service thread 1-4) WFLYWELD0009: Starting weld service for deployment testJPA.war
  65. 16:35:14,565 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 58) WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'testJPA#jpaPU'
  66. 16:35:14,652 INFO [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 58) HCANN000001: Hibernate Commons Annotations {4.0.5.Final}
  67. 16:35:14,904 INFO [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 58) HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
  68. 16:35:15,008 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (ServerService Thread Pool -- 58) HHH000397: Using ASTQueryTranslatorFactory
  69. 16:35:15,314 INFO [org.hibernate.tool.hbm2ddl.SchemaUpdate] (ServerService Thread Pool -- 58) HHH000228: Running hbm2ddl schema update
  70. 16:35:15,314 INFO [org.hibernate.tool.hbm2ddl.SchemaUpdate] (ServerService Thread Pool -- 58) HHH000102: Fetching database metadata
  71. 16:35:15,318 INFO [org.hibernate.tool.hbm2ddl.SchemaUpdate] (ServerService Thread Pool -- 58) HHH000396: Updating schema
  72. 16:35:15,325 INFO [java.sql.DatabaseMetaData] (ServerService Thread Pool -- 58) HHH000262: Table not found: Person
  73. 16:35:15,327 INFO [java.sql.DatabaseMetaData] (ServerService Thread Pool -- 58) HHH000262: Table not found: Person
  74. 16:35:15,329 INFO [java.sql.DatabaseMetaData] (ServerService Thread Pool -- 58) HHH000262: Table not found: Person
  75. 16:35:15,332 INFO [java.sql.DatabaseMetaData] (ServerService Thread Pool -- 58) HHH000262: Table not found: hibernate_sequence
  76. 16:35:15,335 INFO [org.hibernate.tool.hbm2ddl.SchemaUpdate] (ServerService Thread Pool -- 58) HHH000232: Schema update complete
  77. 16:35:16,298 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 17) Initializing Mojarra 2.2.12-jbossorg-2 20150729-1131 for context '/testJPA'
  78. 16:35:18,112 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 17) WFLYUT0021: Registered web context: /testJPA
  79. 16:35:18,183 INFO [org.jboss.as.server] (management-handler-thread - 2) WFLYSRV0010: Deployed "testJPA" (runtime-name : "testJPA.war")
  80. [2016-06-16 04:35:18,212] Artifact testJPA:war exploded: Artifact is deployed successfully
  81. [2016-06-16 04:35:18,212] Artifact testJPA:war exploded: Deploy took 7,891 milliseconds
  82. 16:35:29,534 WARNING [javax.enterprise.resource.webcontainer.jsf.lifecycle] (default task-5) #{registration.addPerson}: java.lang.NullPointerException: javax.faces.FacesException: #{registration.addPerson}: java.lang.NullPointerException
  83. at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
  84. at javax.faces.component.UICommand.broadcast(UICommand.java:315)
  85. at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
  86. at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
  87. at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
  88. at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
  89. at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
  90. at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)
  91. at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86)
  92. at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
  93. at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
  94. at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
  95. at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  96. at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
  97. at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
  98. at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  99. at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
  100. at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
  101. at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
  102. at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:72)
  103. at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
  104. at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
  105. at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  106. at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
  107. at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  108. at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  109. at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:282)
  110. at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:261)
  111. at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80)
  112. at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172)
  113. at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)
  114. at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)
  115. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  116. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  117. at java.lang.Thread.run(Thread.java:745)
  118. Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException
  119. at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101)
  120. at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
  121. ... 34 more
  122. Caused by: java.lang.NullPointerException
  123. at PersonDAO.addPerson(PersonDAO.java:18)
  124. at Registration.addPerson(Registration.java:21)
  125. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  126. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  127. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  128. at java.lang.reflect.Method.invoke(Method.java:498)
  129. at com.sun.el.parser.AstValue.invoke(AstValue.java:292)
  130. at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)
  131. at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
  132. at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
  133. at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
  134. at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
  135. at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
  136. at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
  137. ... 35 more
  138.  
  139. 16:35:29,539 ERROR [io.undertow.request] (default task-5) UT005023: Exception handling request to /testJPA/Login.xhtml: javax.servlet.ServletException: java.lang.NullPointerException
  140. at javax.faces.webapp.FacesServlet.service(FacesServlet.java:671)
  141. at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86)
  142. at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
  143. at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
  144. at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
  145. at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  146. at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
  147. at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
  148. at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  149. at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
  150. at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
  151. at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
  152. at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:72)
  153. at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
  154. at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
  155. at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  156. at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
  157. at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  158. at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  159. at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:282)
  160. at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:261)
  161. at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80)
  162. at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172)
  163. at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)
  164. at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)
  165. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  166. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  167. at java.lang.Thread.run(Thread.java:745)
  168. Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException
  169. at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101)
  170. at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
  171. at javax.faces.component.UICommand.broadcast(UICommand.java:315)
  172. at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
  173. at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
  174. at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
  175. at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
  176. at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
  177. at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)
  178. ... 27 more
  179. Caused by: java.lang.NullPointerException
  180. at PersonDAO.addPerson(PersonDAO.java:18)
  181. at Registration.addPerson(Registration.java:21)
  182. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  183. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  184. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  185. at java.lang.reflect.Method.invoke(Method.java:498)
  186. at com.sun.el.parser.AstValue.invoke(AstValue.java:292)
  187. at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)
  188. at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
  189. at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
  190. at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
  191. at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
  192. at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
  193. at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
  194. ... 35 more
  195.  
  196. @Entity
  197. @Table(name = "Person")
  198. public class Person implements Serializable{
  199.  
  200. private static final long serialVersionUID = 1L;
  201.  
  202. @Id
  203. @GeneratedValue
  204. @Column(name = "id")
  205. private int id;
  206.  
  207. @Column(name = "nom")
  208. private String nom;
  209.  
  210. @Column(name = "prenom")
  211. private String prenom;
  212.  
  213. public Person() {}
  214.  
  215. //setters and getters
  216.  
  217.  
  218. public int getId() {
  219. return id;
  220. }
  221.  
  222. public void setId(int id) {
  223. this.id = id;
  224. }
  225.  
  226. public String getNom() {
  227. return nom;
  228. }
  229.  
  230. public void setNom(String nom) {
  231. this.nom = nom;
  232. }
  233.  
  234. public String getPrenom() {
  235. return prenom;
  236. }
  237.  
  238. public void setPrenom(String prenom) {
  239. this.prenom = prenom;
  240. }
  241. }
  242.  
  243. @Stateless
  244. public class PersonDAO {
  245.  
  246. @PersistenceContext(unitName = "jpaPU")
  247. private EntityManager em;
  248.  
  249. public void addPerson(Person person) {
  250.  
  251. em.persist(person);
  252. }
  253. }
  254.  
  255. @ManagedBean(name="registration", eager = true)
  256. @SessionScoped
  257.  
  258. public class Registration {
  259.  
  260. private Person person;
  261. private PersonDAO mm;
  262.  
  263. @PostConstruct
  264. public void init() {
  265. person = new Person();
  266. mm = new PersonDAO();
  267. }
  268.  
  269. public String addPerson() {
  270. mm.addPerson(person);
  271. return "Login";
  272. }
  273.  
  274. public Person getPerson() {
  275. return person;
  276. }
  277.  
  278. public void setPerson(Person person) {
  279. this.person = person;
  280. }
  281.  
  282. public PersonDAO getMm() {
  283. return mm;
  284. }
  285.  
  286. public void setMm(PersonDAO mm) {
  287. this.mm = mm;
  288. }
  289. }
  290.  
  291. <!DOCTYPE html>
  292. <html xmlns="http://www.w3.org/1999/xhtml"
  293. xmlns:h="http://java.sun.com/jsf/html">
  294. <h:head>
  295. <title>Registration</title>
  296. </h:head>
  297. <h:body>
  298. <h1>Registration</h1>
  299. <h:form>
  300. <h:message for="loginPanel" style="color:red;" />
  301. <h:panelGrid columns="2" id="loginPanel">
  302. Nom :
  303. <h:inputText id="nom" value="#{registration.person.nom}" />
  304. Prenom :
  305. <h:inputSecret id="prenom" value="#{registration.person.prenom}" />
  306. </h:panelGrid>
  307. <h:commandButton value="Submit" action="#{registration.addPerson}">
  308. </h:commandButton>
  309.  
  310. </h:form>
  311. </h:body>
  312. </html>
  313.  
  314. <?xml version="1.0" encoding="UTF-8"?>
  315. <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"
  316. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  317. xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
  318. http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
  319. <persistence-unit name="jpaPU" transaction-type="JTA">
  320. <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
  321. <class>Person</class>
  322. <properties>
  323. <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
  324. <property name="hibernate.hbm2ddl.auto" value="update"/>
  325. <!--<property name="javax.persistence.schema-generation.database.action" value="create"/>-->
  326. <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
  327. <property name="hibernate.connection.username" value="root"/>
  328. <property name="hibernate.connection.password" value="root"/>
  329. <property name="hibernate.connection.url" value="jdbc:mysql://localhost/testJPA"/>
  330. </properties>
  331. </persistence-unit>
  332. </persistence>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement