BUG: Taglib dont support double byte character set
the taglib seems can't handle i18n correctly, for ex: test:loop count="10" ¤¤¤å /test:loop it works fine, but if the body of taglib is a dynamic body, ex test:loop count="10" %="¤¤¤å"% /test:loop it works incorrect.
RE: Tag Example Problem
The taglib's probably needs to be recompiled using the latest orion.jar, as there was a problem with comilers replacing static variables with their values. Please see note on www.orionserver.com I will update the taglibs in all examples asap. WR Magnus Rydin -Original Message-From: Eric Richardson [mailto:[EMAIL PROTECTED]]Sent: den 18 april 2000 17:12To: Orion-InterestSubject: Tag Example ProblemHi, I searched the archives and couldn't find anything relevent. I'm trying to use the Iterate.java tag in some code I have. I pass the collection but the nested usebean tag cannot find the object in page scope. 500 Internal Server Error java.lang.InstantiationException: Could not find the bean named 'product1' in the page scope at /product_demo.jsp._jspService(/product_demo.jsp.java:171) at com.evermind.server.http.EvermindHttpJspPage.service(JAX) at com.evermind.server.http.HttpApplication.r4(JAX) at com.evermind.server.http.JSPServlet.service(JAX) at com.evermind.server.http.c9.oh(JAX) at com.evermind.server.http.c9.forward(JAX) at com.evermind.server.http.dg.b8(JAX) at com.evermind.util.e.run(JAX) If I put an object in scope of the correct type it iterates through the list and prints everything out so I know the collection is fine. % pageContext.setAttribute("product1", product); ts:iterate name="product1" collection="%= products %" jsp:useBean id="product1" scope="page" type="com.ratex.db.Product"/ !-- Product: %=product1 % -- tr td jsp:getProperty name="product1" property="productId"/ /td td %=product1.getCategory() % /td td %=product1.getName() % /td td %=product1.getDescription() % /td /tr /ts:iterate I haven't quite figured out the code but it seems it should work correctly. Seems like the setAttribute(...) is not getting called. public int doStartTag() { if(iterator == null) { //Make sure we have a Iterator return SKIP_BODY; } if(iterator.hasNext()) { //check if we got more elements // add the Bean to the pageContext using the given name pageContext.setAttribute(name, iterator.next(), PageContext.PAGE_SCOPE); return EVAL_BODY_TAG; } else { return SKIP_BODY; } } Any help would be appreciated. Eric :-)
RE: jsp driver problem with hsql
Title: RE: jsp driver problem with hsql I put mine in WEB-INF/lib/ Works fine WR Magnus Rydin I'm trying to make a connection to a hsql database, which works perfectly if I use a standalone java-app. But when I use a jsp page to connect to hsql, it can not find the driver (org.hsql.jdbcDriver). I have made a classpath to the driver, so I see no reason why it shouldn't work. Are one supposed to put the driver in some special directory? regards, /Robert Karlsson
Serializing java.lang.Class Objects
Hello. I'm not sure this is a orion specific issue. Is it true, that serializing a java.lang.Class object and recreating it in a different VM can cause problems? If have a bean which takes a Class[] as arguement. Class implements Serializable, thats not the problem, but when I call the bean, the EJBcode at serverside always receives a NULL-pointer, even when I put something different as an argument. I think that because Class is defined not only by name, but also by it's ClassLoader, it could cause problems when deserializing it? what do you think? How do you transport Class-Object over RMI? Greetings, Thomas - --- Thomas Hertz [EMAIL PROTECTED] hybris GmbH Schwere-Reiter-Str. 35 Gebaeude 16 80797 Muenchen fon: +49 89 30 66 97 0 fax: +49 89 30 66 97 99 http://www.hybris.de solutions for an accelerating generation. -BEGIN PGP SIGNATURE- Version: PGPfreeware 6.5.3 for non-commercial use http://www.pgp.com iQA/AwUBOQVAcMKaf2h0B2KeEQL9OwCeJqxvD179MAwVOQnBpE6od2nM3HEAn2/8 08hHiVxaPb/1HWUyVZWL0vtT =O1ie -END PGP SIGNATURE-
Generating primary keys in CMP?
Hello, I'm looking for a way to generate primary keys for my container managed entity beans. For bean managed persistance you would simply use the functions that your DBMS provides, like sequences or auto-increased columns. But how do I do this with CMP beans? In books and example code everyone avoids the subject entirely, with create(int id) as the creation method. A solution I've seen suggested is to use a separate session bean to generate unique integers, but they are generally a mess to implement and use. So what I'm looking for is something better than that. The J2EE servers based on object databases (GemStone/J at least) has an id generator "for free". But it seems this shouldn't be impossible with relational DBMSes. I would guess that it could be done by the CMP container, possibly by using DBMS-dependent plugins for different id generator implementations? Anyway, if this isn't possible I'm looking for a good implementation of a session bean based id generator... /Anders A n d e r s B e n g t s s o n [EMAIL PROTECTED] http://www.natakademin.se/
Java Mail with POP3
Can you explain me how to use java mail with pop3 support? I have tryed: /// PrintWriter out; /// ... Session sess; Store stor; try { sess=Session.getDefaultInstance(System.getProperties(),null); stor=sess.getStore("pop3"); stor.connect("mail.dnt.ro","user","xxx"); stor.close(); } catch (Exception e) { out.println("Error :"+e.toString()); } out.println("Done"); ///- And when I execute the servlet, next error apear: javax.mail.NoSuchProviderException: No provider for pop3 I put the pop3 jar in the orion/lib and /orion ... but nothing. Cosmin Popa
Re: Java Mail with POP3
And when I execute the servlet, next error apear: javax.mail.NoSuchProviderException: No provider for pop3 I put the pop3 jar in the orion/lib and /orion ... but nothing. Cosmin, this is a shot in the dark, but try putting the jar file in path-to-jdk/jre/lib/ext. If you don't want to do that, try editing the MANIFEST file in orion.jar and append the path to pop3.jar on the line that starts with "Classpath:". -Joe Walnes
Re: Generating primary keys in CMP?
For bean managed persistance you would simply use the functions that your DBMS provides, like sequences or auto-increased columns. But how do I do this with CMP beans? In books and example code everyone avoids the subject entirely, with create(int id) as the creation method. Annoyingly enough, most EJB resources tend to avoid this subject. Wish they wouldn't. A solution I've seen suggested is to use a separate session bean to generate unique integers, but they are generally a mess to implement and use. So what I'm looking for is something better than that. There are 2 main approaches 2 generating IDs. Firstly you could use the internal features of your database - many db's support SEQUENCES. This solution seems fairly simple and elegant but using a db specific approach can cause problems if you later decide to switch databases. The preferred way to generate ID's is using a session bean and an entity bean. The entity uses a reference to the table or bean name as a primary key, and has a second field which stores the next id to use for that table. The session bean is used as a wrapper around the entity to easily request the next id per table. In fact, updating the entity every time a new id is needed can be quite a cumbersome and inefficient process, so a HIGH/LOW strategy is more appropriate. Briefly, this is where the session bean is stateful and instead of requesting and incrementing the entity each time an id is required, a block of id's (eg: 20) are requested from the entity (which then increments the count by that number) and the session counts out each id until the block runs out, at which point it requests another block. Multiple sessions can be used and each session will count with a seperate block. Concurrent access can be handled by catching transaction exceptions and trying again. The drawbacks to this is that the id's in the db table are not guaranteed to be in order and there may be some gaps if a session is destroyed before it uses all of it's block of ids. The main advantage is that you will not be tied in to any particular db. There's a nice little paper that may be of use that describes this method (although it has nothing to do with Java or EJB's): http://www.ambysoft.com/mappingObjects.html -Joe Walnes
behavior of encodeRedirectURL()
the encodeRedirectURL() is used when you generate a dynamic url without cookie support. encodeRedirectURL() in Orion will always generate session id , but I think it should be use only when the cookie is disable.
RE: Tag Example Problem
Hi Eric: The bug you mentioned has been corrected in aninternal buildof Orion already. This release is currently under regression testing andwill be available shortly. -- Victor -Original Message-From: Eric Richardson [mailto:[EMAIL PROTECTED]]Sent: Tuesday, April 25, 2000 10:37 AMTo: Orion-InterestCc: Orion-Interest; [EMAIL PROTECTED]Subject: Re: Tag Example ProblemHi Magnus, I resolved my problem and think it is a bug. I did recompile with no avail. Karl wrote me back and suggested from now on if I found what I think is a bug to copy it to [EMAIL PROTECTED] He said he would add that to the Web site. When this call is made in 0.9.6 the bean goes in application scope. pageContext.setAttribute(name, iterator.next(), PageContext.PAGE_SCOPE); I changed to the two arg version which for pageContext puts bean in page scope which solves the problem temporarily. pageContext.setAttribute(name, iterator.next()); Thanks, Eric :-) Magnus Rydin wrote: The taglib's probably needs to be recompiled using the latest orion.jar, as there was a problem with comilers replacing static variables with their values.Please see note on www.orionserver.comI will update the taglibs in all examples asap.WRMagnus Rydin -Original Message- From: Eric Richardson [mailto:[EMAIL PROTECTED]] Sent: den 18 april 2000 17:12 To: Orion-Interest Subject: Tag Example Problem Hi, I searched the archives and couldn't find anything relevent. I'm trying to use the Iterate.java tag in some code I have. I pass the collection but the nested usebean tag cannot find the object in page scope. 500 Internal Server Error java.lang.InstantiationException: Could not find the bean named 'product1' in the page scope at /product_demo.jsp._jspService(/product_demo.jsp.java:171) at com.evermind.server.http.EvermindHttpJspPage.service(JAX) at com.evermind.server.http.HttpApplication.r4(JAX) at com.evermind.server.http.JSPServlet.service(JAX) at com.evermind.server.http.c9.oh(JAX) at com.evermind.server.http.c9.forward(JAX) at com.evermind.server.http.dg.b8(JAX) at com.evermind.util.e.run(JAX) If I put an object in scope of the correct type it iterates through the list and prints everything out so I know the collection is fine. % pageContext.setAttribute("product1", product); ts:iterate name="product1" collection="%= products %" jsp:useBean id="product1" scope="page" type="com.ratex.db.Product"/ !-- Product: %=product1 % -- tr td jsp:getProperty name="product1" property="productId"/ /td td %=product1.getCategory() % /td td %=product1.getName() % /td td %=product1.getDescription() % /td /tr /ts:iterate I haven't quite figured out the code but it seems it should work correctly. Seems like the setAttribute(...) is not getting called. public int doStartTag() { if(iterator == null) { //Make sure we have a Iterator return SKIP_BODY; } if(iterator.hasNext()) { //check if we got more elements // add the Bean to the pageContext using the given name pageContext.setAttribute(name, iterator.next(), PageContext.PAGE_SCOPE); return EVAL_BODY_TAG; } else { return SKIP_BODY; } } Any help would be appreciated. Eric :-)
cursor problem
Title: cursor problem I am having a problem with cursors on an Oracle 7.3.4 database. I grab the connection from Orion as follows: public static Connection getConnection() throws SQLException { try { javax.naming.Context context = new javax.naming.InitialContext(); javax.sql.DataSource ds = (javax.sql.DataSource)context.lookup(jdbc/CDE_JBDS); return ds.getConnection(); } catch (javax.naming.NamingException ex) { ex.printStackTrace(System.err); throw new SQLException(e.getMessage()); } } I then get run a query and load the data into an ArrayList of objects: public ArrayList selectRows(String sql) throws SQLException { ArrayList retRow = new ArrayList(); java.sql.Connection con = null; Statement stmt = null; ResultSet rs = null; ResultSetMetaData rsmd = null; try { con = DBSession.getConnection (); stmt = con.createStatement (); rs = stmt.executeQuery (sql); rsmd = rs.getMetaData(); int columnCount = rsmd.getColumnCount(); while (rs.next()) { Row row = new Row(); for (int col = 1; col = columnCount; col++) row.setProperty (col, rs.getString(col), rsmd); retRow.add (row); } rs.close (); stmt.close(); } catch (SQLException e) { e.printStackTrace(System.err); throw e; } finally { try { stmt.close(); } catch (Exception e) {} try { rs.close(); } catch (Exception e) {} try { con.close(); } catch (Exception e) {} stmt = null; rs = null; con = null; return retRow; } } For some reason I keep running out of cursors. Is there something I am doing wrong. SnowWolf
worked under 0.9.4 broken under 0.9.6
the following code snippet worked under 0.9.4 but generates a NullPointerException under 0.9.6. The offending line is the lookup: private IConfig getConfigBean() { if( m_configBean != null ) { return m_configBean; } try { InitialContext initialContext = new InitialContext(); Object obj = initialContext.lookup("java:comp/env/ejb/ssp/StashHome"); ConfigHome configHome = (ConfigHome)PortableRemoteObject.narrow(obj,ConfigHome.class); m_configBean = configHome.create(); } catch (Exception e) { e.printStackTrace(); System.out.println("Can't get Configuation bean. No items will be available!"); } return m_configBean; } Any ideas? Thanks Eric Walker
Bug of Taglib and many i18n issue of Orion JSP
Taglib can handle i18n correctly. If I want use Big5 for my JSP page enocoding, according I have to set %@page contentType="text/html;charset=Big5" otherwise the dynamic string, ex %="¤¤¤å"% won't be correct. I find Orion handle it fine, but if in taglib body , it goes wrong. This perhapers the taglib out put stream use the io stream that don't support i18n. NOW I have serveral suggestion to orion, hopes the orion team can look the JSP i18n issue otherwise the orion can't deploy to the double byte enviroment. 1. use the system default encoding (file.encoding)be the JSP content-type encoding to ease development. So I dont need to type %@page contentType="text/html;charset=Big5" on every JSP page. 2. use the content-type to parsing the JSP to let JSP support multi-language 3. allow user to set JSP encoding in the orion web config 4. fix the TagLib and POST/GET value i18n problem