title: Tomee error: javax.persistence.JoinColumn.foreignKey()
body: <p>I was building my first webapp. I am using hibernate, postgresql, and tomee as container. I am using beans and faces. When i try to run my webapp on my tomee localhost everything works as expected. When i load it on my AWS (wich has the same version of tomee installed) i get this error. I'm stick since hours without getting at the solution. 
  Here is my catalina.out</p>
  
  <pre><code>May 26, 2016 4:18:24 AM org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation
  INFO: HHH000204: Processing PersistenceUnitInfo [
          name: clinica-unit
          ...]
  May 26, 2016 4:18:24 AM org.hibernate.Version logVersion
  INFO: HHH000412: Hibernate Core {5.1.0.Final}
  May 26, 2016 4:18:24 AM org.hibernate.cfg.Environment &lt;clinit&gt;
  INFO: HHH000206: hibernate.properties not found
  May 26, 2016 4:18:24 AM org.hibernate.cfg.Environment buildBytecodeProvider
  INFO: HHH000021: Bytecode provider name : javassist
  May 26, 2016 4:18:24 AM org.hibernate.annotations.common.reflection.java.JavaReflectionManager &lt;clinit&gt;
  INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
  May 26, 2016 4:18:25 AM org.hibernate.dialect.Dialect &lt;init&gt;
  INFO: HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL94Dialect
  May 26, 2016 4:18:25 AM org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl useContextualLobCreation
  INFO: HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
  May 26, 2016 4:18:25 AM org.hibernate.type.BasicTypeRegistry register
  INFO: HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType@66b53b0d
  May 26, 2016 4:18:26 AM org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory createDelegate
  INFO: PersistenceUnit(name=clinica-unit, provider=org.hibernate.ejb.HibernatePersistence) - provider time 1747ms
  May 26, 2016 4:18:26 AM org.apache.openejb.assembler.classic.Assembler destroyApplication
  INFO: Undeploying app: /usr/share/apache-tomee-webprofile-1.7.4/webapps/PortaleClinica
  May 26, 2016 4:18:26 AM org.apache.catalina.core.ContainerBase removeChild
  SEVERE: ContainerBase.removeChild: destroy:
  org.apache.catalina.LifecycleException: An invalid Lifecycle transition was attempted ([before_destroy]) for component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/PortaleClinica]] in state [STARTING_PREP]
          at org.apache.catalina.util.LifecycleBase.invalidTransition(LifecycleBase.java:401)
          at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:291)
          at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1038)
          at org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1537)
          at org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1518)
          at org.apache.tomee.catalina.TomcatWebAppBuilder.undeployWebApps(TomcatWebAppBuilder.java:762)
          at org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:1982)
          at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:839)
          at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:677)
          at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1261)
          at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1100)
          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:5472)
          at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
          at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
          at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1091)
          at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1980)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
          at java.util.concurrent.FutureTask.run(FutureTask.java:262)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:745)
  
  May 26, 2016 4:18:26 AM org.apache.openejb.assembler.classic.Assembler destroyResource
  INFO: Closing DataSource: PortaleClinica/clinica-unit-db
  May 26, 2016 4:18:26 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
  SEVERE: The web application [/PortaleClinica] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
  May 26, 2016 4:18:26 AM org.apache.tomee.catalina.TomcatWebAppBuilder startInternal
  SEVERE: Unable to deploy collapsed ear in war StandardEngine[Catalina].StandardHost[localhost].StandardContext[/PortaleClinica]
  org.apache.openejb.OpenEJBException: Creating application failed: /usr/share/apache-tomee-webprofile-1.7.4/webapps/PortaleClinica: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
          at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:843)
          at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:677)
          at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1261)
          at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1100)
          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:5472)
          at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
          at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
          at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1091)
          at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1980)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
          at java.util.concurrent.FutureTask.run(FutureTask.java:262)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:745)
  Caused by: java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
          at org.hibernate.cfg.AnnotationBinder.bindManyToOne(AnnotationBinder.java:2898)
          at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1742)
          at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:906)
          at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:733)
          at org.hibernate.boot.model.source.internal.annotations.AnnotationMetadataSourceProcessorImpl.processEntityHierarchies(AnnotationMetadataSourceProcessorImpl.java:245)
          at org.hibernate.boot.model.process.spi.MetadataBuildingProcess$1.processEntityHierarchies(MetadataBuildingProcess.java:222)
          at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:265)
          at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:848)
          at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:876)
          at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:135)
          at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:50)
          at org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:64)
          at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:116)
          at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.&lt;init&gt;(ReloadableEntityManagerFactory.java:102)
          at org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:154)
          at org.apache.openejb.assembler.classic.Assembler.loadPersistenceUnits(Assembler.java:982)
          at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:741)
          ... 18 more
  
  May 26, 2016 4:18:26 AM org.apache.catalina.core.ContainerBase addChildInternal
  SEVERE: ContainerBase.addChild: start:
  org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/PortaleClinica]]
          at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
          at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
          at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1091)
          at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1980)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
          at java.util.concurrent.FutureTask.run(FutureTask.java:262)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:745)
  Caused by: org.apache.tomee.catalina.TomEERuntimeException: org.apache.openejb.OpenEJBException: Creating application failed: /usr/share/apache-tomee-webprofile-1.7.4/webapps/PortaleClinica: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
          at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1270)
          at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1100)
          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:5472)
          at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
          ... 10 more
  Caused by: org.apache.openejb.OpenEJBException: Creating application failed: /usr/share/apache-tomee-webprofile-1.7.4/webapps/PortaleClinica: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
          at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:843)
          at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:677)
          at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1261)
          ... 16 more
  Caused by: java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
          at org.hibernate.cfg.AnnotationBinder.bindManyToOne(AnnotationBinder.java:2898)
          at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1742)
          at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:906)
          at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:733)
          at org.hibernate.boot.model.source.internal.annotations.AnnotationMetadataSourceProcessorImpl.processEntityHierarchies(AnnotationMetadataSourceProcessorImpl.java:245)
          at org.hibernate.boot.model.process.spi.MetadataBuildingProcess$1.processEntityHierarchies(MetadataBuildingProcess.java:222)
          at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:265)
          at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:848)
          at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:876)
          at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:135)
          at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:50)
          at org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:64)
          at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:116)
          at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.&lt;init&gt;(ReloadableEntityManagerFactory.java:102)
          at org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:154)
          at org.apache.openejb.assembler.classic.Assembler.loadPersistenceUnits(Assembler.java:982)
          at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:741)
          ... 18 more
  
  May 26, 2016 4:18:26 AM org.apache.catalina.startup.HostConfig deployWAR
  SEVERE: Error deploying web application archive /usr/share/apache-tomee-webprofile-1.7.4/webapps/PortaleClinica.war
  java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/PortaleClinica]]
          at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:903)
          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
          at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1091)
          at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1980)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
          at java.util.concurrent.FutureTask.run(FutureTask.java:262)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:745)
  
  May 26, 2016 4:18:26 AM org.apache.catalina.startup.HostConfig deployWAR
  INFO: Deployment of web application archive /usr/share/apache-tomee-webprofile-1.7.4/webapps/PortaleClinica.war has finished in 3,950 ms
  May 26, 2016 4:18:26 AM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory /usr/share/apache-tomee-webprofile-1.7.4/webapps/manager
  May 26, 2016 4:18:26 AM org.apache.tomee.catalina.TomcatWebAppBuilder init
  INFO: ------------------------- localhost -&gt; /manager
  May 26, 2016 4:18:26 AM org.apache.openejb.config.ConfigurationFactory configureApplication
  INFO: Configuring enterprise application: /usr/share/apache-tomee-webprofile-1.7.4/webapps/manager
  May 26, 2016 4:18:26 AM org.apache.openejb.config.AppInfoBuilder build
  INFO: Enterprise application "/usr/share/apache-tomee-webprofile-1.7.4/webapps/manager" loaded.
  May 26, 2016 4:18:26 AM org.apache.openejb.assembler.classic.Assembler createApplication
  INFO: Assembling app: /usr/share/apache-tomee-webprofile-1.7.4/webapps/manager
  May 26, 2016 4:18:26 AM org.apache.openejb.cdi.CdiBuilder initSingleton
  INFO: Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@53743c4f
  May 26, 2016 4:18:26 AM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
  INFO: OpenWebBeans Container is starting...
  May 26, 2016 4:18:26 AM org.apache.webbeans.plugins.PluginLoader startUp
  INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
  May 26, 2016 4:18:26 AM org.apache.webbeans.plugins.PluginLoader startUp
  INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
  May 26, 2016 4:18:26 AM org.apache.webbeans.config.BeansDeployer validateInjectionPoints
  INFO: All injection points were validated successfully.
  May 26, 2016 4:18:26 AM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
  INFO: OpenWebBeans Container has started, it took 127 ms.
  May 26, 2016 4:18:26 AM org.apache.tomee.catalina.TomcatWebAppBuilder deployWebApps
  INFO: using context file /usr/share/apache-tomee-webprofile-1.7.4/webapps/manager/META-INF/context.xml
  May 26, 2016 4:18:26 AM org.apache.openejb.assembler.classic.Assembler createApplication
  INFO: Deployed Application(path=/usr/share/apache-tomee-webprofile-1.7.4/webapps/manager)
  May 26, 2016 4:18:27 AM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deployment of web application directory /usr/share/apache-tomee-webprofile-1.7.4/webapps/manager has finished in 706 ms
  May 26, 2016 4:18:27 AM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory /usr/share/apache-tomee-webprofile-1.7.4/webapps/ROOT
  May 26, 2016 4:18:27 AM org.apache.tomee.catalina.TomcatWebAppBuilder init
  INFO: ------------------------- localhost -&gt; /
  May 26, 2016 4:18:27 AM org.apache.openejb.config.ConfigurationFactory configureApplication
  INFO: Configuring enterprise application: /usr/share/apache-tomee-webprofile-1.7.4/webapps/ROOT
  May 26, 2016 4:18:27 AM org.apache.openejb.config.AppInfoBuilder build
  INFO: Enterprise application "/usr/share/apache-tomee-webprofile-1.7.4/webapps/ROOT" loaded.
  May 26, 2016 4:18:27 AM org.apache.openejb.assembler.classic.Assembler createApplication
  INFO: Assembling app: /usr/share/apache-tomee-webprofile-1.7.4/webapps/ROOT
  May 26, 2016 4:18:27 AM org.apache.openejb.cdi.CdiBuilder initSingleton
  INFO: Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@53743c4f
  May 26, 2016 4:18:27 AM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
  INFO: OpenWebBeans Container is starting...
  May 26, 2016 4:18:27 AM org.apache.webbeans.plugins.PluginLoader startUp
  INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
  May 26, 2016 4:18:27 AM org.apache.webbeans.plugins.PluginLoader startUp
  INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
  May 26, 2016 4:18:27 AM org.apache.webbeans.config.BeansDeployer validateInjectionPoints
  INFO: All injection points were validated successfully.
  May 26, 2016 4:18:27 AM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
  INFO: OpenWebBeans Container has started, it took 12 ms.
  May 26, 2016 4:18:27 AM org.apache.openejb.assembler.classic.Assembler createApplication
  INFO: Deployed Application(path=/usr/share/apache-tomee-webprofile-1.7.4/webapps/ROOT)
  May 26, 2016 4:18:27 AM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deployment of web application directory /usr/share/apache-tomee-webprofile-1.7.4/webapps/ROOT has finished in 127 ms
  May 26, 2016 4:18:27 AM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory /usr/share/apache-tomee-webprofile-1.7.4/webapps/docs
  May 26, 2016 4:18:27 AM org.apache.tomee.catalina.TomcatWebAppBuilder init
  INFO: ------------------------- localhost -&gt; /docs
  May 26, 2016 4:18:27 AM org.apache.openejb.config.ConfigurationFactory configureApplication
  INFO: Configuring enterprise application: /usr/share/apache-tomee-webprofile-1.7.4/webapps/docs
  May 26, 2016 4:18:27 AM org.apache.openejb.config.AppInfoBuilder build
  INFO: Enterprise application "/usr/share/apache-tomee-webprofile-1.7.4/webapps/docs" loaded.
  May 26, 2016 4:18:27 AM org.apache.openejb.assembler.classic.Assembler createApplication
  INFO: Assembling app: /usr/share/apache-tomee-webprofile-1.7.4/webapps/docs
  May 26, 2016 4:18:27 AM org.apache.openejb.cdi.CdiBuilder initSingleton
  INFO: Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@53743c4f
  May 26, 2016 4:18:27 AM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
  INFO: OpenWebBeans Container is starting...
  May 26, 2016 4:18:27 AM org.apache.webbeans.plugins.PluginLoader startUp
  INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
  May 26, 2016 4:18:27 AM org.apache.webbeans.plugins.PluginLoader startUp
  INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
  May 26, 2016 4:18:27 AM org.apache.webbeans.config.BeansDeployer validateInjectionPoints
  INFO: All injection points were validated successfully.
  May 26, 2016 4:18:27 AM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
  INFO: OpenWebBeans Container has started, it took 7 ms.
  May 26, 2016 4:18:27 AM org.apache.openejb.assembler.classic.Assembler createApplication
  INFO: Deployed Application(path=/usr/share/apache-tomee-webprofile-1.7.4/webapps/docs)
  May 26, 2016 4:18:27 AM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deployment of web application directory /usr/share/apache-tomee-webprofile-1.7.4/webapps/docs has finished in 125 ms
  May 26, 2016 4:18:27 AM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory /usr/share/apache-tomee-webprofile-1.7.4/webapps/host-manager
  May 26, 2016 4:18:27 AM org.apache.tomee.catalina.TomcatWebAppBuilder init
  INFO: ------------------------- localhost -&gt; /host-manager
  May 26, 2016 4:18:27 AM org.apache.openejb.config.ConfigurationFactory configureApplication
  INFO: Configuring enterprise application: /usr/share/apache-tomee-webprofile-1.7.4/webapps/host-manager
  May 26, 2016 4:18:27 AM org.apache.openejb.config.AppInfoBuilder build
  INFO: Enterprise application "/usr/share/apache-tomee-webprofile-1.7.4/webapps/host-manager" loaded.
  May 26, 2016 4:18:27 AM org.apache.openejb.assembler.classic.Assembler createApplication
  INFO: Assembling app: /usr/share/apache-tomee-webprofile-1.7.4/webapps/host-manager
  May 26, 2016 4:18:27 AM org.apache.openejb.cdi.CdiBuilder initSingleton
  INFO: Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@53743c4f
  May 26, 2016 4:18:27 AM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
  INFO: OpenWebBeans Container is starting...
  May 26, 2016 4:18:27 AM org.apache.webbeans.plugins.PluginLoader startUp
  INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
  May 26, 2016 4:18:27 AM org.apache.webbeans.plugins.PluginLoader startUp
  INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
  May 26, 2016 4:18:27 AM org.apache.webbeans.config.BeansDeployer validateInjectionPoints
  INFO: All injection points were validated successfully.
  May 26, 2016 4:18:27 AM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
  INFO: OpenWebBeans Container has started, it took 8 ms.
  May 26, 2016 4:18:27 AM org.apache.tomee.catalina.TomcatWebAppBuilder deployWebApps
  INFO: using context file /usr/share/apache-tomee-webprofile-1.7.4/webapps/host-manager/META-INF/context.xml
  May 26, 2016 4:18:27 AM org.apache.openejb.assembler.classic.Assembler createApplication
  INFO: Deployed Application(path=/usr/share/apache-tomee-webprofile-1.7.4/webapps/host-manager)
  May 26, 2016 4:18:27 AM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deployment of web application directory /usr/share/apache-tomee-webprofile-1.7.4/webapps/host-manager has finished in 120 ms
  May 26, 2016 4:18:27 AM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["http-bio-8080"]
  May 26, 2016 4:18:27 AM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["ajp-bio-8009"]
  May 26, 2016 4:18:27 AM org.apache.catalina.startup.Catalina start
  INFO: Server startup in 5129 ms
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"&gt;
    &lt;display-name&gt;PortaleClinica&lt;/display-name&gt;
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
  
    &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.DEFAULT_SUFFIX&lt;/param-name&gt;
          &lt;param-value&gt;.xhtml&lt;/param-value&gt;
    &lt;/context-param&gt;
  
    &lt;!-- Facelets pages will use the .xhtml extension --&gt;
  
    &lt;servlet&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;
  
     &lt;filter&gt;
      &lt;filter-name&gt;AuthFilter&lt;/filter-name&gt; &lt;!-- mandatory --&gt;
      &lt;filter-class&gt;it.uniroma3.servlet.AuthFilterServlet&lt;/filter-class&gt; &lt;!-- mandatory --&gt;
    &lt;/filter&gt;
  
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.html&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  
     &lt;filter-mapping&gt;
          &lt;filter-name&gt;AuthFilter&lt;/filter-name&gt;
          &lt;url-pattern&gt;/amministrazione/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;AuthFilter&lt;/filter-name&gt;
          &lt;url-pattern&gt;/utente/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>resources.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;resources&gt;
      &lt;Resource id="clinica-unit-db" type="DataSource"&gt;
          #  PostgreSQL example
          #
          #  This connector will not work until you download the driver at:
          #  http://jdbc.postgresql.org/download.html
          JdbcDriver   org.postgresql.Driver
          JdbcUrl  jdbc:postgresql://localhost/clinica
          UserName     postgres
          Password     postgres
      &lt;/Resource&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>persistence.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.0"
      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_0.xsd"&gt;
      &lt;persistence-unit name="clinica-unit" transaction-type="JTA"&gt;
      &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
      &lt;jta-data-source&gt;clinica-unit-db&lt;/jta-data-source&gt;
          &lt;class&gt;it.uniroma3.db.Medico&lt;/class&gt;
          &lt;class&gt;it.uniroma3.db.Utente&lt;/class&gt;
          &lt;class&gt;it.uniroma3.db.TipologiaEsame&lt;/class&gt;
          &lt;class&gt;it.uniroma3.db.Esame&lt;/class&gt;
      &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>faces-config.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;faces-config xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd"
      version="2.1"&gt;
  &lt;/faces-config&gt;
  </code></pre>
  
  <p>This Java EE is really annoying me.</p>