This is a bug registered in SourceForge bug list
http://sourceforge.net/tracker/index.php?func=detail&aid=459443&group_id=228
66&atid=376685

BTW I recovered from this bug. For this I needed to
change CMP to BMP. And I also noticed
(this might not directly connected to the bug)
that MS SQL Server behaves badly if you do just:
      conn = xxx.getConnection();
      PreparedStatement ps = conn.prepareStatement("SELECT 1 FROM xxx WHERE
id=?");
      ps.setInt( 1, id );
      ResultSet rs = ps.executeQuery();
      try{
        if( !rs.next() ) throw new FinderException("GlobalRadio Bean with
id="+id+" not found.");
      } finally { rs.close(); ps.close(); }

you must do additional rs.next() until it returns false:
      conn = xxx.getConnection();
      PreparedStatement ps = conn.prepareStatement("SELECT 1 FROM xxx WHERE
id=?");
      ps.setInt( 1, id );
      ResultSet rs = ps.executeQuery();
      try{
        if( rs.next() ){ rs.next();
        } else throw new FinderException("GlobalRadio Bean with id="+id+"
not found.");
      } finally { rs.close(); ps.close(); }

----- Original Message -----
From: "chris" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 25, 2001 5:11 PM
Subject: [JBoss-user] migration jboss 2.2 to 2.4.3


> Hi I have some questions which I really should find an answer for,
otherwise
> I can almost forget my diploma work if I don't get this baby to work :)
>
> During the project work I used jboss 2.2 on windows 2000 server with mssql
> 2000 server and all my classes worked fine, I was so happy that I could
show
> a proof of concept but now .... :(
>
> I just installed jboss2.4.3 changed the data source class of my old
> jboss.jcml config file to
> "org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl" according to the
changes.
> Then I figured out that in jndi.properties
> #java.naming.provider.url=localhost is outcommented so I had to add
> following code to my clients (before jndi.properties was in the classpath)
> properties props = new Properties();
> props.put(Context.INITIAL_CONTEXT_FACTORY,
> "org.jnp.interfaces.NamingContextFactory");
> props.put(Context.PROVIDER_URL, "myNiceServer:1099");
> Is this now the new way I should normaly define my provider URL??
>
>
> now the very very stange thing is that ther is a client wich is working,
see
> code:
>
> public static void main (String args[]) {
>     Properties props = new Properties();
>     props.put(Context.INITIAL_CONTEXT_FACTORY,
> "org.jnp.interfaces.NamingContextFactory");
>     props.put(Context.PROVIDER_URL, "myNiceServer:1099");
>
>     try {
>       Context ctx = new InitialContext(props);
>       Object objref = ctx.lookup("myCorrectJNDI/AuthenticationManager");
>       AuthenticationManagerHome amHome =
> (AuthenticationManagerHome)PortableRemoteObject.narrow(objref,
> AuthenticationManagerHome.class);
>       AuthenticationManager am = amHome.create();
>       Collection collection = am.getAllAccounts();
>       Iterator iterator = collection.iterator();
>       while (iterator.hasNext()) {
>         AccountValueObject avo = (AccountValueObject)iterator.next();
>       }
>     } catch (java.rmi.RemoteException e) {
>       e.printStackTrace();
>     } catch (javax.ejb.CreateException e) {
>       e.printStackTrace();
>     } catch (javax.naming.NamingException e) {
>       e.printStackTrace();
>     } catch (javax.ejb.NoSuchEntityException e) {
>       System.out.println("Not found!");         //is never thrown to
client
>     }
>
> and all the others NOT! see code:
>
>  public static void main (String args[]) {
>     Properties props = new Properties();
>     props.put(Context.INITIAL_CONTEXT_FACTORY,
> "org.jnp.interfaces.NamingContextFactory");
>     props.put(Context.PROVIDER_URL, "myNiceServer:1099");
>
>     String userID = "schneider";
>     String password = "fischer33";
>     String name = "Schneider Christian";
>     String emailAddress = "[EMAIL PROTECTED]";
>     AdministratorHome adminHome = null;
>     Administrator admin = null;
>     try {
>       Context ctx = new InitialContext(props);
>       Object objref = ctx.lookup("myCorrectJNDI//Administrator");
>       adminHome = (AdministratorHome)PortableRemoteObject.narrow(objref,
> AdministratorHome.class);
>       admin = adminHome.findByPassword(password);
>       System.out.println("findByPassword:       " + admin.getPassword());
>       admin = null;
>       admin = adminHome.findByName(name);
>       System.out.println("findByName:           "  + admin.getName());
>       admin = null;
>       admin = adminHome.findByUserID(userID);
>       System.out.println("findByUserID:         "  + admin.getUserID());
>       admin = null;
>       admin = adminHome.findUserIDPassword(userID, password);
>       System.out.println("findByUserIDPassword: " + admin.getUserID() + "
"
> + admin.getPassword());
>       admin = null;
>       admin = adminHome.findByEMailAddress(emailAddress);
>       System.out.println("findByEMailAddress:   " +
> admin.getEmailAddress());
>       System.out.println("PasswordExpires Date: " +
> admin.getPasswordExpires().toString());
>       System.out.println("AccountExpires Date:  " +
> admin.getAccountExpires().toString());
>     } catch (java.rmi.RemoteException e) {
>       e.printStackTrace();
>     } catch (javax.naming.NamingException e) {
>       e.printStackTrace();
>     } catch (javax.ejb.NoSuchEntityException e) {
>       System.out.println("Not found!");         //is never thrown to
client
>     } catch (javax.ejb.FinderException e) {
>       e.printStackTrace();
>     }
>   }
>
> I get all the time this Exception
>
> java.rmi.ServerException: RemoteException occurred in server thread;
nested
> exce
> ption is:
>         javax.transaction.TransactionRolledbackException: Load failed;
> nested ex
> ception is:
>         java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid
> Descri
> ptor Index; nested exception is:
>         java.rmi.ServerException: Load failed; nested exception is:
>         java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid
> Descri
> ptor Index
> javax.transaction.TransactionRolledbackException: Load failed; nested
> exception
> is:
>         java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid
> Descri
> ptor Index; nested exception is:
>         java.rmi.ServerException: Load failed; nested exception is:
>         java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid
> Descri
> ptor Index
> java.rmi.ServerException: Load failed; nested exception is:
>         java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid
> Descri
> ptor Index
> java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid
Descriptor
> Ind
> ex
>         at
> sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
> RemoteCall.java:245)
>         at
> sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
> 220)
>         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
>         at
> org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invoke(Un
> known Source)
>         at
> org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(Ge
> nericProxy.java:357)
>         at
> org.jboss.ejb.plugins.jrmp.interfaces.EntityProxy.invoke(EntityProxy.
> java:133)
>         at $Proxy1.getPassword(Unknown Source)
>         at
> ch.algacom.aaps.client.AdminFinderClient.main(AdminFinderClient.java:
> 52)
>
> pls can someone tell me what I'm doing wrong here? or is ther another very
> important change to the new version which I am not aware of?
>
> oh and did someone already thest the new JDBC drivers from microsoft?
> http://www.microsoft.com/sql/downloads/2000/jdbc.asp
>
> and what happend to the ejx descriptor tool?
>
> thx a lot
> Chris
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to