Seed data import failed on jboss-javaee6-webapp - java

I am trying to get a basic Seam 3 webapplication to work and use the jboss-javaee6-webapp to achieve this goal. Using the manual at http://seamframework.org/Documentation/CDIQuickstartForMavenUsers.
However, I am running into some problems which I haven't been able to solve for days. I have basically no experience in JavaEE so the solution is probably really easy.
What I've done? I've simply generated a new maven project based on the supplied archetype and didn't change anything about it. I've installed Eclipse Helios including JBoss Tools and downloaded JBoss 6.0.0 and got Eclipse to deploy the application to the server succesfully.
While deploying, an exception occurs in the example code. To be specific the following exceptions occurs:
09:29:20,712 WARN [seam3-example] Seed data import failed.: java.lang.NullPointerException
at org.jboss.weld.integration.persistence.JBossJpaServices.resolvePersistenceContext(JBossJpaServices.java:59) [:6.0.0.Final]
at org.jboss.weld.util.Beans.injectEEFields(Beans.java:781) [:6.0.0.Final]
at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed(ManagedBean.java:181) [:6.0.0.Final]
at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:54) [:6.0.0.Final]
at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1.work(ManagedBean.java:176) [:6.0.0.Final]
at org.jboss.weld.bean.ManagedBean$FixInjectionPoint.run(ManagedBean.java:142) [:6.0.0.Final]
at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.inject(ManagedBean.java:170) [:6.0.0.Final]
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:339) [:6.0.0.Final]
at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:67) [:6.0.0.Final]
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:669) [:6.0.0.Final]
at org.jboss.weld.bean.AbstractReceiverBean.getReceiver(AbstractReceiverBean.java:84) [:6.0.0.Final]
at org.jboss.weld.bean.ProducerField$1.produce(ProducerField.java:134) [:6.0.0.Final]
at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:361) [:6.0.0.Final]
at org.jboss.weld.bean.builtin.ee.EEResourceProducerField.createUnderlying(EEResourceProducerField.java:170) [:6.0.0.Final]
at org.jboss.weld.bean.builtin.ee.EEResourceProducerField.access$000(EEResourceProducerField.java:54) [:6.0.0.Final]
at org.jboss.weld.bean.builtin.ee.EEResourceProducerField$EEResourceCallable.call(EEResourceProducerField.java:80) [:6.0.0.Final]
at org.jboss.weld.bean.builtin.CallableMethodHandler.invoke(CallableMethodHandler.java:50) [:6.0.0.Final]
at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:62) [:6.0.0.Final]
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125) [:6.0.0.Final]
at org.jboss.weldx.persistence.org$jboss$weld$bean-jboss$classloader:id="vfs:$$$Users$sander$Workspaces$eclipse$web-dev-32$$metadata$$plugins$org$jboss$ide$eclipse$as$core$JBoss_6$0_Runtime_Server1306911969901$deploy$seam3-example$war"-ProducerField-nl$jdi$examples$data$MemberRepositoryProducer$em_$$_WeldProxy.persist(org$jboss$weld$bean-jboss$classloader:id="vfs:$$$Users$sander$Workspaces$eclipse$web-dev-32$$metadata$$plugins$org$jboss$ide$eclipse$as$core$JBoss_6$0_Runtime_Server1306911969901$deploy$seam3-example$war"-ProducerField-nl$jdi$examples$data$MemberRepositoryProducer$em_$$_WeldProxy.java)
at nl.jdi.examples.data.SeedDataImporter.importData(SeedDataImporter.java:51) [:]
...
I've searched for a solution for this exact exception but I could barely find anything about it. This probably means that I've overlooked something very simple. So I've analysed the exception and found the following:
The exception message is from the example code (SeedDataImporter.java:61)
The exception itself (NullPointer) is thrown somewhere in the weld code
The problem seems to be purely persistence related (it can't find the PersistenceContext?)
Since the problem is persistence related, I've tried to change the persistence.xml however this didn't pay out. I think the problem is within the JDNI/Persistence.xml/Server config domain, however I can't be sure.
Can anybody point me in the right direction?
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<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">
<persistence-unit name="primary">
<jta-data-source>jdbc/__default</jta-data-source>
<properties>
<!-- Properties for Hibernate (default provider for JBoss AS) -->
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="false" />
<!-- Properties for EclipseLink (default provider for GlassFish) -->
<property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
<property name="eclipselink.logging.level" value="FINE" />
</properties>
</persistence-unit>
Edit:
When I try to deploy the unchanged application to GlassFish 3.1 within Eclipse I get the following error:
cannot Deploy seam3-example
Deployment Error for module: seam3-example: Error occurred during deployment: Exception while loading the app : javax.ejb.CreateException: Initialization failed for Singleton SeedDataImporter. Please see server.log for more details.
Cannot create tables for application seam3-example. The expected DDL file seam3-example_primary_createDDL.jdbc is not available.
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused.

I think it is a persistance.xml problem because you have:
<jta-data-source>jdbc/__default</jta-data-source>
and this is default for Glassfish AS
Try this:
<jta-data-source>java:/DefaultDS</jta-data-source>
This is default for JBoss
Do you run JBoss AS in default domain?

If you check the persistence.xml file generated by the archetype, you'll see this comment:
<!-- A matching data source is added to JBoss AS by deploying the project file default-ds.xml -->
<jta-data-source>jdbc/__default</jta-data-source>
Inside resources-jbossas there's a default-ds.xml file that you should deploy to JBoss in order to be able to use the app without any code changes.

At least on the command line I can start the example doing this:
Download and install the latest jboss 6 to
mvn archetype:generate -DarchetypeArtifactId=jboss-javaee6-webapp -DarchetypeGroupId=org.jboss.weld.archetypes -DarchetypeVersion=1.0.1.CR1 -DarchetypeRepository=central -DgroupId=com.example -DartifactId=jee-example -Dversion=0.0.1-SNAPSHOT
cd jee-example
mvn clean package jboss:hard-deploy -Djboss.home=<jboss-6.0.0.Final>
start the jboss with <jboss-6.0.0.Final>/bin/run.sh (run.bat on Windws)
open http://localhost:8080/jee-example/
For more details have a look at the readme.html that is created by the archtype in the same folder as the pom.xml
To work in eclipse you should install
eclipse for Java EE Developers
m2eclipse from this update site
m2eclipse wtp extension from the m2eclipse-extra update site documentation
I did not try the eclipse part for the archetype...

Related

Register additional persistence unit in Keycloak Quarkus

We have a custom keyloak user storage provide to use our proprietary user database for authentication.
This works perfectly fine with the WildFly based Keycloak. Since Keycloak will drop WildFly support in june 2022 according to their release notes, I am currently trying to get it running in the new, Quarkus based Keycloak distribution.
First I had to remove all dependencies provided by Quarkus since those lead to class loader issues. But now I am stuck with this error when I try to start Keycloak with the command ./kc.sh start-dev --log-level=ERROR:
Updating the configuration and installing your custom providers, if any. Please wait.
ERROR: Unexpected error when starting the server in (development) mode
ERROR: Failed to start quarkus
ERROR: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
ERROR: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
For more details run the same command passing the '--verbose' option. Also you can use '--help' to see the details about the usage of the particular command.
And 'hibernate.dialect' is set in persistence.xml and configuring a persistance unit in persistence.xml should be supported according to quarkus documentation :
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
version="2.1">
<persistence-unit name="example-pu" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>com.example.keycloak.provider.db.entity.Benutzer</class>
<class>com.example.keycloak.provider.db.entity.BenutzerWithSource</class>
<class>com.example.keycloak.provider.db.entity.Rolle</class>
<class>com.example.keycloak.provider.db.entity.Parameter</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
</properties>
</persistence-unit>
</persistence>
Configuring the dialect in an application.properties (according to https://quarkus.io/guides/hibernate-orm#multiple-persistence-units) file in the delivery didn't change the behavior as well:
quarkus.hibernate-orm."example-pu".hibernate-dialect=org.hibernate.dialect.OracleDialect
What am I missing?
Additional Persistence Units are not supported in Keycloak 17.0.0 with Quarkus.
This should be fixed in Keycloak 18.0.0: https://github.com/keycloak/keycloak/pull/10581.

How to handle 'IllegalBlockSizeException' when creating EntityManager with EclipseLink version 2.6.4?

I'm using EclipseLink and Java Persistence API to connect to local database, however when I'm creating EntityManager object, I'm getting following error:
[EL Severe]: ejb: 2017-06-04 19:29:55.066--ServerSession(1644987969)--Exception [EclipseLink-7107] (Eclipse Persistence Services - 2.6.4.v20160829-44060b6): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Error encountered during string decryption.
Internal Exception: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
Exception in thread "main" javax.persistence.PersistenceException: Exception [EclipseLink-7107] (Eclipse Persistence Services - 2.6.4.v20160829-44060b6): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Error encountered during string decryption.
Internal Exception: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
Error stack trace point at line where I create EntityManager:
private EntityManagerFactory factory;
private EntityManager em;
public JpaDatabaseConnection() {
factory = Persistence.createEntityManagerFactory("blogspace");
em = factory.createEntityManager();
}
I've added eclipselink and java persistence API through Maven Dependencies and JDBC driver to project classpath. This is my persistence.xml file (located in META-INF directory in folder with project packages):
<?xml version="1.0" encoding="UTF-8" ?>
<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"
version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="blogspace" transaction-type="RESOURCE_LOCAL">
<class>pl.furman.server.database.entities.User</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost/blogspace" />
<property name="javax.persistence.jdbc.user" value="blogserver" />
<property name="javax.persistence.jdbc.password" value="123456" />
<!-- EclipseLink should create the database schema automatically -->
<property name="eclipselink.ddl-generation" value="create-tables" />
<property name="eclipselink.ddl-generation.output-mode" value="database" />
</properties>
</persistence-unit>
</persistence>
What is the cause of problem and how it can be solved? I know that JDBC driver itself probably is working correctly because when I intentionally put wrong password into persistence.xml file I'm getting error about failed authorization. Database is set up and working because I can create queries and insert data into database from shell and from eclipse toad extension.
Thank you in advance for help.
Edit: Problem lies in user name and/or password in persistence.xml. When I changed it to user and password of different length, connection works without problems. However still I have no idea why that was happening.
I can confirm the odd behaviour with EclipseLink version 2.6.4, as I reproduced your setup . Here's the full stack trace:
Internal Exception: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:815)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:205)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:305)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:337)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:303)
at demo.service.UserService.<init>(UserService.java:14)
at demo.Runner.main(Runner.java:8)
Caused by: Exception [EclipseLink-7107] (Eclipse Persistence Services - 2.6.4.v20160829-44060b6): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Error encountered during string decryption.
Internal Exception: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
at org.eclipse.persistence.exceptions.ValidationException.errorDecryptingPassword(ValidationException.java:894)
at org.eclipse.persistence.internal.security.JCEEncryptor.decryptPassword(JCEEncryptor.java:114)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.updateLogins(EntityManagerSetupImpl.java:2404)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.updateSession(EntityManagerSetupImpl.java:2716)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:710)
... 6 more
Caused by: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:934)
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:845)
at com.sun.crypto.provider.DESCipher.engineDoFinal(DESCipher.java:314)
at javax.crypto.Cipher.doFinal(Cipher.java:2165)
at org.eclipse.persistence.internal.security.JCEEncryptor.decryptPassword(JCEEncryptor.java:109)
... 9 more
It seems, this relates to a bug in org.eclipse.persistence.internal.security.JCEEncryptor. While debugging, I found that there are certain password lengths which cause the observed behaviour, e.g. for 123456.
Solution
Now the good part of my answer: This bug was fixed with version 2.6.5-RC1. Moreover, it also works as expected with the latest 2.6.5-RC2 release candidate (available since June 2017). In case you have a Maven project, change the version string of the EclipseLink dependency like so:
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.6.5-RC2</version>
</dependency>
If this is a standalone project, find the latest 2.6.5-RC2 jar file on Maven Central. Just remove the old jar file and put the new one in the application's class path.
Btw, when I changed the PW to 123456789 in the database as well as in persistence.xml it worked even with the bugged version 2.6.4. Odd, isn't it?
Hope it helps.

Postgres JDBC Issue - No suitable driver found for postgresql://localhost:5432/postgres - JDBC driver already configured on buildpath

I am aware this issue comes up when no proper jdbc driver jar is configured in the build path, I have tried adding a few jdbc jars for postgres, yet I face the issue. Please find the below jars I tried.
Using
postgres : 1.16.1
Eclipse Version: Indigo Service Release 2
Java version : 8
Jars I tried
postgresql-9.4.1208.jre6
postgresql-connector-jdbc4.jar
postgresql-jdbc.jar
postgresql-9.3-1103.jdbc3
postgresql-9.2-1003-jdbc4-sources.jar
pg73jdbc3
jdbc7.1-1.1
Reading other posts on stack overflow, I even tried setting the system environmental variables as below..
User Variables - Admin - classpath
C:\Program Files\PostgreSQL\9.2\lib
System Variable - path
C:\Program Files\PostgreSQL\9.2\bin
Not sure if this is required
Database details setup in my .properties file
jdbc.driverClassName=org.postgresql.Driver
jdbc.url=postgresql://localhost:5432/postgres
jdbc.username=admin
jdbc.password=admin
Using spring framework based application
Logs :
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: No suitable driver found for postgresql://localhost:5432/postgres
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:240)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:371)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:335)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:105)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy8.getCollegeDetails(Unknown Source)
at com.cts.bo.HESBO.registerCourse(HESBO.java:42)
at com.cts.facade.HESFacade.registerCourse(HESFacade.java:34)
at com.cts.manager.HESManager.registerCourse(HESManager.java:34)
at com.cts.presentation.Tester.registerCourse(Tester.java:66)
at com.cts.presentation.Tester.main(Tester.java:159)
Caused by: java.sql.SQLException: No suitable driver found for postgresql://localhost:5432/postgres
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:173)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:164)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:149)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:119)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:202)
... 11 more
Please guide as for what needs to be done.Thanks
You don't add url while filling the database details for postgresql. You instead do the following.
<bean id="dataSource" class="org.postgresql.xa.PGXADataSource">
<property name="user" value="${username}" />
<property name="password" value="${password}" />
<property name="portNumber" value ="${portNumber}" />
<property name="databaseName" value="${databaseName}" />
<property name="serverName" value="${serverName}" />
</bean>
in your application context and
username=yourusername
password=******
portNumber=5432
databaseName=yourdb
serverName=localhost
in your property file.Later ofcourse you need to utilize the datasource bean. Look at the following, https://jdbc.postgresql.org/documentation/publicapi/org/postgresql/xa/PGXADataSource.html.

Open ObjectDB explorer whilst running the tomcat server / instance

I'm new to ObjectDB and not sure if I've done something wrong here but I'm getting a couple of issues I'm hoping the community can help me with.
First is this annoying inability to view the db in the explorer when the server is running. If the explorer is open first then the tomcat/server/idea will crash and burn.
I get this:
If on the other hand Explorer is open and I try to restart the server :
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is com.objectdb.o._PersistenceException: Attempt to open a database file '/Users/SteveGreen/Development/Dev Workspace/RatedPlate_Java/RatedPlate/target/RatedPlate/WEB-INF/db/ratedplate.odb' that is currently in use by another process
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)
I then need to close connection in explorer and restart the server, however the saga continues as now I receive:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is com.objectdb.o._PersistenceException: Attempt to open a database file '/Users/SteveGreen/Development/Dev Workspace/RatedPlate_Java/RatedPlate/target/RatedPlate/WEB-INF/db/ratedplate.odb' with an old unsupported format
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)
and I need to clean install the mV build before continuing again.
I'm using version 2.2.5 as per the pom, the explorer is from version 2.6.3 as the earlier jar that I downloaded that mapped to my version was not displaying the query option. If I suggest to the IDE that I now use a version other than 2.2.5 then all hell breaks loose and I'm not sure what the best course of action is. As you can imagine, it makes for a pretty shitty debug environment.
Any help is hugely appreciated, thanks!
From my pom:
com.objectdb
objectdb
2.2.5
Persistence:
<?xml version="1.0" encoding="UTF-8"?>
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="RatedPlateDB" transaction-type="RESOURCE_LOCAL">
<provider>com.objectdb.jpa.Provider</provider>
<properties>
<property name="javax.persistence.jdbc.url" value="$objectdb/db/ratedplate.odb"/>
<property name="javax.persistence.jdbc.user" value="admin"/>
<property name="javax.persistence.jdbc.password" value="admin"/>
</properties>
</persistence-unit>
EDIT: I believe I've found and fixed the upgrade issue - 2.6.3 does not come with Jta or persistence
details: http://m2.objectdb.com
Updated pom:
<dependency>
<groupId>com.objectdb</groupId>
<artifactId>objectdb</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
In embedded mode the database file is locked by one process, so you cannot access the same database (in embedded mode) concurrently in the Explorer and in your application.
To access a database by more than one process at the same time use either client-server mode or embedded-server mode.

java.lang.NullPointerException at com.sun.faces.context.flash.ELFlash.getFlash

I had created a simple JSF2.0 app and it runs fine in my computer, but when I try to run it in Heroku, I get this error:
HTTP ERROR 500
Problem accessing /login.xhtml. Reason:
Server Error
Caused by:
java.lang.NullPointerException
at com.sun.faces.context.flash.ELFlash.getFlash(ELFlash.java:93)
at com.sun.faces.context.flash.ELFlash.getELFlash(ELFlash.java:124)
at com.sun.faces.context.flash.ELFlash.doPostPhaseActions(ELFlash.java:722)
at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:108)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:311)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:547)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:481)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:940)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:874)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
at org.eclipse.jetty.server.Server.handle(Server.java:349)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:904)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:565)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:46)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:545)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:43)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
at java.lang.Thread.run(Thread.java:636)
So, any solution to this problem?
Thanks in advance.
java.lang.NullPointerException
at com.sun.faces.context.flash.ELFlash.getFlash(ELFlash.java:93)
at com.sun.faces.context.flash.ELFlash.getELFlash(ELFlash.java:124)
I don't recognize the ELFlash#getELFlash() method as part of recent Mojarra implementations. Perhaps you're using a very early 2.0.0 implementation which has a bug related to this. Upgrading to the latest should fix this problem.
but the problem with annotations persists in Heroku
javax.el.PropertyNotFoundException: /login.xhtml #15,55 value="#{user.name}": Target Unreachable, identifier 'user' resolved to null
at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:100‌​)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(Html‌​BasicInputRenderer.java:95)
JSF2 annotations will fail if your faces-config.xml is not properly declared conform JSF2 specification. Make sure that the <faces-config> root declaration look like this:
<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_0.xsd"
version="2.0">
<!-- config here -->
</faces-config>

Categories