JSF-Projekt, Datasourceproblem

Mr.y

Aktives Mitglied
Hallo, ich möchte mein jsf-projekt kompilieren und auf nen glassfish server bringen.
Leider komme ich nicht soweit.

Als ich früher compillierte hieß sowas wie "invaild Datenbankname_pm"

Dann habe ich die Verbindung auf dem Glassfish angelegt.
Und dann einem JNDI-Namen angefügt.

Konfiguration:

url jdbc:derby://localhost:1527/meineDB
user ich
DatabaseName meineDB
Password ich
Servername localhost
Portnummer 1527
Diese Daten hab ich unter nem JNDI-Namen gespreichert.

Nun trage ich diesen JNDI-Namen in die persistenz.xml

Und es kompilliert sich nix weiter....keine rückmeldung:


init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:

Persistenz.xml :
[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="ManagerXYPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceP rovider</provider>
<jta-data-source>jdbc/meineDB</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.ddl-generation" value="create-tables"/>
</properties>
</persistence-unit>
</persistence>
[/XML]

über die CDI "JavaBeans" injeziere ich den @PersistenceContext(unitName = "ManagerXYPU")
ManagerXY ist das Projekt.
Was muss ich grundsätzlich machen, damit das ohne Probleme mit der Datasource funktioniert oder wo muss ich noch nachschauen???
danke für jeden Tipp
 
[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="DeinePU" transaction-type="RESOURCE_LOCAL">

<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

<class>dein.Package.deine.Klasse</class>

<exclude-unlisted-classes>true</exclude-unlisted-classes>

<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/meineDB"/>
<property name="javax.persistence.jdbc.password" value="passwort"/>
<property name="eclipselink.ddl-generation" value="create-tables"/>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="javax.persistence.jdbc.user" value="username"/>
</properties>
</persistence-unit>
</persistence>
[/XML]

URL, Driver und ddl-generation können abweichen.

LG
 
Danke für deine Antwort.
Leider bringt das nicht so recht was, jetzt wird im reiter "ManagerXY (run-deploy) angezeigt:

init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
In-place deployment at C:\Users\Mr\Downloads\Documents\NetBeansProjects\ManagerXY\build\web

hab das XML soweit angepasst:

ximg.php



Im Reiter Service heisst ja die url: ...../localhost:1527/Projekt [user on password]
im eckigen klammern steht doch zuerst user und das passwort?
 
Du versuchst mit dem MySQL JDBC Treiber auf eine Derby DB zuzugreifen, das wird nicht funktionieren.

Ansonsten wäre es gut wenn du den Stacktrace postests (als Text, nicht als Bild 😉)
 
ups..jaa das passt nicht, hab die zeile und die zeile mit "dein.Package.deine.Klasse" vorerst rausgenommen, leider bringt das nichts...

Netbeans ist etwas neu für mich, was mache ich mit diesem Stacktrace?
 
Zuletzt bearbeitet:
Kenne Netbeans nicht wirklich, aber da solltest du doch auch den Text/Stacktrace zu selektieren und dann per C&P hier einzufügen können.
 
also ich bin echt verwirrt.

ich leg neues projekt an und gebe den jndi an, von der DB, die ich meinem eignetlichen projekt angebe.
Es wird eine persistenz.xml erzeugt und tatsächlich deployet.

Dann passe ich die persistenz.xml bei meinem eigentlichen Projekt genauso an, mit der selben jndi und ich kann warten bis es morgen wird, es passiert einfach nichts.
Das einzige, was ich von der IDE sehe ist:


ant -f C:\\Users\\Mr\\Downloads\\Documents\\NetBeansProjects\\ManagerXY -DforceRedeploy=true -Ddirectory.deployment.supported=true -Dnb.wait.for.caches=true run-deploy
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
In-place deployment at C:\Users\Mr\Downloads\Documents\NetBeansProjects\ManagerXY\build\web
 
nach dem neustart, zeigt mir NetBeans Folgends an:

Launching GlassFish on Felix platform
Information: Running GlassFish Version: GlassFish Server Open Source Edition 3.1.2.2 (build 5)
Information: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry
Information: Grizzly Framework 1.9.50 started in: 140ms - bound to [0.0.0.0:7676]
Information: Grizzly Framework 1.9.50 started in: 238ms - bound to [0.0.0.0:3700]
Information: Grizzly Framework 1.9.50 started in: 370ms - bound to [0.0.0.0:8080]
Information: Grizzly Framework 1.9.50 started in: 298ms - bound to [0.0.0.0:8181]
Information: Grizzly Framework 1.9.50 started in: 287ms - bound to [0.0.0.0:4848]
Information: The Admin Console is already installed, but not yet loaded.
Information: SEC1002: Security Manager is OFF.
Information: SEC1010: Entering Security Startup Service
Information: SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
Information: SEC1115: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
Information: SEC1115: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
Information: SEC1115: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.
Information: SEC1011: Security Service(s) Started Successfully
Information: WEB0169: Created HTTP listener [http-listener-1] on host/port [0.0.0.0:8080]
Information: WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:8181]
Information: WEB0169: Created HTTP listener [admin-listener] on host/port [0.0.0.0:4848]
Information: WEB0171: Created virtual server [server]
Information: WEB0171: Created virtual server [__asadmin]
Information: WEB0172: Virtual server [server] loaded default web module []
Information: Mojarra 2.1.6 (SNAPSHOT 20111206) für Kontext '/WebApplication3' wird initialisiert.
Information: HV000001: Hibernate Validator 4.3.0.Final
Information: WEB0671: Loading application [WebApplication3] at [/WebApplication3]
Information: CORE10010: Loading application WebApplication3 done in 15.967 ms
Information: WELD-000900 1.1.8 (Final)
Information: Mojarra 2.1.6 (SNAPSHOT 20111206) für Kontext '/WebApplication6' wird initialisiert.
Information: WEB0671: Loading application [WebApplication6] at [/WebApplication6]
Information: CORE10010: Loading application WebApplication6 done in 5.220 ms
Information: Mojarra 2.1.6 (SNAPSHOT 20111206) für Kontext '/WebApplication7' wird initialisiert.
Information: WEB0671: Loading application [WebApplication7] at [/WebApplication7]
Information: CORE10010: Loading application WebApplication7 done in 897 ms
Information: Mojarra 2.1.6 (SNAPSHOT 20111206) für Kontext '/WebApplication8' wird initialisiert.
Information: WEB0671: Loading application [WebApplication8] at [/WebApplication8]
Information: CORE10010: Loading application WebApplication8 done in 724 ms
Information: GlassFish Server Open Source Edition 3.1.2.2 (5) Startzeit: Felix (6.714ms), Startservices(28.150ms), gesamt(34.864ms)
Information: WEB0169: Created HTTP listener [http-listener-1] on host/port [0.0.0.0:8080]
Information: Grizzly Framework 1.9.50 started in: 11ms - bound to [0.0.0.0:8080]
Information: WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:8181]
Information: Grizzly Framework 1.9.50 started in: 13ms - bound to [0.0.0.0:8181]
Information: JMX005: JMXStartupService had Started JMXConnector on JMXService URL service:jmx:rmi://Mr-PC.fritz.box:8686/jndi/rmi://Mr-PC.fritz.box:8686/jmxrmi

aber wie gesagt, es tut sich nichts weiter....
 

Zurück
Oben