Character encoding problem
Once again since my yesterdays posting seems to be lost: Hi Orion Masters, When I put line: response.setContentType("text/html;charset=ISO-8859-2"); into my servlet's doGet method, I don't get response from the servlet. Moreover, Orion starts consuming ~100% of CPU until restarted. When I use: response.setContentType("text/html"); I get the response, but naturally without my national charset. The problem occurs on 1.4.5, I didn't have it on 1.2.9. JSP encoding works fine. When I get its java code and put it as servlet, it works too. If I change my servlet to extend com.evermind.server.http.EvermindHttpJspPage instead of HttpServlet (and change doGet to _jspService, and so) it starts working, but it is not solution I would accept. So how can I have charset definition in servlets working? Thanks in advance, Rafal p.s. If it helps, I have Orion on NT Workstation installed.
RE: Problems with JNDI lookups of ejb-ref-name defined inapplication-client.xml from a client application...
I think application-client.xml is broken in Orion. The whole purpose of having application-client.xml is to be able to map a client written by one vendor, to the EJB written by another vendor. Has any one been able to "properly" use application-clientejb-ref to map ejb-ref-name to ejb-link where both are NOT the same string? Thanks. -AP_ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky Sent: Thursday, March 15, 2001 2:11 PM To: Orion-Interest Subject: Problems with JNDI lookups of ejb-ref-name defined in application-client.xml from a client application... I have a client application which has META-INF with the following application-client.xml definition: application-client ejb-ref ejb-ref-nameejb/id/ejb-ref-name ejb-ref-typeSession/ejb-ref-type homecom.indnet.model.id.IdSessionHome/home remotecom.indnet.model.id.IdSession/remote ejb-linkId/ejb-link /ejb-ref /application-client In the client, I attempt to do the following: new InitialContext().lookup("ejb/id"); The above fails with the naming exception, telling me that ejb/id cannot be found: Exception in thread "main" javax.naming.NameNotFoundException: ejb/id not found at com.evermind.server.rmi.RMIContext.lookup(JAX) at com.evermind.naming.jz.lookup(JAX) at javax.naming.InitialContext.lookup(InitialContext.java:350) at com.indnet.model.id.test.Client.main(Client.java:16) If I change my client line to read: new InitialContext().lookup("Id"); Things work correctly. "Id" is the ejb-name used for my object: enterprise-beans session ejb-nameId/ejb-name homecom.indnet.model.id.IdSessionHome/home remotecom.indnet.model.id.IdSession/remote ejb-classcom.indnet.model.id.IdSessionBean/ejb-class session-typeStateless/session-type ... What is the purpose of application-client.xml if I cannot create references and use the name specified in ejb-ref-name to lookup the components? Or am I missing something? Thanks. -AP_
SV: Problems with JNDI lookups of ejb-ref-name defined in application-client.xml from a client application...
Title: SV: Problems with JNDI lookups of ejb-ref-name defined in application-client.xml from a client application... Did you try looking up java:comp/env/ejb/id ? WR -Ursprungligt meddelande- Från: Alex Paransky [mailto:[EMAIL PROTECTED]] Skickat: den 15 mars 2001 14:11 Till: Orion-Interest Ämne: Problems with JNDI lookups of ejb-ref-name defined in application-client.xml from a client application... I have a client application which has META-INF with the following application-client.xml definition: application-client ejb-ref ejb-ref-nameejb/id/ejb-ref-name ejb-ref-typeSession/ejb-ref-type homecom.indnet.model.id.IdSessionHome/home remotecom.indnet.model.id.IdSession/remote ejb-linkId/ejb-link /ejb-ref /application-client In the client, I attempt to do the following: new InitialContext().lookup(ejb/id); The above fails with the naming exception, telling me that ejb/id cannot be found: Exception in thread main javax.naming.NameNotFoundException: ejb/id not found at com.evermind.server.rmi.RMIContext.lookup(JAX) at com.evermind.naming.jz.lookup(JAX) at javax.naming.InitialContext.lookup(InitialContext.java:350) at com.indnet.model.id.test.Client.main(Client.java:16) If I change my client line to read: new InitialContext().lookup(Id); Things work correctly. Id is the ejb-name used for my object: enterprise-beans session ejb-nameId/ejb-name homecom.indnet.model.id.IdSessionHome/home remotecom.indnet.model.id.IdSession/remote ejb-classcom.indnet.model.id.IdSessionBean/ejb-class session-typeStateless/session-type ... What is the purpose of application-client.xml if I cannot create references and use the name specified in ejb-ref-name to lookup the components? Or am I missing something? Thanks. -AP_
Orion with PostgreSQL (oid)
I got some problems with PostgreSQL and Orion when using blobs (oids in the table). I checked: http://www.postgresql.org/users-lounge/docs/7.0/programmer/jdbc6519.htm In the above page you can read the following example: snip To insert an image, you would use: File file = new File("myimage.gif"); FileInputStream fis = new FileInputStream(file); PreparedStatement ps = conn.prepareStatement("insert into images values (?,?)"); ps.setString(1,file.getName()); ps.setBinaryStream(2,fis,file.length()); ps.executeUpdate(); ps.close(); fis.close(); /snip This does a PreparedStatement.setBinaryStream(int,InputStream,int); - Exactly what Orion did! Here is the interesting part of the Exception.printStackTrace(); : snip Nested exception is: InputStream as parameter not supported at java.lang.Throwable.(Throwable.java:84) at java.lang.Exception.(Exception.java:35) at java.sql.SQLException.(SQLException.java:100) at org.postgresql.util.PSQLException.(PSQLException.java:22) at org.postgresql.jdbc2.PreparedStatement.setBinaryStream(PreparedStatement .java:417) at com.evermind.sql.ao.setBinaryStream(JAX) /snip So, this would lead to the conclusion, that Orion just tries to use a standard JDBC-API. Maybe Orion uses a special subclass of InputStream and the JDBC-Driver doesn't correctly account for this situation. In the JDBC API it reads: snip Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface. /snip This would blame the JDBC-driver then? Yours Armin
Re: Problems with JNDI lookups of ejb-ref-name defined in application-client.xml from a client application...
try: new InitialContext().lookup("java:comp/env/ejb/id"); - Original Message - From: "Alex Paransky" [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Sent: Thursday, March 15, 2001 10:10 PM Subject: Problems with JNDI lookups of ejb-ref-name defined in application-client.xml from a client application... I have a client application which has META-INF with the following application-client.xml definition: application-client ejb-ref ejb-ref-nameejb/id/ejb-ref-name ejb-ref-typeSession/ejb-ref-type homecom.indnet.model.id.IdSessionHome/home remotecom.indnet.model.id.IdSession/remote ejb-linkId/ejb-link /ejb-ref /application-client In the client, I attempt to do the following: new InitialContext().lookup("ejb/id"); The above fails with the naming exception, telling me that ejb/id cannot be found: Exception in thread "main" javax.naming.NameNotFoundException: ejb/id not found at com.evermind.server.rmi.RMIContext.lookup(JAX) at com.evermind.naming.jz.lookup(JAX) at javax.naming.InitialContext.lookup(InitialContext.java:350) at com.indnet.model.id.test.Client.main(Client.java:16) If I change my client line to read: new InitialContext().lookup("Id"); Things work correctly. "Id" is the ejb-name used for my object: enterprise-beans session ejb-nameId/ejb-name homecom.indnet.model.id.IdSessionHome/home remotecom.indnet.model.id.IdSession/remote ejb-classcom.indnet.model.id.IdSessionBean/ejb-class session-typeStateless/session-type ... What is the purpose of application-client.xml if I cannot create references and use the name specified in ejb-ref-name to lookup the components? Or am I missing something? Thanks. -AP_
Re: Inconsistent EJB JNDI Locations
Title: RE: Inconsistent EJB JNDI Locations i'm reasonably new to this also, so i may be wrong! i have the application-client.xml in a META_INF directory which is beside my client application, so i think the client application InitialContext reads this file, it seems to work for me anyway.. hope this helps.. - Original Message - From: Margulies, Adam To: Orion-Interest Sent: Tuesday, March 13, 2001 8:41 PM Subject: RE: Inconsistent EJB JNDI Locations A related point? (I'm new to this and a bit confused) Purely as an academic exercise I tried to access my EJB from an external application. The Orion documentation on this is sparse to non-existant :( What ended up working for me is the following: 1. Write an application-client.xml (undocumented, but I figured it out from another example) application-client display-namePLJB User/display-name ejb-ref ejb-ref-namePLJB_User/ejb-ref-name ejb-ref-typeEntity/ejb-ref-type homecom.hotjobs.entity.UserHome/home remotecom.hotjobs.entity.User/remote /ejb-ref /application-client note: i used the full classnames for my home and remote interfaces 2. put the application-client.xml in the META-INF directory for my ejb.jar 3. redeploy my .ear 4. write the client 5. write my own getInitialContext() for this client public static Context getInitialContext() throws NamingException { Properties p = new Properties(); p.put("java.naming.factory.initial","com.evermind.server.ApplicationClientInitialContextFactory"); p.put("java.naming.provider.url","ormi://localhost/PLJB"); p.put("java.naming.security.principal","admin"); p.put("java.naming.security.credentials","whatever"); return new javax.naming.InitialContext(p); } 6. use the getInitialContext and then call lookup() using the _bean class name_(!?!?!) Then narrowing works. Context jndiContext = getInitialContext(); Object ref = jndiContext.lookup("UserBean"); UserHome home = (UserHome) PortableRemoteObject.narrow(ref,UserHome.class); My questions are: Why do I have to lookup() using the Bean class name? Why can't i lookup on either "PLJB_User" or "UserHome"? Am I hopelessly overcomplicating this? -Original Message- From: Karl Avedal [mailto:[EMAIL PROTECTED]] Sent: Monday, March 12, 2001 10:15 PM To: Orion-Interest Subject: Re: Inconsistent EJB JNDI Locations Hello Manne, That's right, that is the way we recommend it to be done. Just want to clarify something though. It is possible to lookup EJBs in another application. To do so, use the parent attribute when defining the application in server.xml and the children application's local context will extend the one of the parent, making it possible to use EJBs from another application. Regards, Karl Avedal Manne Fagerlind wrote: I used the JNDI name "java:comp/env/ejb/MyBean" yesterday and it worked fine (older version of Orion; hope they haven't changed it). It seems that the object performing the lookup must be located inside the same enterprise application (i.e. application-entry in server.xml) for this to work, though. /Manne -Original Message- From: Gary Shea [mailto:[EMAIL PROTECTED]] Sent: 09 March 2001 20:57 To: [EMAIL PROTECTED] Subject: Re: Inconsistent EJB JNDI Locations On Thu, 8 Mar 2001, Peter Pontbriand wrote: Yes, this is what works for us. Assuming that the Entity EJB is deployed with ejb-nameMyBean/ejb-name and that the Session EJB's deployment descriptor has an ejb-ref-nameejb/MyBean/ejb-ref-name, the home interface for MyBean is supposed to be found with 'lookup("java:comp/env/ejb/MyBean")'. Unfortunately, this doesn't work, but rather MyBean is found with 'lookup("MyBean")'. Recently I was looking at the spec while trying to figure out why Orion's JNDI setup isn't like the examples in the EJB books. Turns out that the java:comp/env/{jms,ejb,...} locations are 'recommended', not mandatory. Given that the non-Context contents of the env/ directory must be String objects, it doesn't surprise me that the Orion folks decided it was tacky to put objects underneath a directory that's supposed to hold strings. Also, I noticed when attempting to create objects below the env/ directory using the JNDI api, they somehow get turned into strings! I'm a little unclear on whether this really happened or if I was doing something stupid, but it's what I think I saw! Cheers, Gary
Serialised Hashtables (org.omg.corba exceptions)
Can any one help ? I have written an EntityBean which has a method called setConfigParams(long configID, PaymentConfig paymentConfig) I have defined the class PaymentConfig as serializable, within this class is a Hashtable to hold my key/value config parameters. I also have a piece of client code which instantiates the bean, get a reference successfully. However, when I call the setConfigParams() method I get the following error: java.rmi.MarshalException: CORBA MARSHAL 0 No; nested exception is: org.omg.CORBA.MARSHAL: minor code: 0 completed: No java.lang.NullPointerException at java.util.Hashtable.get(Hashtable.java:320) at com.sun.corba.ee.internal.io.FVDCodeBaseImpl.connect(FVDCodeBaseImpl. java:183) at com.sun.corba.ee.internal.iiop.IIOPConnection.getFVD(IIOPConnection.j ava:1065) at com.sun.corba.ee.internal.io.FVDCodeBaseDelegate.meta(FVDCodeBaseDele gate.java:85) at com.sun.corba.ee.internal.io.IIOPInputStream.getOrderedDescriptions(I IOPInputStream.java:821) at com.sun.corba.ee.internal.io.IIOPInputStream.inputObjectUsingFVD(IIOP InputStream.java:978) at com.sun.corba.ee.internal.io.IIOPInputStream.simpleReadObject(IIOPInp utStream.java:213) at com.sun.corba.ee.internal.io.ValueHandlerImpl.readValueInternal(Value HandlerImpl.java:234) at com.sun.corba.ee.internal.io.ValueHandlerImpl.readValue(ValueHandlerI mpl.java:164) at com.sun.corba.ee.internal.iiop.CDRInputStream.read_value(CDRInputStre am.java:996) at com.sun.corba.ee.internal.io.IIOPInputStream.inputClassFields(IIOPInp utStream.java:1349) at com.sun.corba.ee.internal.io.IIOPInputStream.inputObject(IIOPInputStr eam.java:785) at com.sun.corba.ee.internal.io.IIOPInputStream.simpleReadObject(IIOPInp utStream.java:216) at com.sun.corba.ee.internal.io.ValueHandlerImpl.readValueInternal(Value HandlerImpl.java:234) at com.sun.corba.ee.internal.io.ValueHandlerImpl.readValue(ValueHandlerI mpl.java:164) at com.sun.corba.ee.internal.iiop.CDRInputStream.read_value(CDRInputStre am.java:996) at com.sun.corba.ee.internal.io.IIOPInputStream.inputClassFields(IIOPInp utStream.java:1349) at com.sun.corba.ee.internal.io.IIOPInputStream.inputObject(IIOPInputStr eam.java:785) at com.sun.corba.ee.internal.io.IIOPInputStream.simpleReadObject(IIOPInp utStream.java:216) at com.sun.corba.ee.internal.io.ValueHandlerImpl.readValueInternal(Value HandlerImpl.java:234) at com.sun.corba.ee.internal.io.ValueHandlerImpl.readValue(ValueHandlerI mpl.java:164) at com.sun.corba.ee.internal.iiop.CDRInputStream.read_value(CDRInputStre am.java:996) at com.threegscene.openpayments.merchant._MerchantEJB_EJBObjectImpl_Tie. _invoke(Unknown Source) at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(Ge nericPOAServerSC.java:423) at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(Gen ericPOAServerSC.java:137) at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAS erverSC.java:98) at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:227) at com.sun.corba.ee.internal.iiop.CachedWorkerThread.doWork(IIOPConnecti on.java:262) at com.sun.corba.ee.internal.iiop.CachedWorkerThread.run(IIOPConnection. java:230) org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : null minor code: 0 completed: No at com.sun.corba.ee.internal.iiop.CDRInputStream.read_value(CDRInputStre am.java:1001) at com.sun.corba.ee.internal.io.IIOPInputStream.inputClassFields(IIOPInp utStream.java:1349) at com.sun.corba.ee.internal.io.IIOPInputStream.inputObject(IIOPInputStr eam.java:785) at com.sun.corba.ee.internal.io.IIOPInputStream.simpleReadObject(IIOPInp utStream.java:216) at com.sun.corba.ee.internal.io.ValueHandlerImpl.readValueInternal(Value HandlerImpl.java:234) at com.sun.corba.ee.internal.io.ValueHandlerImpl.readValue(ValueHandlerI mpl.java:164) at com.sun.corba.ee.internal.iiop.CDRInputStream.read_value(CDRInputStre am.java:996) at com.sun.corba.ee.internal.io.IIOPInputStream.inputClassFields(IIOPInp utStream.java:1349) at com.sun.corba.ee.internal.io.IIOPInputStream.inputObject(IIOPInputStr eam.java:785) at com.sun.corba.ee.internal.io.IIOPInputStream.simpleReadObject(IIOPInp utStream.java:216) at com.sun.corba.ee.internal.io.ValueHandlerImpl.readValueInternal(Value HandlerImpl.java:234) at com.sun.corba.ee.internal.io.ValueHandlerImpl.readValue(ValueHandlerI mpl.java:164) at com.sun.corba.ee.internal.iiop.CDRInputStream.read_value(CDRInputStre am.java:996) at com.threegscene.openpayments.merchant._MerchantEJB_EJBObjectImpl_Tie. _invoke(Unknown Source) at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(Ge
RE: Custom UserManager.
Michael, Are you using RoleManager to do a login? The call should look something like this (pulled from our CheckLogin action): // Login InitialContext context = new InitialContext(); RoleManager roleManager = (RoleManager) context.lookup("java:comp/RoleManager"); roleManager.login(username, password); There is a little bit of documentation on it's use in the docs directory at: \orion\docs\api\com\evermind\security\RoleManager.html -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Michael Gantz Sent: Friday, March 16, 2001 12:40 AM To: Orion-Interest Subject: Custom UserManager. Server : Orion-1.4.5 I've created a custom UserManager and referenced it in application.xml, I've taken out the principal tags in all the other files. Here is my problem: my custom user manager loads up and the init method gets called but that's it. The server never calls getUser on my user manager. I'm very sure I'm missing something really silly and simple but I can't find it due to the complete lack of adequate documentation. Thanks in advance. Michael L. Gantz
Re: Custom UserManager.
Slight progress update. I'm convinced now I don't have something configured correctly. In my UserManager, when setParent is called I did a setParent(this) on the parent that was passed in. After that, my manager started receiving method calls to things like getUser. I also noticed that my setParent was being called with an XMLUserManager as it's parameter. Hopefully somebody can shine some light on this situation for me. Thanks... Original Message On 3/16/01, 12:40:06 AM, Michael Gantz [EMAIL PROTECTED] wrote regarding Custom UserManager.: Server : Orion-1.4.5 I've created a custom UserManager and referenced it in application.xml, I've taken out the principal tags in all the other files. Here is my problem: my custom user manager loads up and the init method gets called but that's it. The server never calls getUser on my user manager. I'm very sure I'm missing something really silly and simple but I can't find it due to the complete lack of adequate documentation. Thanks in advance. Michael L. Gantz
RE: offtopic: Path issues
I don't see this as a spec bug, I think it's quite deliberate. Sometimes you need to redirect to sth outside the web app. What'd be the point of having sendRedirect() duplicate the functionality of the RequestDispatcher? /Manne NOTE: All JSP commands are relative to the web app root EXCEPT response.sendRedirect() which is relative to the host (stupid spec bug!) so you need to put an rcp in front of that.
Re: Character encoding problem
Have you submitted a bug report for this on orionserver.com's bugzilla? Just a thought. Dan. At 09:36 16/03/2001 +0100, you wrote: Once again since my yesterdays posting seems to be lost: Hi Orion Masters, When I put line: response.setContentType("text/html;charset=ISO-8859-2"); into my servlet's doGet method, I don't get response from the servlet. Moreover, Orion starts consuming ~100% of CPU until restarted. When I use: response.setContentType("text/html"); I get the response, but naturally without my national charset. The problem occurs on 1.4.5, I didn't have it on 1.2.9. JSP encoding works fine. When I get its java code and put it as servlet, it works too. If I change my servlet to extend com.evermind.server.http.EvermindHttpJspPage instead of HttpServlet (and change doGet to _jspService, and so) it starts working, but it is not solution I would accept. So how can I have charset definition in servlets working? Thanks in advance, Rafal p.s. If it helps, I have Orion on NT Workstation installed. -- Dan North VP Development - Cadrion Software Ltd - +44 (0)20 7440 9550 CONFIDENTIALITY This e-mail and any attachments are confidential and may also be privileged. If you are not the named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose, or store or copy the information in any medium
RE: Problems with JNDI lookups of ejb-ref-name defined in application-client.xml from a client application...
Hia guys, Here is a bit of my experience with this stuff - I found out that if I have a regular Java client it's the ejb-jar.xml's ejb-name that is being used to lookup the bean name without the comp/env. The comp/env is only to be used by J2ee clients i.e. servlets or JSPs. For the J2EE clients, it is the ejb-ref name that is used in the lookup. It's weird as all hell !! But that how I found out about this. IN other words whatever you are using for the Home's lookup will depend on the type of client you are using. To recap - for Java clients use lookup("beanName") for J2EE clients ("java:comp/env/beanName") Try giving this a try Good Luck -Original Message- From: Magnus Rydin [SMTP:[EMAIL PROTECTED]] Sent: Friday, March 16, 2001 4:30 AM To: Orion-Interest Subject:SV: Problems with JNDI lookups of ejb-ref-name defined in application-client.xml from a client application... Did you try looking up "java:comp/env/ejb/id" ? WR -Ursprungligt meddelande- Frn: Alex Paransky [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Skickat: den 15 mars 2001 14:11 Till: Orion-Interest mne: Problems with JNDI lookups of ejb-ref-name defined in application-client.xml from a client application... I have a client application which has META-INF with the following application-client.xml definition: application-client ejb-ref ejb-ref-nameejb/id/ejb-ref-name ejb-ref-typeSession/ejb-ref-type homecom.indnet.model.id.IdSessionHome/home remotecom.indnet.model.id.IdSession/remote ejb-linkId/ejb-link /ejb-ref /application-client In the client, I attempt to do the following: new InitialContext().lookup("ejb/id"); The above fails with the naming exception, telling me that ejb/id cannot be found: Exception in thread "main" javax.naming.NameNotFoundException: ejb/id not found at com.evermind.server.rmi.RMIContext.lookup(JAX) at com.evermind.naming.jz.lookup(JAX) at javax.naming.InitialContext.lookup(InitialContext.java:350) at com.indnet.model.id.test.Client.main(Client.java:16) If I change my client line to read: new InitialContext().lookup("Id"); Things work correctly. "Id" is the ejb-name used for my object: enterprise-beans session ejb-nameId/ejb-name homecom.indnet.model.id.IdSessionHome/home remotecom.indnet.model.id.IdSession/remote ejb-classcom.indnet.model.id.IdSessionBean/ejb-class session-typeStateless/session-type ... What is the purpose of application-client.xml if I cannot create references and use the name specified in ejb-ref-name to lookup the components? Or am I missing something? Thanks. -AP_
Problem with PostFileInputStream
Is anyone else having problems with PostFileInputStream.read(byte[], int, int) throwing ArrayIndexOutOfBoundsException's? I saw the post by Jason von Nieda on September 27, 2000, but no responses or resolutions other than not using it. I just entered a report into Bugzilla, #366. If anyone has any insight, please let me know. - Ernie Phelps
Re: Custom UserManager.
The DataSourceUserManager that is provided with Orion exhibits this same problem - the principals.xml must still contain the group declarations. We've created out own custom UserManager that uses our User and Group EJBs. This custom user manager will work fine for EJB and Web modules without anything in the principals.xml, but it fails miserably with Application Client modules. It is impossible to login with Application Clients no matter what's in the DB or in principals.xml. P. Pontbriand Canlink Interactive Technologies Inc. - Original Message - From: "Christian Billen" [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Sent: Friday, March 16, 2001 2:17 AM Subject: RE: Custom UserManager. I don't know what type of User manager you made, but I had problems using EJBUserManager, I had to leave the principals.xml containing all my groups (not my users) and the link to it in orion-application.xml. I struggled for a while on this since it doesn't make sense as all my users are in the database. Maybe it is something related somehow and you could try it out? Christian -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Michael Gantz Sent: Thursday, March 15, 2001 11:40 PM To: Orion-Interest Subject: Custom UserManager. Server : Orion-1.4.5 I've created a custom UserManager and referenced it in application.xml, I've taken out the principal tags in all the other files. Here is my problem: my custom user manager loads up and the init method gets called but that's it. The server never calls getUser on my user manager. I'm very sure I'm missing something really silly and simple but I can't find it due to the complete lack of adequate documentation. Thanks in advance. Michael L. Gantz
Re: Problems with JNDI lookups of ejb-ref-name defined in application-client.xml from a client application...
Just a sidenote, maybe it's your problem. From page 377 of Enterprise JavaBeans, 2nd Edition (Oreilly): "The ejb-link value must match one of the ejb-name values declared in the same deployment descriptor." That is, it's only valid if you're using an ejb-jar.xml to define multiple beans. Jeff Hubbach. Alex Paransky wrote: I have a client application which has META-INF with the following application-client.xml definition: application-client ejb-ref ejb-ref-nameejb/id/ejb-ref-name ejb-ref-typeSession/ejb-ref-type homecom.indnet.model.id.IdSessionHome/home remotecom.indnet.model.id.IdSession/remote ejb-linkId/ejb-link /ejb-ref /application-client In the client, I attempt to do the following: new InitialContext().lookup("ejb/id"); The above fails with the naming exception, telling me that ejb/id cannot be found: Exception in thread "main" javax.naming.NameNotFoundException: ejb/id not found at com.evermind.server.rmi.RMIContext.lookup(JAX) at com.evermind.naming.jz.lookup(JAX) at javax.naming.InitialContext.lookup(InitialContext.java:350) at com.indnet.model.id.test.Client.main(Client.java:16) If I change my client line to read: new InitialContext().lookup("Id"); Things work correctly. "Id" is the ejb-name used for my object: enterprise-beans session ejb-nameId/ejb-name homecom.indnet.model.id.IdSessionHome/home remotecom.indnet.model.id.IdSession/remote ejb-classcom.indnet.model.id.IdSessionBean/ejb-class session-typeStateless/session-type ... What is the purpose of application-client.xml if I cannot create references and use the name specified in ejb-ref-name to lookup the components? Or am I missing something? Thanks. -AP_ -- Jeff Hubbach Internet Developer New Media Designs, Inc. www.nmd.com
Re: Custom UserManager.
When using a custom user manager with an application, you must make sure you are getting your DataSource references in the constructor. This is extremely important. If you try to lookup the DataSource outside of the constructor, you will have all sorts of problems. Do something like this... private DataSource ds; public MyUserManager() { ... try { InitialContext context = new InitialContext(); ds = (DataSource) context.lookup("jdbc/OraclePooledDS"); } catch (NamingException ne) { ne.printStackTrace(); } } public Connection getConnection() throws SQLException { return ds.getConnection(); } James Birchfield Ironmax maximizing your construction equipment assets 5 Corporate Center 9960 Corporate Campus Drive, Suite 2000 Louisville, KY 40223 "Peter Pontbriand" peter.pontbriand@canlink.To: Orion-Interest [EMAIL PROTECTED] com cc: Sent by: Subject: Re: Custom UserManager. owner-orion-interest@orion server.com 03/16/01 10:14 AM Please respond to Orion-Interest The DataSourceUserManager that is provided with Orion exhibits this same problem - the principals.xml must still contain the group declarations. We've created out own custom UserManager that uses our User and Group EJBs. This custom user manager will work fine for EJB and Web modules without anything in the principals.xml, but it fails miserably with Application Client modules. It is impossible to login with Application Clients no matter what's in the DB or in principals.xml. P. Pontbriand Canlink Interactive Technologies Inc. - Original Message - From: "Christian Billen" [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Sent: Friday, March 16, 2001 2:17 AM Subject: RE: Custom UserManager. I don't know what type of User manager you made, but I had problems using EJBUserManager, I had to leave the principals.xml containing all my groups (not my users) and the link to it in orion-application.xml. I struggled for a while on this since it doesn't make sense as all my users are in the database. Maybe it is something related somehow and you could try it out? Christian -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Michael Gantz Sent: Thursday, March 15, 2001 11:40 PM To: Orion-Interest Subject: Custom UserManager. Server : Orion-1.4.5 I've created a custom UserManager and referenced it in application.xml, I've taken out the principal tags in all the other files. Here is my problem: my custom user manager loads up and the init method gets called but that's it. The server never calls getUser on my user manager. I'm very sure I'm missing something really silly and simple but I can't find it due to the complete lack of adequate documentation. Thanks in advance. Michael L. Gantz
RE: Orion with PostgreSQL (oid)
Hi Armin, A bit of further digging (sorry to other listers, last couple of emails on this were sent to Armin only) into the source for the Postgres JDBC drivers for version 7.0 reveals the following little snippet: public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException { throw new PSQLException("postgresql.prep.is"); } - I guess somebody hasn't gotten around to implemening it yet :-( (that "postgresql.prep.is" error translates to the "InputStream as parameter not supported" error you mentioned) If you really need this to work with postgres I suppose that leaves a few options: 1) wrap the Postgres drivers and use the Large Objects API behind the scenes 2) fix the Postgres 7.0 drivers! (I think it's open-source right, and anybody can dive in and sort stuff out?) 3) Use BMP in Orion and use the (non-portable) Postgres Large Objects API there 4) downgrade to Postgres 6.5 where I assume this worked (there are people on the list using Postgres via JDBC, right?) 5) Wait for this to be fixed (I assume it's fairly high on the Postgres bug list) option 6 is to give up and use another database (which I personally don't like the sound of having used up a day or so getting postgres installed and configured! Depends how long it'll take to work around the problems though) cheers Jules -- From: Armin Michel[SMTP:[EMAIL PROTECTED]] Sent: 16 March 2001 09:49 To: Orion-Interest Subject: Orion with PostgreSQL (oid) I got some problems with PostgreSQL and Orion when using blobs (oids in the table). I checked: http://www.postgresql.org/users-lounge/docs/7.0/programmer/jdbc6519.htm In the above page you can read the following example: snip To insert an image, you would use: File file = new File("myimage.gif"); FileInputStream fis = new FileInputStream(file); PreparedStatement ps = conn.prepareStatement("insert into images values (?,?)"); ps.setString(1,file.getName()); ps.setBinaryStream(2,fis,file.length()); ps.executeUpdate(); ps.close(); fis.close();" /snip This does a PreparedStatement.setBinaryStream(int,InputStream,int); - Exactly what Orion did! Here is the interesting part of the Exception.printStackTrace(); : snip Nested exception is: InputStream as parameter not supported at java.lang.Throwable.(Throwable.java:84) at java.lang.Exception.(Exception.java:35) at java.sql.SQLException.(SQLException.java:100) at org.postgresql.util.PSQLException.(PSQLException.java:22) at org.postgresql.jdbc2.PreparedStatement.setBinaryStream(PreparedStatement .java:417) at com.evermind.sql.ao.setBinaryStream(JAX) /snip So, this would lead to the conclusion, that Orion just tries to use a standard JDBC-API. Maybe Orion uses a special subclass of InputStream and the JDBC-Driver doesn't correctly account for this situation. In the JDBC API it reads: snip Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface. /snip This would blame the JDBC-driver then? Yours Armin
RE: Problems with JNDI lookups of ejb-ref-name defined inapplication-client.xml from a client application...
You are exactly correct. This IS how it is working in Orion but this does not seem to the correct. Suppose you have an EJB that implements some STANDARD interface already defined, deployed and used by many applications and from many places. You buy a client application from a vendor who has implemented a new GUI to work with this STANDARD interface. The vendor defines application-client.xml and you need to augment it with ejb-link to point to the actual bean. The vendor DOES NOT know what is the REAL PHYSICAL name of the bean which implemented the STANDARD interface in your environment, so there is no way for the vendor to do a lookup based on "beanName". The client vendor writes his application to lookup on the value in ejb-ref-name. If this is the way Orion is working, this appears to be somewhat of a serious bug. By the way, when I try to use "java:comp/env" from my client, I get the following exception: Exception in thread "main" javax.naming.NamingException: java:comp/env namespace is only available from within a J2EE component at com.sun.enterprise.naming.java.javaURLContext.getComponentContext(javaURLCon text.java:392) at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:51) at javax.naming.InitialContext.lookup(InitialContext.java:350) at client.PersonClient.main(PersonClient.java:25) Should I record this as a bug, or does any one have other ideas? Thanks to all that replied -AP_ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Bruno Baloi Sent: Friday, March 16, 2001 6:54 AM To: Orion-Interest Subject: RE: Problems with JNDI lookups of ejb-ref-name defined in application-client.xml from a client application... Hia guys, Here is a bit of my experience with this stuff - I found out that if I have a regular Java client it's the ejb-jar.xml's ejb-name that is being used to lookup the bean name without the comp/env. The comp/env is only to be used by J2ee clients i.e. servlets or JSPs. For the J2EE clients, it is the ejb-ref name that is used in the lookup. It's weird as all hell !! But that how I found out about this. IN other words whatever you are using for the Home's lookup will depend on the type of client you are using. To recap - for Java clients use lookup("beanName") for J2EE clients ("java:comp/env/beanName") Try giving this a try Good Luck -Original Message- From: Magnus Rydin [SMTP:[EMAIL PROTECTED]] Sent: Friday, March 16, 2001 4:30 AM To: Orion-Interest Subject:SV: Problems with JNDI lookups of ejb-ref-name defined in application-client.xml from a client application... Did you try looking up "java:comp/env/ejb/id" ? WR -Ursprungligt meddelande- Frn: Alex Paransky [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Skickat: den 15 mars 2001 14:11 Till: Orion-Interest mne: Problems with JNDI lookups of ejb-ref-name defined in application-client.xml from a client application... I have a client application which has META-INF with the following application-client.xml definition: application-client ejb-ref ejb-ref-nameejb/id/ejb-ref-name ejb-ref-typeSession/ejb-ref-type homecom.indnet.model.id.IdSessionHome/home remotecom.indnet.model.id.IdSession/remote ejb-linkId/ejb-link /ejb-ref /application-client In the client, I attempt to do the following: new InitialContext().lookup("ejb/id"); The above fails with the naming exception, telling me that ejb/id cannot be found: Exception in thread "main" javax.naming.NameNotFoundException: ejb/id not found at com.evermind.server.rmi.RMIContext.lookup(JAX) at com.evermind.naming.jz.lookup(JAX) at javax.naming.InitialContext.lookup(InitialContext.java:350) at com.indnet.model.id.test.Client.main(Client.java:16) If I change my client line to read: new InitialContext().lookup("Id"); Things work correctly. "Id" is the ejb-name used for my object: enterprise-beans session ejb-nameId/ejb-name homecom.indnet.model.id.IdSessionHome/home remotecom.indnet.model.id.IdSession/remote ejb-classcom.indnet.model.id.IdSessionBean/ejb-class session-typeStateless/session-type ... What is the purpose of application-client.xml if I cannot create references and use the name specified in ejb-ref-name to lookup the components? Or am I missing something?
RE: Problems with JNDI lookups of ejb-ref-name defined in application-client.xml from a client application...
I tried that before, and got the following exception: Exception in thread "main" javax.naming.NamingException: java:comp/env namespace is only available from within a J2EE component at com.sun.enterprise.naming.java.javaURLContext.getComponentContext(javaURLContext.java:392) at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:51) at javax.naming.InitialContext.lookup(InitialContext.java:350) at client.PersonClient.main(PersonClient.java:25) Is this a bug? -AP_ -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Magnus RydinSent: Friday, March 16, 2001 1:30 AMTo: Orion-InterestSubject: SV: Problems with JNDI lookups of ejb-ref-name defined in appli cation-client.xml from a client application... Did you try looking up "java:comp/env/ejb/id" ? WR -Ursprungligt meddelande- Från: Alex Paransky [mailto:[EMAIL PROTECTED]] Skickat: den 15 mars 2001 14:11 Till: Orion-Interest Ämne: Problems with JNDI lookups of ejb-ref-name defined in application-client.xml from a client application... I have a client application which has META-INF with the following application-client.xml definition: application-client ejb-ref ejb-ref-nameejb/id/ejb-ref-name ejb-ref-typeSession/ejb-ref-type homecom.indnet.model.id.IdSessionHome/home remotecom.indnet.model.id.IdSession/remote ejb-linkId/ejb-link /ejb-ref /application-client In the client, I attempt to do the following: new InitialContext().lookup("ejb/id"); The above fails with the naming exception, telling me that ejb/id cannot be found: Exception in thread "main" javax.naming.NameNotFoundException: ejb/id not found at com.evermind.server.rmi.RMIContext.lookup(JAX) at com.evermind.naming.jz.lookup(JAX) at javax.naming.InitialContext.lookup(InitialContext.java:350) at com.indnet.model.id.test.Client.main(Client.java:16) If I change my client line to read: new InitialContext().lookup("Id"); Things work correctly. "Id" is the ejb-name used for my object: enterprise-beans session ejb-nameId/ejb-name homecom.indnet.model.id.IdSessionHome/home remotecom.indnet.model.id.IdSession/remote ejb-classcom.indnet.model.id.IdSessionBean/ejb-class session-typeStateless/session-type ... What is the purpose of application-client.xml if I cannot create references and use the name specified in ejb-ref-name to lookup the components? Or am I missing something? Thanks. -AP_
RE: Problems with JNDI lookups of ejb-ref-name defined inapplication-client.xml from a client application...
Well, if that's the case, then what's the point of putting ejb-ref in to the application-client? The client can just always lookup by absolute name inthe JNDI namespace. And how would an independent client developer possibly know the EJB names deployed in your custom environment? -AP_ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jeff Hubbach Sent: Friday, March 16, 2001 8:00 AM To: Orion-Interest Subject: Re: Problems with JNDI lookups of ejb-ref-name defined in application-client.xml from a client application... Just a sidenote, maybe it's your problem. From page 377 of Enterprise JavaBeans, 2nd Edition (Oreilly): "The ejb-link value must match one of the ejb-name values declared in the same deployment descriptor." That is, it's only valid if you're using an ejb-jar.xml to define multiple beans. Jeff Hubbach. Alex Paransky wrote: I have a client application which has META-INF with the following application-client.xml definition: application-client ejb-ref ejb-ref-nameejb/id/ejb-ref-name ejb-ref-typeSession/ejb-ref-type homecom.indnet.model.id.IdSessionHome/home remotecom.indnet.model.id.IdSession/remote ejb-linkId/ejb-link /ejb-ref /application-client In the client, I attempt to do the following: new InitialContext().lookup("ejb/id"); The above fails with the naming exception, telling me that ejb/id cannot be found: Exception in thread "main" javax.naming.NameNotFoundException: ejb/id not found at com.evermind.server.rmi.RMIContext.lookup(JAX) at com.evermind.naming.jz.lookup(JAX) at javax.naming.InitialContext.lookup(InitialContext.java:350) at com.indnet.model.id.test.Client.main(Client.java:16) If I change my client line to read: new InitialContext().lookup("Id"); Things work correctly. "Id" is the ejb-name used for my object: enterprise-beans session ejb-nameId/ejb-name homecom.indnet.model.id.IdSessionHome/home remotecom.indnet.model.id.IdSession/remote ejb-classcom.indnet.model.id.IdSessionBean/ejb-class session-typeStateless/session-type ... What is the purpose of application-client.xml if I cannot create references and use the name specified in ejb-ref-name to lookup the components? Or am I missing something? Thanks. -AP_ -- Jeff Hubbach Internet Developer New Media Designs, Inc. www.nmd.com
RE: Custom UserManager.
Ernie, No, I'm using BASIC and FORM authorization, and I'm trying really badly to not have to have any Users or Groups in principals.xml. I have a separate system that contains login and roles information. I did find (mentioned in another post that I myself made) that if I do a parent.setParent(this) in my UserManagers setParent method that things actually work correctly, I have no idea why this is. When my setParent method gets called it is passed an XMLUserManager as the parent, I think what is happening is, with the principals file gone, that the real UserManager sees mine as the parent and defaults to it, as opposed to working the other way around. Maybe that wasn't as clear as I had hoped, I'm calling setParent(this) on the usermanager that is passed as an argument to my usermanagers setParent method. The difficulty of this issue really concerns me because J2ee is not very useful if I have to duplicate my user and roles data into a server specific location, and then try and maintain both sets of data. Thanks From: Ernie Phelps Subject: RE: Custom UserManager. Date: Fri, 16 Mar 2001 04:41:15 -0800 Michael, Are you using RoleManager to do a login? The call should look something like this (pulled from our CheckLogin action): // Login InitialContext context = new InitialContext(); RoleManager roleManager = (RoleManager) context.lookup("java:comp/RoleManager"); roleManager.login(username, password); There is a little bit of documentation on it's use in the docs directory at: \orion\docs\api\com\evermind\security\RoleManager.html -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Michael Gantz Sent: Friday, March 16, 2001 12:40 AM To: Orion-Interest Subject: Custom UserManager. Server : Orion-1.4.5 I've created a custom UserManager and referenced it in application.xml, I've taken out the principal tags in all the other files. Here is my problem: my custom user manager loads up and the init method gets called but that's it. The server never calls getUser on my user manager. I'm very sure I'm missing something really silly and simple but I can't find it due to the complete lack of adequate documentation. Thanks in advance. Michael L. Gantz -- Michael L. Gantz Great Lakes Technology Group [EMAIL PROTECTED]
RE: Custom UserManager.
I have a fully functional home-brewn imp. of UserManager and I do nothing in the setParent method. Just for you to know, HTH JP -Original Message- From: Michael Gantz [mailto:[EMAIL PROTECTED]] Sent: Friday, March 16, 2001 9:24 AM To: Orion-Interest Subject: Re: Custom UserManager. Slight progress update. I'm convinced now I don't have something configured correctly. In my UserManager, when setParent is called I did a setParent(this) on the parent that was passed in. After that, my manager started receiving method calls to things like getUser. I also noticed that my setParent was being called with an XMLUserManager as it's parameter. Hopefully somebody can shine some light on this situation for me. Thanks... Original Message On 3/16/01, 12:40:06 AM, Michael Gantz [EMAIL PROTECTED] wrote regarding Custom UserManager.: Server : Orion-1.4.5 I've created a custom UserManager and referenced it in application.xml, I've taken out the principal tags in all the other files. Here is my problem: my custom user manager loads up and the init method gets called but that's it. The server never calls getUser on my user manager. I'm very sure I'm missing something really silly and simple but I can't find it due to the complete lack of adequate documentation. Thanks in advance. Michael L. Gantz
RE: No suitable driver exception
Thanks for the advice, still not working. Getting a different Error when trying the EJB data source. ANy ideas? Exception in thread "main" java.lang.NullPointerException at com.evermind.sql.OrionPooledDataSource.ej(JAX) at com.evermind.sql.OrionPooledDataSource.d8(JAX) at com.evermind.sql.ak.eo(JAX) at com.evermind.sql.ak.ep(JAX) at com.evermind.sql.ap.createStatement(JAX) at Test.main(Test.java:33) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 15, 2001 11:14 PM To: Orion-Interest Subject: Re: No suitable driver exception Try: DataSource ds = (DataSource)ctx.lookup("jdbc/OracleDS"); instead of DataSource ds = (DataSource)ctx.lookup("jdbc/OracleCoreDS"); regards /Theis.
Re: Custom UserManager.
Good point. However, our User and Group EJBs are exclusively CMP - we don't get any DataSources outside of the constructor or inside it. We'll give the delegate-to-parent-UserManager trick a shot, but I still think that such things should be unnecessary. Why should the fact that a client is an Application Client Module rather than a Web Module make any difference to the way UserManager implementations work? P. Pontbriand Canlink Interactive Technologies Inc. - Original Message - From: [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Cc: "Orion-Interest" [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, March 16, 2001 11:51 AM Subject: Re: Custom UserManager. When using a custom user manager with an application, you must make sure you are getting your DataSource references in the constructor. This is extremely important. If you try to lookup the DataSource outside of the constructor, you will have all sorts of problems. Do something like this... private DataSource ds; public MyUserManager() { ... try { InitialContext context = new InitialContext(); ds = (DataSource) context.lookup("jdbc/OraclePooledDS"); } catch (NamingException ne) { ne.printStackTrace(); } } public Connection getConnection() throws SQLException { return ds.getConnection(); } James Birchfield Ironmax maximizing your construction equipment assets 5 Corporate Center 9960 Corporate Campus Drive, Suite 2000 Louisville, KY 40223 "Peter Pontbriand" peter.pontbriand@canlink.To: Orion-Interest [EMAIL PROTECTED] com cc: Sent by: Subject: Re: Custom UserManager. owner-orion-interest@orion server.com 03/16/01 10:14 AM Please respond to Orion-Interest The DataSourceUserManager that is provided with Orion exhibits this same problem - the principals.xml must still contain the group declarations. We've created out own custom UserManager that uses our User and Group EJBs. This custom user manager will work fine for EJB and Web modules without anything in the principals.xml, but it fails miserably with Application Client modules. It is impossible to login with Application Clients no matter what's in the DB or in principals.xml. P. Pontbriand Canlink Interactive Technologies Inc. - Original Message - From: "Christian Billen" [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Sent: Friday, March 16, 2001 2:17 AM Subject: RE: Custom UserManager. I don't know what type of User manager you made, but I had problems using EJBUserManager, I had to leave the principals.xml containing all my groups (not my users) and the link to it in orion-application.xml. I struggled for a while on this since it doesn't make sense as all my users are in the database. Maybe it is something related somehow and you could try it out? Christian -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Michael Gantz Sent: Thursday, March 15, 2001 11:40 PM To: Orion-Interest Subject: Custom UserManager. Server : Orion-1.4.5 I've created a custom UserManager and referenced it in application.xml, I've taken out the principal tags in all the other files. Here is my problem: my custom user manager loads up and the init method gets called but that's it. The server never calls getUser on my user manager. I'm very sure I'm missing something really silly and simple but I can't find it due to the complete lack of adequate documentation. Thanks in advance. Michael L. Gantz
JNDI problems from client applications!!!
This error message occurs when I have an application-client.xml without any ejb-ref entities in there and orion server has been restarted prior to start up of client. The second time around client works correctly. Exception in thread "main" javax.naming.NamingException: Disconnected: Unknown c ommand: 7 at com.evermind.server.rmi.RMIContext.lookup(JAX) at com.evermind.naming.jz.lookup(JAX) at javax.naming.InitialContext.lookup(InitialContext.java:350) at com.indnet.model.user.test.Client.main(Client.java:22) If on the other hand, I put a reference to the bean that the client is using into the application-client using ejb-ref, I get the following exception when the client first starts up after orion restart: Exception in thread "main" javax.naming.NamingException: Error reading application-client descriptor: No location specified and no suitable instance of the type 'com.indnet.model.IdSession' found for the ejb-ref com.indnet.model.Id at com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext (JAX) at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:668) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246) at javax.naming.InitialContext.init(InitialContext.java:222) at javax.naming.InitialContext.init(InitialContext.java:178) at com.indnet.model.common.InitialContextFinder.getContext(InitialContextFinder .java:27) at com.indnet.model.common.InitialContextFinder.getInitialContext(InitialContex tFinder.java:13) at com.indnet.model.user.test.Client.main(Client.java:17) The second time I run the client, it works! What's going on? -AP_
Re: Custom UserManager.
Don't user setParent. Just leave it as an empty method. I do that and it works just fine. Matt On Fri, 16 Mar 2001, Michael Gantz wrote: Slight progress update. I'm convinced now I don't have something configured correctly. In my UserManager, when setParent is called I did a setParent(this) on the parent that was passed in. After that, my manager started receiving method calls to things like getUser. I also noticed that my setParent was being called with an XMLUserManager as it's parameter. Hopefully somebody can shine some light on this situation for me. Thanks... Original Message On 3/16/01, 12:40:06 AM, Michael Gantz [EMAIL PROTECTED] wrote regarding Custom UserManager.: Server : Orion-1.4.5 I've created a custom UserManager and referenced it in application.xml, I've taken out the principal tags in all the other files. Here is my problem: my custom user manager loads up and the init method gets called but that's it. The server never calls getUser on my user manager. I'm very sure I'm missing something really silly and simple but I can't find it due to the complete lack of adequate documentation. Thanks in advance. Michael L. Gantz
RE: No suitable driver exception
Here's pieces of a test program I wrote about a year ago when we were looking at BMP - it's not great code, but it worked. This ran with Sybase and Hypersonic; the Sybase data-sources.xml section is below (the Hypersonic version was as-shipped with around 1.0). Hope this helps... Kirk Yarina /** * update a row in the database */ private void updateRow() throws FinderException { // if ( ! this.isModified ) return; String updateStatement = "UPDATE address set " + "addr1 = ?," + "addr2 = ?," + "addr3 = ?," + "city = ?," + "state = ?," + "zipcode = ?," + "country = ? " + "where id = ?"; Connection con = null; PreparedStatement ps = null; try { con = this.getConnection(); ps = con.prepareStatement(updateStatement); int ix = 1; ps.setString(ix++,this.addr1); ps.setString(ix++,this.addr2); ps.setString(ix++,this.addr3); ps.setString(ix++,this.city); ps.setString(ix++,this.state); ps.setString(ix++,this.zipcode); ps.setString(ix++,this.country); // where id = ? ps.setLong(ix,this.id); if (ps.executeUpdate() != 1) { throw new FinderException ("Store address.id "+this.id); } } catch (SQLException se) { se.printStackTrace( System.err ); throw new EJBException( "updateRow "+se.getMessage() ); } finally { try { if ( ps != null ) ps.close(); if ( con != null ) con.close(); } catch (Exception e) {}; // ignore SQLExceptions... } } private Connection getConnection() { String dsName = "jdbc/DefaultEJBDS"; // Pooled connections InitialContext initialContext = null; try { initialContext = new InitialContext(); } catch ( Exception ex ) { System.err.println( "-- Getting Initial Context --" ); ex.printStackTrace( System.err ); throw new EJBException ("getting address initialContext, " + ex.getMessage() ); } try { DataSource ds = (DataSource) initialContext.lookup( dsName ); return ds.getConnection(); } catch ( Exception ex ) { System.err.println ( "-- looking up DataSource '" + dsName + "' --" ); ex.printStackTrace( System.err ); throw new EJBException ( "looking up dsName '" + dsName + "', " + ex.getMessage() ); } - data-source name="Default data-source" class="com.evermind.sql.ConnectionDataSource" location="jdbc/DefaultDS" pooled-location="jdbc/DefaultPooledDS" xa-location="jdbc/xa/DefaultXADS" ejb-location="jdbc/DefaultEJBDS" url="jdbc:sybase:Tds:some.server.com:4100/somedb" connection-driver="com.sybase.jdbc2.jdbc.SybDriver" username="*" password="*" schema="database-schemas/sybase.xml" / At 11:19 AM 3/16/01 -0800, you wrote: Thanks for the advice, still not working. Getting a different Error when trying the EJB data source. ANy ideas? Exception in thread "main" java.lang.NullPointerException at com.evermind.sql.OrionPooledDataSource.ej(JAX) at com.evermind.sql.OrionPooledDataSource.d8(JAX) at com.evermind.sql.ak.eo(JAX) at com.evermind.sql.ak.ep(JAX) at com.evermind.sql.ap.createStatement(JAX) at Test.main(Test.java:33) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 15, 2001 11:14 PM To: Orion-Interest Subject: Re: No suitable driver exception Try: DataSource ds = (DataSource)ctx.lookup("jdbc/OracleDS"); instead of DataSource ds = (DataSource)ctx.lookup("jdbc/OracleCoreDS"); regards /Theis.
Custom UserManager - Answers are for the wrong question.
I'll try again because I don't think I made myself clear when I explained it. I'm using basic authorization with the browser. My custom user manager gets constructed and the init method gets called (I logged those events to a file from the class). But here is the kicker, the "getUser" method NEVER gets called by the server! Therefore all authentications fail. The only change I made to the orion configuration was add the user-manager tag in config/application.xml. Did I miss something obvious? Thanks. P.S. This product looks really good otherwise, but I need to get around this issue.
RE: offtopic: Path issues
Because sendRedirect is fundamentally completely different to the RequestDispatcher? It sends a 302 response back to the client and the client browser re-requests the new URL. RequestDispatcher only performs internal includes and forwards, so the client never knows it was used. If you need fo forward to another URL, you can always use a full URL. Not much point arguing over it though, the spec team did at length and IMHO the good guys lost ;) -mike -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Manne Fagerlind Sent: Saturday, March 17, 2001 12:55 AM To: Orion-Interest Subject: RE: offtopic: Path issues I don't see this as a spec bug, I think it's quite deliberate. Sometimes you need to redirect to sth outside the web app. What'd be the point of having sendRedirect() duplicate the functionality of the RequestDispatcher? /Manne NOTE: All JSP commands are relative to the web app root EXCEPT response.sendRedirect() which is relative to the host (stupid spec bug!) so you need to put an rcp in front of that.
RE: Orion with PostgreSQL (oid)
I suggest you email the postgresql-jdbc list and ask someone to implement it. The list is very active and people are usually quite responsive. -mike -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Julian Richardson Sent: Saturday, March 17, 2001 3:56 AM To: Orion-Interest Cc: '[EMAIL PROTECTED]' Subject: RE: Orion with PostgreSQL (oid) Hi Armin, A bit of further digging (sorry to other listers, last couple of emails on this were sent to Armin only) into the source for the Postgres JDBC drivers for version 7.0 reveals the following little snippet: public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException { throw new PSQLException("postgresql.prep.is"); } - I guess somebody hasn't gotten around to implemening it yet :-( (that "postgresql.prep.is" error translates to the "InputStream as parameter not supported" error you mentioned) If you really need this to work with postgres I suppose that leaves a few options: 1) wrap the Postgres drivers and use the Large Objects API behind the scenes 2) fix the Postgres 7.0 drivers! (I think it's open-source right, and anybody can dive in and sort stuff out?) 3) Use BMP in Orion and use the (non-portable) Postgres Large Objects API there 4) downgrade to Postgres 6.5 where I assume this worked (there are people on the list using Postgres via JDBC, right?) 5) Wait for this to be fixed (I assume it's fairly high on the Postgres bug list) option 6 is to give up and use another database (which I personally don't like the sound of having used up a day or so getting postgres installed and configured! Depends how long it'll take to work around the problems though) cheers Jules -- From: Armin Michel[SMTP:[EMAIL PROTECTED]] Sent: 16 March 2001 09:49 To: Orion-Interest Subject:Orion with PostgreSQL (oid) I got some problems with PostgreSQL and Orion when using blobs (oids in the table). I checked: http://www.postgresql.org/users-lounge/docs/7.0/programmer/jdbc6519.htm In the above page you can read the following example: snip To insert an image, you would use: File file = new File("myimage.gif"); FileInputStream fis = new FileInputStream(file); PreparedStatement ps = conn.prepareStatement("insert into images values (?,?)"); ps.setString(1,file.getName()); ps.setBinaryStream(2,fis,file.length()); ps.executeUpdate(); ps.close(); fis.close();" /snip This does a PreparedStatement.setBinaryStream(int,InputStream,int); - Exactly what Orion did! Here is the interesting part of the Exception.printStackTrace(); : snip Nested exception is: InputStream as parameter not supported at java.lang.Throwable.(Throwable.java:84) at java.lang.Exception.(Exception.java:35) at java.sql.SQLException.(SQLException.java:100) at org.postgresql.util.PSQLException.(PSQLException.java:22) at org.postgresql.jdbc2.PreparedStatement.setBinaryStream(PreparedStatement .java:417) at com.evermind.sql.ao.setBinaryStream(JAX) /snip So, this would lead to the conclusion, that Orion just tries to use a standard JDBC-API. Maybe Orion uses a special subclass of InputStream and the JDBC-Driver doesn't correctly account for this situation. In the JDBC API it reads: snip Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface. /snip This would blame the JDBC-driver then? Yours Armin
Dependents in 1-N don't go away
Hi everyone, I am having an issue with my 1-n dependents relationship. My dependents don't get deleted when I remove them from the cmr Set. I have a PhoneNumber dependent class which has a field type, countrycode, number, etc... I implemented the equal method in my class such that two phonenumber having the same type are equal, these type being like "business", "fax", "cell", etc Now I have an ejb class, the Customer ejb, which has : abstract PhoneNumber createPhoneNumber() abstract Set getPhoneNumbers() abstract void setPhoneNumbers(Phonenumber n) void addPhoneNumber(String type, String areaCode, ...) { PhoneNumber p = createPhoneNumber(); //Remove an existing phone //*1 getPhoneNumbers().remove(phoneNumber); //*2 getPhoneNumbers().add(phoneNumber); //*3 } Basically since my phonenumber equals on type, the desired effect is I want to wipe out a previous phonenumber of the same type before adding the new one. My problem is that I can see the phoneNumber being successfully removed from the list by putting debug calls at *1,*2 and *3 that checks on getPhoneNumbers.size() ...and the method commits correctly. But the rows are still in the database. Which if I call this method again will cause a Duplicate Key exception from my DB. Anyone knows why the remove() call doesn't seem to affect the db? Note: I run within container transaction on this method. Thanks, Christian
Class cast exception....
Hi all, i got a class cast exception trying to use an instance of an object throught 2 jsp pages or so. dumb example: fct.jsp: --- %!public class Website{private int num;private String nom; public Website(){this.num=100;this.nom="example";}}% ess.jsp: %@ include file="/fct.jsp" %%@ page import="java.util.*"%%Website ess=new Website();Vector v=new Vector();v.add(ess);session.setAttribute("essai",v);System.out.println(ess.getClass().getName());% ess2.jsp --- %@ include file="/fct.jsp" %%@ page import="java.util.*"%%Vector v=(Vector)session.getAttribute("essai");Website ess=(Website)v.get(0);% = i first load ess.jsp and got the following in log: __jspPage2_ess_jsp$Website =When i load ess2.jsp i got a class cast exception and when i check the class name : __jspPage2_ess_jsp$Website How i can bypass this trouble and why the class name is not Website and thats all ? Thx in advance for ur help. Chris
Questions regarding 1-n bi-directional relationships...
I have an entity called Account, and User. One Account can have many Users (bi-directional relationship). When I add a new User to the Account, the relationship table gets updated, but the AccountId field in the User table is not updated. Is this normal? It thought that account.getUsers().addUser(user) should BOTH update the relationship table and configure the accountId field in the User table. Can someone verify this? Thanks. -AP_
New article on orionsupport
To help clear up some of the confusion about user managers, I've submitted an article to orionsupport.com with a step by step guide on how to configure DataSourceUserManager. This covers enough of the general concepts regarding user managers that it'd hopefully be helpful for those of you trying to configure your own. I'll be adding/clarifying/modifying the howto based on user feedback over the next few days. The url for the howto is http://www.orionserver.com/articles/datasourceusermanager.html Hani Suleiman
Re: Please help me, How to get Orion's Environment Such as HostName, Port...???
Hi, You can try http://127.0.0.1 in your browser after starting orion as java -jar orion.jar If you have some other web server please shutdown that server and try again restarting the orion regards waheed - Original Message - From: Urey.u To: Orion-Interest Cc: Urey ; Orion-Interest Sent: Friday, March 16, 2001 6:23 AM Subject: Please help me, How to get Orion's Environment Such as HostName, Port...??? Dear All, When Orion Server was started. Could you please tell me,how to get Orion's environment Such as HostName,Port,Running Pathand so on in my application class file , not applet, servlet or JSP file?. Regards yoursUrey