EJB 2.0's Message Driven Beans in Orion 1.2.9 ?
Is there any example or documentation about message driven EJB's (which should be in Orion 1.2.9)? Or is Sun's documentation about EJB 2.0 all there is to it? ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤øø¤º°`°º¤¤º°`°º¤ø,¸¸,ø Olli Pöyry [EMAIL PROTECTED] Essaim Oy Tallberginkatu 2 A, FIN-00180 Helsinki, Finland GSM 358-40-5400743 puh 358-9-6948277 fax 358-9-6948287 ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤øø¤º°`°º¤¤º°`°º¤ø,¸¸,ø
SV: Specifying finder-methods (full query)
The normal way of doing this is by implementing several finder methods, and let a session bean do the entity querying.. For searching on names with wildchars just do: query = "$name like $1" this will actually serve as several finder methods (see examples under). findByName("Bob"); This will return the same as the =. findByName("Bo%"); This will return all matching records for Bo* and so on. You can even do this: findByName("Bo% %mi%th%"); Nifty :).. For the other stuff you have to add more finder methods. Or make it a bean managed persistance bean where you can toy around with the finder methods as you like :) Btw, important notice is: all findermethods implemented using like has to return Collection not remote interface. Have fun, hope this helps better :) Klaus Myrseth -Opprinnelig melding- Fra: Nick Newman [mailto:[EMAIL PROTECTED]] Sendt: 12. september 2000 22:23 Til: Orion-Interest Emne: RE: Specifying finder-methods (full query) At 08:57 PM 9/12/00 +0200, you wrote: Thanks for the reaction (also Nick). I realize now the potential security problems by allowing full specification of SQL on the client. Unfortunately the "Bob" example does not solve my problem. I managed to implement that example. That is where I came from. From there I tried to continue to implement a Query By Example frame and that's where I got stuck. Something like this: Say you have a table with products and you would like to create a flexible query frame for those products to run queries like all products for which the stock is low and which are purchased from comp xyz, or all products from categorie abc with names like %nic%. With specifying the query in orion-ejb-jar I came as far as either specifying a fixed name / number or you can use another fixed operator, e.g. '' or LIKE. Due to generated the quotes I could not let the client generate the selection part of the where clause. You get roughly the same error as when generating the whole statement. Probably you can write some ?Session? Bean that will query direct on the database returning a collection of primary keys, but for some reason that does not sound like music to me. Hi Frank, I apologise that my earlier reply was a bit off the mark. I hadn't read the whole email carefully enough to realize exactly what it was that you wanted to do. So far as I know, the accepted solution to your problem is exactly the one you tend to reject; using a stateless session bean to perform the direct SQL queries for you. I agree that this sounds a little unsatisfactory. After all, shouldn't the entity bean do everything to do with the entities? A slightly more elegant solution may arrive when EJB 2.0 is fully implemented. In EJB 2.0 the home interface of an EJB can also define arbitrary (non-finder, non-create) methods. That may be a more logical place to put a home-grown finder perhaps? Nick
Re: guest, principals.xml, and security roles - FIXED!
I seem to have managed to solve my problem. With a simple session bean set up as described in Richard Monson-Haefel's EJB book, I was unable to call any methods on the home interface (guest not allowed). I looked closer at the orion-primer session bean (which works) and noticed that there is a typo in the ejb-jar.xml deployment descriptor; the ejb-name in enterprise-beanssession is "hello.ejb.Hello" and the ejb-name in assembly-descriptormethod-permission is "hello.Hello" - not the same. Aha! There are no actual permissions assigned on the bean. By commenting out the entire method-permission block, I can make anonymous method calls just fine. If I try to explicitly grant permission to the role "users" (which is mapped to the "users" group, to which I added the "anonymous" user), I am denied. The two things that puzzle me now are: Is it proper/standard to grant universal permission to everyone if the assembly-descriptormethod-permission block is nonexistant? I can't seem to find anything in the EJB spec which says one way or another. What defines the user/group of the unauthenticated client? The stock principals.xml implies that it is a user named "anonymous", but this doesn't seem to work. Is this a bug? Do I win a doughnut? Jeff Schnitzer [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] --- Original Message --- Hi folks. I'm struggling with Orion's security model in an attempt to get my first entity bean working. It seems that no matter what configuration setting I tweak, I cannot successfully call a method on my bean's home interface. I always receive the exception: com.evermind.server.rmi.OrionRemoteException: guest is not allowed to call this EJB method, check your security settings (method-permission in ejb-jar.xml and security-role-mapping in orion-application.xml). The funny thing is that this is just about as vanilla a case as you can imagine. I'm calling the bean from a servlet, and I desire no authentication whatsoever. I want merely to anonymously call a method on the home interface. Here are a couple questions to which the answers might provide me much enlightenment: * Who is this "guest" person? In the default master principals.xml, there is a user called "anonymous" whose description implies that this will be the user automatically assigned to any unauthenticated user. Should that be "guest" so that I can assign a group (and thus a security-role-mapping) to the unauthenticated user? Is the name special, or is there some other flag that I can't see? I've tried adding a user with the name "guest", etc. Nothing I have tried works. * What is the relationship between the master principals.xml in the config directory and the principals.xml in the application deployment directory? I know the deployment orion-application.xml file points to the deployment principals.xml, but does this override or supplement the master config? Does it make sense to change the principals in the orion-application.xml to point to the master config, or is that redundant? * What does the namespace-access block do in the orion-application.xml file? * Do I have the basic concept right? 1) a user derives their name from authentication, or if there is no authentication, they are assigned some name (presumably "guest") by default. 2) the "user" belongs to one or more groups, defined by one (or both?) of the principals.xml files. 3) the groups are mapped to security roles in the deployment orion-application.xml file using security-role-mapping tags. 4) the security roles are mapped to actual bean method permissions in the bean's deployment descriptor. Somewhere this chain is broken for me, and I'm at a loss to figure out where. If it matters, the bean is an EJB 2.0 entity bean. The deployment descriptor defines a security role "users" which has wildcard(*) permission to the bean. The ear file's application.xml also defines this role. The default deployment orion-application.xml has the security-role-mapping of role "users" to group "users". The master principals.xml has both "anonymous" and "guest" as users which belong to the "users" group. Both the atm and news demos work fine. I presume it is because they explicitly authenticate somewhere in code, but I haven't been able to figure out how or why. Help? :-) Thanks, Jeff Schnitzer [EMAIL PROTECTED]
RE: EJB 2.0's Message Driven Beans in Orion 1.2.9 ?
Is there any example or documentation about message driven EJB's (which should be in Orion 1.2.9)? Or is Sun's documentation about EJB 2.0 all there is to it? Have a look at messagelogger in the demo directory. In a peanutshell, a message bean... - is similar to a session bean. - has no home or remote interface. - has a main class that implements javax.ejb.MessageDrivenBean. - has a method that handles in coming messages: void onMessage(javax.jms.Message). - has a corresponding message-driven entry within ejb-jar.xml/enterprise-beans - is bound to a JMS topic. Messages sent to this topic from a client will be handled by the onMessage() method. -Joe Walnes
RE: EJB 2.0's Message Driven Beans in Orion 1.2.9 ?
Title: RE: EJB 2.0's Message Driven Beans in Orion 1.2.9 ? Take a look at the EJB 2.0 version of ATM. It has an message driven bean. -Original Message- From: Olli Pöyry [mailto:[EMAIL PROTECTED]] Sent: den 13 september 2000 09:38 To: Orion-Interest Subject: EJB 2.0's Message Driven Beans in Orion 1.2.9 ? Is there any example or documentation about message driven EJB's (which should be in Orion 1.2.9)? Or is Sun's documentation about EJB 2.0 all there is to it? ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤øø¤º°`°º¤¤º°`°º¤ø,¸¸,ø Olli Pöyry [EMAIL PROTECTED] Essaim Oy Tallberginkatu 2 A, FIN-00180 Helsinki, Finland GSM 358-40-5400743 puh 358-9-6948277 fax 358-9-6948287 ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤øø¤º°`°º¤¤º°`°º¤ø,¸¸,ø
Docs: Setting 2 Servers
Hello, We have recently spent considerable amount of time trying to configure two orion servers to test our distributed application, - in the absene of documentation from the orion server itself, it proved very inefficient and frustrating. After communicating with other developers, we managed it and prepared documentation for internal use. I have attached this documentation for anyone interested and it can be used for any purpose. But there are issues I really need some explanation: - Why do we have to deploy the EJB module on both servers? I would think all we need on the client site is the home and remote interfaces for the EJBs, because the stubs implement them anyway. - Why do we have to configure remote.xml to specify the remote server? We already use the JNDI details to request the EJB stubs from the remote server. I would appreciate any comment on the above questions and attached documentation. Bulent _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. Setting Two Orion Servers.doc
Re: Detail logging? Is it possible (System.error.println - where do it go to in Orion)
Hello, Have you looked at the application log for the application you are deploying? Either check application.log for your paplication or check the application log in the console. Regards, Karl Avedal Richard Landon wrote: After a week (and a week-end) trying to bring our smoke-tests up under Orion, I finally got the unit-test stuff executing. However, these fail. All I see in any of the Orion logs, is, well nothing. Is there any means to have the server give me some kind of indication of why it isn't working? Perhaps if I knew what it's problem with the code was, I could change it (although I pretty much deployed the same code on 7, and counting, other J2EE servers at this point). The J2EE RI has a -verbose option, that tell's you various things. When using the RI a System.error.println with a EJB writes output to the obvious place, standard error. I don't see this working? I'm probably confused.
Sessions (still) timeouts too early
Hi, I have read some postings about http sessions that timeout too early and I seem to have the same problem. I have two web-sites, one with SSL and one without. The first time one enters the SSL site, the timeout time seems to be about a minute or less, even if I have set session-config session-timeout60/session-timeout /session-config in my web.xml and default-web-app load-on-startup="true" application="knut" name="knut-web" shared="true" / in my xxx-web-site.xml It seems like the premature timeout only occurs after the first time I call the servlet that creates the session, i.e ... HttpSession session = req.getSession(true); session.setAttribute("myBean",new MyBean()); ... If I call the servlet one more time within one minute, then after that, the session does not timeout too early. /Mattias Arbin, C-takt AB
RE: Run Orion on port80 without being root?
You might opt for installing a simple Linux router if you can't find a Solaris Network Address Translation tool. The Linux box would only be used to route the TCP/IP packages from one port to another. It is the old Linux story. Claim and older Pentium PC with some 32 Mb memory in it (in that case you can run X11, which make the installation procedure easier). Buy a Linux distribution (e.g. SuSE, Redhat or whatever). Install it. Believe me it takes you less time then installing Windows. Read the IPCHAINS-HOWTO, which is somewhere in /usr/doc. This could take you a few hours, but its is nice to know what you are actually doing with ipchains. Experiment with it and make sure you understand what you are doing. After all it should be reliable and secure. I would say it takes you one to two days to get it up and running and 1000$ hardware when you buy a new machine for it. All assuming you have some knowledge about TCP/IP and UNIX in general. Frank On Wednesday, September 13, 2000 7:01 AM, Sach Jobb [SMTP:[EMAIL PROTECTED]] wrote: This _is_ a great idea and i considered something like it before, the only problem is that we are deploying on Solaris. sach On Tue, 12 Sep 2000, Brian Beaulieu wrote: My solution seems to be working so far. I have Orion running as an arbitrary user bound to port 8000 I'm redirecting with ipchains all requests to port 80 to port 8000 with: ipchains -A input -p tcp -s 0/0 -d 0/0 80 -j REDIRECT 8000 The logs show the originating host since I'm not masquerading - this is obviously very important. I haven't run into a problem yet.. I'll try to break it and report here if I do. Regards, Brian Sach Jobb wrote: Thanks guys, This sums up everything pretty well: http://www.orionsupport.com/users.html The root of the problem (pun intended) is here: "Java, however, has no concept of a user, because Java is cross-platform and some platforms don't have any real user (such as Win98, which uses the term "user" very loosely.)" cheers, sach %s/windows/linux/g On Tue, 12 Sep 2000, Brian Beaulieu wrote: I tried this (had to recompile the library though). It says it's running it as user 'nobody' however all processes are stilled owned by nobody. When I attempt to create a directory '/blah' (shouldn't be able to), it works. I have to find a way to do this. I'm going to try running orion on a port 1024 and do port forwarding but that might cause some issues with advanced functionality. I'll look at the JINI library to see if I can find the problem and do some more debugging. Are there any other solutions out there? Regards, Brian Markus Holmberg wrote: On Mon, Sep 11, 2000 at 11:11:57AM -0700, Sach Jobb wrote: Has anyone found a way of running Orion on port80 without being root? I'm getting ready to launch a finance based site and i'm quite concerned about security. I've seen messages like this posted before but i have yet to see any kind of resolution. Any ideas? Changing Orion's uid using JNI: http://www.orionsupport.com/users.html Markus -- Markus Holmberg | Give me Unix or give me a typewriter. [EMAIL PROTECTED] | http://www.freebsd.org/
Looking for Fellow Programmers
Hello, First let me apologize in advance if this is not allowed on this board, but let me assure you that I am not a head-hunter, just a J2EE programmer who has received more work than he can handle and is looking for help =) Anyways ... I am looking for experienced programmers that would have some time to work on J2EE based E-Commerce systems. It would be fun stuff -- online catalogs, forward/reverse auctions, WAP, etc -- and leave lots of room for our creative collaboration. The contracts would probably be for 3 months, with the option to extend if everything works out. It would be helpful, but not necessary, if you are near the Washington DC area. I'm specifically looking for programmers familiar with: EJB, JSP, XML/XSLT, WAP, Oracle, JMS, and Orion of course! Drop me a note if you are interested/have time! Thanks. Neal
Re: Looking for Fellow Programmers
Im Interested to work in such a thing but im at UK Birmingham :-) - Original Message - From: "Neal Kaiser" [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Sent: Wednesday, September 13, 2000 12:41 PM Subject: Looking for Fellow Programmers Hello, First let me apologize in advance if this is not allowed on this board, but let me assure you that I am not a head-hunter, just a J2EE programmer who has received more work than he can handle and is looking for help =) Anyways ... I am looking for experienced programmers that would have some time to work on J2EE based E-Commerce systems. It would be fun stuff -- online catalogs, forward/reverse auctions, WAP, etc -- and leave lots of room for our creative collaboration. The contracts would probably be for 3 months, with the option to extend if everything works out. It would be helpful, but not necessary, if you are near the Washington DC area. I'm specifically looking for programmers familiar with: EJB, JSP, XML/XSLT, WAP, Oracle, JMS, and Orion of course! Drop me a note if you are interested/have time! Thanks. Neal
RE: Specifying finder-methods (full query)
Ok, here's some methods to allow slightly more flexible queries. There is rarely more than a few fields to query, but the permutations of different combinations can make this a bit of a headache. If you have name, age and score, you may end up with finder methods like: findByName(String name) findByAge(int age) findByScore(int score) findByNameAndAge(String name, int age) findByNameAndScore(String name, int score) . etc This could be merged into one finder statement findByCriteria(String name, int age, int score) Where the SQL query supplied to the finder-method is: ($name LIKE $1 OR $1 IS NULL) AND ($age = $2 OR $2 = 0) AND ($score = $3 OR $3 = 0) This way, if 0 (or null) is supplied as a parameter to the finder method the result set will not be filtered with that criteria. You can also pass across parameters that aren't necessarily fields, but useful for the query: findByAge(int age, int allowedRange) ($age = $1 - $allowedRange) OR ($age = $1 + $allowedRange) findByAge(int age, boolean older) // if true, returns all people older than age, // otherwise all people younger ($2 = 1 AND age = $1) OR ($2 = 0 AND age = $1) Also (if your database supports it), sub-selects are your friend (particularly when using OR mapping) $blah IN (SELECT id FROM xxx WHERE yy = $1) If you still can't achieve what you're attempting, the session bean to query the database for the keys will work - it may not be clean but sometimes you do have to resort to methods like this. If it's any consellation, I have done this because the query that needed to be generated was way too complicated for CMP, and it did work. The problem is that you then have nasty SQL inside your beans - where it shouldn't be. -Joe Walnes Thanks for the reaction (also Nick). I realize now the potential security problems by allowing full specification of SQL on the client. Unfortunately the "Bob" example does not solve my problem. I managed to implement that example. That is where I came from. From there I tried to continue to implement a Query By Example frame and that's where I got stuck. Something like this: Say you have a table with products and you would like to create a flexible query frame for those products to run queries like all products for which the stock is low and which are purchased from comp xyz, or all products from categorie abc with names like %nic%. With specifying the query in orion-ejb-jar I came as far as either specifying a fixed name / number or you can use another fixed operator, e.g. '' or LIKE. Due to generated the quotes I could not let the client generate the selection part of the where clause. You get roughly the same error as when generating the whole statement. Probably you can write some ?Session? Bean that will query direct on the database returning a collection of primary keys, but for some reason that does not sound like music to me. Frank On Tuesday, September 12, 2000 6:16 PM, Joe Walnes [SMTP:[EMAIL PROTECTED]] wrote: Frank, The actual SQL for query should be within the deployment descriptor and not the client code. So, if you wanted to find all MyProducts by a particular name, orion-ejb-jar.xml would contain: finder-method query="$name = $1" partial="false" And the client code would contain: ...findByName("Bob") It is not possible to pass SQL statements from the client to the finder method at runtime when using CMP as PreparedStatements are created in advance. Allowing this would impact performance, breach security and allow all havoc to break out. -Joe Walnes -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Frank Eggink Sent: 12 September 2000 16:06 To: Orion-Interest Subject: Specifying finder-methods (full query) I'm running into trouble specifying finder queries in orion-ejb-jar. As far as I can make sense of it the cause is in the quotes. Is that correct and does anyone know how the get around that? I've changed the default finder method to: finder-method query="$1" partial="false" !-- Generated SQL: "?" -- method ejb-nameMyProduct/ejb-name method-namefindByName/method-name method-params method-paramjava.lang.String/method-param /method-params /method /finder-method I call the method in my client with: ...findByName("select id, name, description, price from MyProduct"); The following is the resulting output: Printing a list of all products: System/communication error: Database error: Unexpected token: 'select id, name, description, price from MyProduct in statement ['select id, name,
Re: Sessions (still) timeouts too early
It seems like the premature timeout only occurs after the first time I call the servlet that creates the session, i.e ... HttpSession session = req.getSession(true); session.setAttribute("myBean",new MyBean()); ... If I call the servlet one more time within one minute, then after that, the session does not timeout too early. I just noticed that the above is not true. The sessions sporadically timeout too soon even after a few requests.
Re: Detail logging? Is it possible (System.error.println - where do i t go to in Orion)
I use following script for Orion Start perl -e "print '-'x25, 'Orion Started ', scalar(localtime),qq#\n#;" log/ORION.LOG perl -e "print '-'x25, 'Orion Started ', scalar(localtime),qq#\n#;" log/ORION.ERR java -Xmx160m -Dxml.rewrite=false -jar orion.jar 1log/ORION.LOG 2log/ORION.ERR perl -e "print '='x25, 'Orion Stoped ', scalar(localtime),qq#\n#;" log/ORION.LOG perl -e "print '='x25, 'Orion Stoped ', scalar(localtime),qq#\n#;" log/ORION.ERR and this script fot log viewing start "ORION LOG" tail -f log/ORION.LOG start "ORION ERORRS" tail -f log/ORION.ERR And same (much like) under Unix PS: perl - www.perl.com, tail - unix utilites for NT
Re: Looking for Fellow Programmers
Neal Kaiser wrote: Hello, First let me apologize in advance if this is not allowed on this board, but let me assure you that I am not a head-hunter, just a J2EE programmer who has received more work than he can handle and is looking for help =) Anyways ... I am looking for experienced programmers that would have some time to work on J2EE based E-Commerce systems. It would be fun stuff -- online catalogs, forward/reverse auctions, WAP, etc -- and leave lots of room for our creative collaboration. The contracts would probably be for 3 months, with the option to extend if everything works out. It would be helpful, but not necessary, if you are near the Washington DC area. I'm specifically looking for programmers familiar with: EJB, JSP, XML/XSLT, WAP, Oracle, JMS, and Orion of course! Drop me a note if you are interested/have time! Thanks. Neal I'm inmterested. I am currently a contractor. My information can be found on my website at www.itdepot.net/aboutus.html Alex
Re: Looking for Fellow Programmers
Title: Re: Looking for Fellow Programmers Hi, I may have some friends who would be interested in this. Do you have any more details I could pass on to them? paul Original Message On 9/13/00, 7:41:10 AM, Neal Kaiser [EMAIL PROTECTED] wrote regarding Looking for Fellow Programmers: Hello, First let me apologize in advance if this is not allowed on this board, but let me assure you that I am not a head-hunter, just a J2EE programmer who has received more work than he can handle and is looking for help =) Anyways ... I am looking for experienced programmers that would have some time to work on J2EE based E-Commerce systems. It would be fun stuff -- online catalogs, forward/reverse auctions, WAP, etc -- and leave lots of room for our creative collaboration. The contracts would probably be for 3 months, with the option to extend if everything works out. It would be helpful, but not necessary, if you are near the Washington DC area. I'm specifically looking for programmers familiar with: EJB, JSP, XML/XSLT, WAP, Oracle, JMS, and Orion of course! Drop me a note if you are interested/have time! Thanks. Neal
Re: Looking for Fellow Programmers
me to, but I'm in France - Paris [EMAIL PROTECTED] http://www.idocw.com Sanjay a écrit : Im Interested to work in such a thing but im at UK Birmingham :-) - Original Message - From: "Neal Kaiser" [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Sent: Wednesday, September 13, 2000 12:41 PM Subject: Looking for Fellow Programmers Hello, First let me apologize in advance if this is not allowed on this board, but let me assure you that I am not a head-hunter, just a J2EE programmer who has received more work than he can handle and is looking for help =) Anyways ... I am looking for experienced programmers that would have some time to work on J2EE based E-Commerce systems. It would be fun stuff -- online catalogs, forward/reverse auctions, WAP, etc -- and leave lots of room for our creative collaboration. The contracts would probably be for 3 months, with the option to extend if everything works out. It would be helpful, but not necessary, if you are near the Washington DC area. I'm specifically looking for programmers familiar with: EJB, JSP, XML/XSLT, WAP, Oracle, JMS, and Orion of course! Drop me a note if you are interested/have time! Thanks. Neal
RE: Specifying finder-methods (full query)
You forgot to mention that you can write out a full Sql stment with joins and so on. I use it a lot because of the datastructure we have here. To this one have to edit the orion-ejb.xml and insert a complet vaild sql statment which only returns the fields you have in the ententity object. In CMP you would do something like this : findByCrit1Crit2( int Crit1, String Crit2) the sql in orion-ejb.xml would loke like this; select a.Col1 a.Col2 a.Col3 from tabel1 a, table2 b (where a.Col1 = $1) and ( b.Col2 = $2) and (a.Col3 = b.Col1) Regards, Torgeir Lerkerød -Original Message- From: Joe Walnes [mailto:[EMAIL PROTECTED]] Sent: 13. september 2000 16:01 To: Orion-Interest Subject: RE: Specifying finder-methods (full query) Ok, here's some methods to allow slightly more flexible queries. There is rarely more than a few fields to query, but the permutations of different combinations can make this a bit of a headache. If you have name, age and score, you may end up with finder methods like: findByName(String name) findByAge(int age) findByScore(int score) findByNameAndAge(String name, int age) findByNameAndScore(String name, int score) . etc This could be merged into one finder statement findByCriteria(String name, int age, int score) Where the SQL query supplied to the finder-method is: ($name LIKE $1 OR $1 IS NULL) AND ($age = $2 OR $2 = 0) AND ($score = $3 OR $3 = 0) This way, if 0 (or null) is supplied as a parameter to the finder method the result set will not be filtered with that criteria. You can also pass across parameters that aren't necessarily fields, but useful for the query: findByAge(int age, int allowedRange) ($age = $1 - $allowedRange) OR ($age = $1 + $allowedRange) findByAge(int age, boolean older) // if true, returns all people older than age, // otherwise all people younger ($2 = 1 AND age = $1) OR ($2 = 0 AND age = $1) Also (if your database supports it), sub-selects are your friend (particularly when using OR mapping) $blah IN (SELECT id FROM xxx WHERE yy = $1) If you still can't achieve what you're attempting, the session bean to query the database for the keys will work - it may not be clean but sometimes you do have to resort to methods like this. If it's any consellation, I have done this because the query that needed to be generated was way too complicated for CMP, and it did work. The problem is that you then have nasty SQL inside your beans - where it shouldn't be. -Joe Walnes Thanks for the reaction (also Nick). I realize now the potential security problems by allowing full specification of SQL on the client. Unfortunately the "Bob" example does not solve my problem. I managed to implement that example. That is where I came from. From there I tried to continue to implement a Query By Example frame and that's where I got stuck. Something like this: Say you have a table with products and you would like to create a flexible query frame for those products to run queries like all products for which the stock is low and which are purchased from comp xyz, or all products from categorie abc with names like %nic%. With specifying the query in orion-ejb-jar I came as far as either specifying a fixed name / number or you can use another fixed operator, e.g. '' or LIKE. Due to generated the quotes I could not let the client generate the selection part of the where clause. You get roughly the same error as when generating the whole statement. Probably you can write some ?Session? Bean that will query direct on the database returning a collection of primary keys, but for some reason that does not sound like music to me. Frank On Tuesday, September 12, 2000 6:16 PM, Joe Walnes [SMTP:[EMAIL PROTECTED]] wrote: Frank, The actual SQL for query should be within the deployment descriptor and not the client code. So, if you wanted to find all MyProducts by a particular name, orion-ejb-jar.xml would contain: finder-method query="$name = $1" partial="false" And the client code would contain: ...findByName("Bob") It is not possible to pass SQL statements from the client to the finder method at runtime when using CMP as PreparedStatements are created in advance. Allowing this would impact performance, breach security and allow all havoc to break out. -Joe Walnes -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Frank Eggink Sent: 12 September 2000 16:06 To: Orion-Interest Subject: Specifying finder-methods (full query) I'm running into trouble specifying finder queries in orion-ejb-jar. As far as I can make sense of it the cause is in the quotes. Is that correct and does anyone know how the get around that? I've changed the default finder method
Re: Looking for Fellow Programmers
hey, I dont think the initial offer is a problem (what better place to meet J2EE programmers), but why dont you carry on your dealings via private email?
Why!?.... NoClassDefFoundError
Hi, I have installed Orion server. The example JSP-pages and servlets works fine, but when I try the EJB examples (ProductClient etc) I recieve a Exception in thread "main" java.lang.NoClassDefFoundError. javax/ejb/CreateException I have also tried to compile these classes and thenrecieved package javax.ejb does not exist. This is strange since I think that I have followed the instructions for running the examples. I have also tried to add the all theneeded jar files to my path and classpath variables and still have the same problem. I am running the Orion server on win2000 advanced server with SQLserver7 I would really appriciate if someone could help me out so thatI can try the examples. /Carl
RE: Why!?.... NoClassDefFoundError
Make sure the files orion.jar, ejb.jar and naming.jar (in the orion dir) are in your classpath. -Joe Walnes -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Carl Troedsson Sent: 13 September 2000 17:26 To: Orion-Interest Subject: Why!? NoClassDefFoundError Hi, I have installed Orion server. The example JSP-pages and servlets works fine, but when I try the EJB examples (ProductClient etc) I recieve a Exception in thread "main" java.lang.NoClassDefFoundError. javax/ejb/CreateException I have also tried to compile these classes and then recieved package javax.ejb does not exist. This is strange since I think that I have followed the instructions for running the examples. I have also tried to add the all the needed jar files to my path and classpath variables and still have the same problem. I am running the Orion server on win2000 advanced server with SQLserver7 I would really appriciate if someone could help me out so that I can try the examples. /Carl
Remote debugging from JBuilder
Hello, is it possible to debug EJBs from JBuilder IDE? Thanks in advance. -maxim
RE: Looking for Fellow Programmers
would be nice, would it? Sadly he did not include an email address where people can send to :) Jeroen T Wenting [EMAIL PROTECTED] ICQ UIN #9191966 It's the end of the world as we know it and I feel fine (Michael Stipe) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Christian Sell Sent: 13 September 2000 18:22 To: Orion-Interest Subject: Re: Looking for Fellow Programmers hey, I dont think the initial offer is a problem (what better place to meet J2EE programmers), but why dont you carry on your dealings via private email?
(no subject)
When trying to connect to our own secure server using this code we get a SSLException saying that the cert chain is untrusted. The certificate in the server has been generated by verisign as a trial cert. We can't see the cipherSuite nor the certificate chain. The exception must be thrown in connection time. Is there any configuration stuff we haven't consider ?? Is there a problem in the client code ?? try{ System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); URL urls = new URL("https://our.own.server"); URLConnection con = urls.openConnection(); con.setAllowUserInteraction(true); HttpsURLConnection cons = (HttpsURLConnection) con; if (cons == null) System.out.println("La conexión el nula!!!"); System.out.println("Cypher Suite:" + cons.getCipherSuite()); cons.connect(); X509Certificate[] serverCerts = cons.getServerCertificateChain(); System.out.println("Certificados:" + serverCerts.length); for (int i = 0; i serverCerts.length; i++) { System.out.println(serverCerts[i].toString()); } System.out.println("Headers:" + con.getHeaderFieldKey(0)); BufferedReader reader = new BufferedReader(new InputStreamReader(con.getInputStream())); String line = reader.readLine(); while (line != null) { System.out.println(line); line = reader.readLine(); } } catch (SSLException e) { System.out.println("Excepción SSL: " + e.toString()); } catch (Exception e){ e.printStackTrace(); }
RE: Looking for Fellow Programmers
Just look in the message header and you will see it. It looks to me like: [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of J.T. Wenting Sent: Wednesday, September 13, 2000 11:22 AM To: Orion-Interest Subject: RE: Looking for Fellow Programmers would be nice, would it? Sadly he did not include an email address where people can send to :) Jeroen T Wenting [EMAIL PROTECTED] ICQ UIN #9191966 It's the end of the world as we know it and I feel fine (Michael Stipe) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Christian Sell Sent: 13 September 2000 18:22 To: Orion-Interest Subject: Re: Looking for Fellow Programmers hey, I dont think the initial offer is a problem (what better place to meet J2EE programmers), but why dont you carry on your dealings via private email?
Re[2]: Looking for Fellow Programmers
I just took a look at the headers from his original post... and he DID provide his email address. Here it is : [ From: "Neal Kaiser" [EMAIL PROTECTED] ] I would think you could just reply to him. Dylan Parker Wednesday, September 13, 2000, 11:21:31 AM, you wrote: would be nice, would it? Sadly he did not include an email address where people can send to :) Jeroen T Wenting [EMAIL PROTECTED] ICQ UIN #9191966 It's the end of the world as we know it and I feel fine (Michael Stipe) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Christian Sell Sent: 13 September 2000 18:22 To: Orion-Interest Subject: Re: Looking for Fellow Programmers hey, I dont think the initial offer is a problem (what better place to meet J2EE programmers), but why dont you carry on your dealings via private email?
Re: How to enable validating XML Parser?
Hello, I'm currently working with JSPs that generate XML which are then translated to HTML by Orion using a separate XSL file. All is well and good. Wonderful functionality. It is nice isn't it. =) I'm doing something very similar. In creating the XML files and the DTDs... it seems that Orion is not validating the XML structure at all... whether a DTD is specified.. not specified.. openly ignored or broken doesn't seem to make a difference. That's been bugging me as well. My question : Can I force Orion to Validate my XML for me? It lets me know whether it is well-formed.. but not whether it is valid. Excellent question! =) Well? anyone know the answer? An informed yes or no would be appreciated. Dylan Parker
Re: non-ejb classes
Derek Akers wrote: Orion is having a problem invoking the useBean tag when given the class name of the object to instantiate. HEre is the code: jsp:useBean id="cartFactory" scope="session" class="cart.CartFinderBean" % System.err.println("Error using CartFinderBean"); % /jsp:useBean Why did you mark the region inside of jsp:useBean's with the message "Error using..." ? It'll be invoked every time the session will be created - either on startup, after timeout or every request when a browser doesn't support cookies and URLRewritting is not used or not provided by servlet container. Thus, it'd mean that there would be a problem while seeing the message, but in fact it'd not be. however, it seems that this tag is not operating properly. I get errors when trying to refer to Could you show the errors ? The more clues, the more helpful answer can be:) derek akers Jacek Laskowski
OrionServer newbie question
It appears that the logs don't offer much for reporting exceptions when a jsp is launched. Is there an area that helps pinpoint where things (jars, etc.) go wrong? Thanks in advance. - Bill Girten / TechSurfers, Inc.
Re: OrionServer newbie question
I dont know as orion is any worse than anything else for jsp's. We use netscape at work on this job (my current one) and it doesnt do any decent logging when something goes wrong either. In a JSP it either works, or it doesnt. :) Al - Original Message - From: "Bill Girten" [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Sent: Wednesday, September 13, 2000 9:02 PM Subject: OrionServer newbie question It appears that the logs don't offer much for reporting exceptions when a jsp is launched. Is there an area that helps pinpoint where things (jars, etc.) go wrong? Thanks in advance. - Bill Girten / TechSurfers, Inc.
Re: Looking for Fellow Programmers
- Original Message - From: "Christian Sell" [EMAIL PROTECTED] Date: Thursday, September 14, 2000 2:22 am Subject: Re: Looking for Fellow Programmers hey, I dont think the initial offer is a problem (what better place to meet J2EE programmers), but why dont you carry on your dealings via private email? I could not agree with you more!