0

my application works fine on my local installation in Netbeans 11 (the Database (MariaDB) is running on an external ubuntuserver). When I deploy the application on my ubuntuserver (glassfishserver) the LoginPage becomes visible, but when I want to login (so when entities are needet and I need a connection to the database) I get this errormessage:

/index.xhtml @29,141 value="#{userLoggedin.username}": Target Unreachable, identifier 'userLoggedin' resolved to null

The database can be reached from the ubuntuserver where I deploy my application (there is a pretty small Java app running on the glassfishserver with "prepared statements" -> and this works fine with the database).

The application is written in Java - JSF.

Here you can see the general structure

beans.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
       bean-discovery-mode="all">
</beans>

glassfish-resources.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
    <jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="mysql_lucy_db_prod_agd_externPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
        <property name="serverName" value="here is the IP"/>
        <property name="portNumber" value="3306"/>
        <property name="databaseName" value="lucy_db_prod"/>
        <property name="User" value="here is a user"/>
        <property name="Password" value="here is the pw"/>
        <property name="URL" value="jdbc:mysql://here is the ip:3306/lucy_db_prod?zeroDateTimeBehavior=convertToNull"/>
        <property name="driverClass" value="com.mysql.cj.jdbc.MysqlDataSource"/>
    </jdbc-connection-pool>
    <jdbc-resource enabled="true" jndi-name="java:app/lucy_extern" object-type="user" pool-name="mysql_lucy_db_prod_agd_externPool"/>
</resources>

So once more: the software works really fine on my local computer but not when I try to login on the deloyed one. I hope someone can help me ...

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
agd
  • 69
  • 5
  • Tried posting the error in a search engine and investigate? – Kukeltje Feb 06 '20 at 17:31
  • Yes, shure I did ... and there are some findings, but I did not find a solution for my case - but maybe I overread something. – agd Feb 06 '20 at 18:16
  • So why did you not mention that, and the links you found? and why they did not help... Like stated in [ask]... – Kukeltje Feb 06 '20 at 20:05
  • Sorry: Mainly I took a look on this: [link] https://stackoverflow.com/questions/30128395/identifying-and-solving-javax-el-propertynotfoundexception-target-unreachable I checked the part 1a (because of my error-message) with CDI, but I thnk my beans.xml is ok and on the right place. I've opend the .war and unzip it, to check if everything is on the right place. I've checked, that I did not mix ManagedBean-Annotation and Named-Annotation (I use CDI). which I find strange: the app runs perfect on my system, but not on the glassfishserver where I deploy it ... – agd Feb 07 '20 at 06:18

0 Answers0