Probleme mit ApplikationClient mit Sicherheitsanmeldung!

Status
Nicht offen für weitere Antworten.

th.weigand

Mitglied
Hallo,

ich habe ein OnlineBankingSystem als J2EE Anwendung erzeugt. Dazu habe ich auch eine Weboberfläche für die Anwendung implementiert. Nun möchte ich noch einen Client schreiben der mir ein paar Beispiel Daten für das OnlineBanking erzeugt. So sieht mein ClientCode aus:
Code:
package ob.client;

import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import javax.security.auth.login.LoginContext;
import java.util.*;
import ob.client.OnlineBankingClientCallbackHandler;
import ob.session.BankVerwaltungRemote;
import ob.entity.BankBean;
public class OnlineBankingClient {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
	    BankVerwaltungRemote bankverw = null;
	    try
	    {
	      //System.setProperty("java.security.auth.login.config", "C:/temp/workspace/SecurityClient/appClientModule/META-INF/auth.conf");
	      //System.setProperty("java.security.auth.login.config", "appClientModule/META-INF/auth.conf");
	      
	      //Properties für den JNDI-Zugriff initialisieren:
	      Properties props = new Properties();
	      props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
	      props.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
	      props.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
	      props.setProperty("j2ee.clientName", "OnlineBankingClient");
	      
	      InitialContext initialContext = new InitialContext(props);
	      
	      //Login initialisieren:
	      OnlineBankingClientCallbackHandler callbackHandler = new OnlineBankingClientCallbackHandler();
	      LoginContext loginContext = new LoginContext ("adminsecurity", callbackHandler);
	      loginContext.login();
	      
	      
	      Object bankverwRef = initialContext.lookup("java:comp/env/ejb/BankVerwaltungRemote");
	      bankverw = (BankVerwaltungRemote) PortableRemoteObject.narrow(bankverwRef, BankVerwaltungRemote.class);
	    }
	    catch (Exception ex)
	    {
	      System.out.println("INIT Failed (" + ex.getClass().getName() + "): " + ex.getMessage() + " ");
	      ex.printStackTrace();
	      return;
	    }
	    try {
	    if (bankverw != null) {	         
	    		bankverw.neueBankAnlegen(55090500,"Sparda-Bank Südwest eG", "Robert-Koch-Straße 45", "Mainz", "55129", "info@sparda-sw.de","01805915550", "06131915949");
	    		bankverw.neueBankAnlegen(56261073, "Volksbank Kirn-Sobernheim eG", "August-Bebel-Platz 4", "Kirn", "55606", "info@vbkiso.de", "067529393-0", "067529393-33");
	    		bankverw.neueBankAnlegen(51080060, "Dresdner Bank AG", "Salinenstraße 32", "Bad Kreuznach", "55543", "info@dr-ba.de", "06712560", "0671256291");
	    		bankverw.neueBankAnlegen(56050180, "Sparkasse Rhein-Nahe", "Kornmarkt 5", "Bad Kreuznach", "55543", "info@sk-rhein-nahe.de", "0671940", "06719615555");
	    		bankverw.neueBankAnlegen(12070000, "Deutsche Bank AG", "Theodor-Heuss-Allee 70", "Frankfurt", "60262", "deutsche.bank@db.com", "06991000", "06991034255");
	    	}

	    	
	        else {
	        System.out.println("SessionFacade ist nicht da");
	        }
	        System.out.println("Eine Bank erzeugt!");
	        List<BankBean> liste = bankverw.listeallerBanken();
	        System.out.println("Wir haben " + liste.size() + " Banken!");
	        for (Iterator iterator = liste.iterator(); iterator.hasNext();) {
	        BankBean bank = (BankBean) iterator.next();
	        System.out.println(bank.getBlz() + ": " +
	        bank.getName() + " " + bank.getOrt() + " " +
	        bank.getUsers().size() + " Benutzer");
	        }
		}
		catch (Exception e) {
			System.err.println("Die Bank konnte nicht angelegt werden!");
		}

	}

}

dieser llässt sich zwar ausführen, aber er bringt mir folgende Fehlermeldung die mir nicht weiterhilft. Ich kann mit dieser Fehlermeldung nichts anfangen. Fehlermeldung:
13:07:20,890 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
13:07:20,890 ERROR [JDBCExceptionReporter] failed batch
13:07:20,890 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:296)
at org.jboss.ejb3.entity.TransactionScopedEntityManager.flush(TransactionScopedEntityManager.java:211)
at ob.session.BankVerwaltungBean.neueBankAnlegen(BankVerwaltungBean.java:271)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:166)
at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:108)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:278)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:560)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:369)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:165)
Caused by: java.sql.BatchUpdateException: failed batch
at org.hsqldb.jdbc.jdbcStatement.executeBatch(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.executeBatch(Unknown Source)
at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeBatch(CachedPreparedStatement.java:478)
at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:519)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
... 44 more

ich hoffe es kann mir hier jemand weiterhelfen.

thanks
Thomas
 
G

Guest

Gast
In einer simiplen Anwendung hast du kein NamingService. Diese Fehlermeldung sagt einfach, dass keine Datenbank erreichbar ist.
 
Status
Nicht offen für weitere Antworten.
Ähnliche Java Themen
  Titel Forum Antworten Datum
D Probleme beim Umstieg auf Jakarta EE Allgemeines EE 5
Dimax JSP Probleme mit Java in JSP Allgemeines EE 21
OnDemand Performance Probleme wegen vieler Objekte Allgemeines EE 3
B @Startup - FileWatcher - Probleme beim Hochfahren des Servers Allgemeines EE 4
Psypsy Spring Probleme mit Datenzugriff Allgemeines EE 5
D Apache POI Probleme mit Daten(Datum) die aus Formeln entstehen Allgemeines EE 3
T Probleme mit File renameTo bzw. File delete @@ Allgemeines EE 3
F Probleme mit JSF und ManagedBean Allgemeines EE 3
B Probleme mit Templates in einem Webprojekt Allgemeines EE 6
Fu3L Probleme beim Einrichten Allgemeines EE 3
A Probleme bei der Einbindung eines Liferay Portalserver (Glassfish) Allgemeines EE 7
S Datenbankzugriff (Probleme mit Cache?!) Allgemeines EE 8
K Probleme mit Apache MyFaces 2 und ICEFaces Facelets Allgemeines EE 1
K Probleme mit Enterprise Anwendung Allgemeines EE 5
D Probleme mit Cactus Allgemeines EE 9
F <security-constraint> Probleme Allgemeines EE 2
G Probleme im Tomcat - loading WebappClassLoader Allgemeines EE 3
G Probleme mit dem Klassenpfad nach dem deployment Allgemeines EE 2
Q Probleme bei einbinden von RichFaces. Allgemeines EE 10
T Probleme mit Facelets und if foreach und when Allgemeines EE 3
V Bildupload probleme Allgemeines EE 2
T Probleme mit Komplexerer ejb-ql Abfrage! Allgemeines EE 2
R EJB Client: Probleme mit der Client.jar Allgemeines EE 2
M Probleme mit Leerzeichen bei HtmlOutputLink Allgemeines EE 5
K probleme mit <h:dataTable> Allgemeines EE 2
M probleme mit client server kommunikation Allgemeines EE 3
S Probleme mit struts - ActionServlet Allgemeines EE 6
E BackingBean Probleme Allgemeines EE 2
K JBoss AS & IDE Probleme Allgemeines EE 2
T Probleme beim Einsatz von J2EE / JBoss Allgemeines EE 4
Ö Spring, Probleme mit FlowScope und HttpServletRequest Allgemeines EE 2
J Probleme mit Struts Allgemeines EE 3
DaRolla Probleme mit Verzeichnissen (Servlet, JSP, Tomcat) Allgemeines EE 8
G Probleme mit ResultSet Allgemeines EE 9
L Probleme mit Kompilierung von JNDI Allgemeines EE 2
K Internet Explorer MIME Type Probleme Allgemeines EE 2
M Probleme beim Performancetuning des Servlets Allgemeines EE 2
G Probleme mit Validierung (Struts, validation.xml) Allgemeines EE 4
G Mehrere Probleme mit Servlets/Java Allgemeines EE 15
W Tomcat Probleme Allgemeines EE 7
FsMarine Probleme beim ausführen von JSP dateien unter Tomcat Allgemeines EE 4
E JBoss 4.0.2 - Probleme mit der Spezifikation Allgemeines EE 3
R Probleme mit Tutorial Allgemeines EE 4
M Probleme bei Aufruf von JSPs in Unterverzeichnissen Allgemeines EE 2
M Probleme beim Webservice Deployment(Sun ApplicationServer) Allgemeines EE 2
H JONAS 4.1.4 Start Probleme Allgemeines EE 2
O Probleme mit Aktualität bei JBOSS Allgemeines EE 4
A Probleme mit J2EE und Tomcat Allgemeines EE 7
R Inputstream Probleme Allgemeines EE 11
P Probleme mit File renameTo bzw. File delete Allgemeines EE 3
F Probleme mit Eclipse/JBoss Allgemeines EE 6

Ähnliche Java Themen

Neue Themen


Oben