Stateful Session Bean and HTTPSession

2000-12-11 Thread Laurent Cornelis

Hello,

I develop a web application where I use a stateful session bean for my Acl
management.

When HTTP session is created, I create a bean instance and cache it to the
session, so my servlet and every JSP can use it. When the user logout, I
invalidate the session and remove my bean. But if the user close the browser
without logout or if Orion crash and is restarted, the bean instance is not
removed... I set a session timeout of 7200 sec. in my orion-ejb-jar.xml, is
the bean removed after this time if unused ? How can I clean these "phatom"
bean's instance ?

Thanks

Laurent Cornelis







Stateful Session Bean and HTTPSession

2000-12-07 Thread Laurent Cornelis

Hello,

I develop a web application where I use a stateful session bean for my Acl
management.

When HTTP session is created, I create a bean instance and cache it to the
session, so my servlet and every JSP can use it. When the user logout, I
invalidate the session and remove my bean. But if the user close the browser
without logout or if Orion crash and is restarted, the bean instance is not
removed... I set a session timeout of 7200 sec. in my orion-ejb-jar.xml, is
the bean removed after this time if unused ? How can I clean these "phatom"
bean's instance ?

Thanks

Laurent Cornelis






Error in ORList (Re: byte array OR mapping...)

2000-11-28 Thread Laurent Cornelis

Yes I know that a byte is a primitive, but byte array (byte[]) is an object.
In my Entity Bean, this array represent a graphic (a jpg), one of my entity
bean can have more than one graphic (I represent it now with a List of
Graph).



I changed my EJB to :

public class ResultBean implements EntityBean {

  [...]

  public String id;
  [...]
  public List graphs;
  [...]
}



Here is my Graph Object :

public class Graph implements Serializable {
  public byte[] datas;
}



And in my orion-ejb-jar.xml :

cmp-field-mapping name="graphs"
list-mapping table="graphics"
 value-mapping type="ubiquity.rapids.ejb.result.Graph"
  cmp-field-mapping
   fields /
  /cmp-field-mapping
 /value-mapping
   /list-mapping
/cmp-field-mapping

--

Now, when I deploy :

snip

Auto-creating table: create table results (id CHAR(255) not null primary
key, matlabCommand CHAR(255) null, numericResult BINARY null, graphCommand
CHAR(255) null, generatedOn timestamp null, producedBy CHAR(255) null)

Orion Launcher create table results (id CHAR(255) not null primary key,
matlabCommand CHAR(255) null, numericResult BINARY null, graphCommand
CHAR(255) null, generatedOn timestamp null, producedBy CHAR(255) null)

Auto-creating table: create table graphics (id CHAR(255) not null, datas
BINARY null)

Orion Launcher create table graphics (id CHAR(255) not null, datas BINARY
null)

Found 7 syntax errors in "C:/orion/Graph_ORList20.java":

33. [B __fieldTemp21;


*** Syntax: Unexpected symbol ignored


92.
if((([B)null) == null) insertAllStatement.setNull(1,
java.sql.Types.LONGVARBINARY);
 

*** Syntax: Unexpected symbol ignored


93. else
insertAllStatement.setBinaryStream(1, new
java.io.ByteArrayInputStream((([B)null)), (([B)null).length);
 

*** Syntax: Unexpected symbol ignored


93. else
insertAllStatement.setBinaryStream(1, new
java.io.ByteArrayInputStream((([B)null)), (([B)null).length);




*** Syntax: Unexpected symbol ignored


   117.
if((([B)null) == null) insertAllStatement.setNull(1,
java.sql.Types.LONGVARBINARY);
 

*** Syntax: Unexpected symbol ignored


   118. else
insertAllStatement.setBinaryStream(1, new
java.io.ByteArrayInputStream((([B)null)), (([B)null).length);

  

*** Syntax: Unexpected symbol ignored


   118. else
insertAllStatement.setBinaryStream(1, new
java.io.ByteArrayInputStream((([B)null)), (([B)null).length);




*** Syntax: Unexpected symbol ignored
Error compiling file:/C:/orion/applications/rapids/rapids-ejb-result.jar:
Error in source

/snip


-


All these errors in Graph_ORList20.java are just because Orion generate [B
insteed of byte[], so the compiler don't understand it... My question is :
Can I write my own Graph_ORList and tell Orion where it is or how can I
correct this error ? (Is this an Orion bug ??)


Thanks

Laurent


- Original Message -
From: "Tim Drury" [EMAIL PROTECTED]
To: "Orion-Interest" [EMAIL PROTECTED]
Sent: Monday, November 27, 2000 4:47 PM
Subject: RE: byte array OR mapping...


 
  The '[B' is the String returned when I do byte[].getClass().toString()

 I don't think you want to do that.  Firstly, a byte is not a class.
 byte is a primitive like int, float, char, etc. which are not classes
 in Java (maybe you are a Smalltalk programmer?).

 Second, getClass().toString() isn't correct; you should have used
 getClass().getName() to get the name of a class.  A Class is an
 object, and toString() usually returns a serialized version of
 that object (usually, not always).

 You should probably take your byte[] and place it in a class that
 implements java.io.Serializable.  Most of the database mappings
 support placing that into a blob:

 type-mapping="java.io.Serializable" name="blob"

 -tim






Workaround found - Re: Error in ORList (Re: byte array OR mapping...)

2000-11-28 Thread Laurent Cornelis

Hello again,

I found a workaround for this bug :  I just changed my Graph class to

public class Graph implements Serializable {
  public Object datas;

  public void setDatas(byte[] datas) {
this.datas = datas.clone();
  }

  public byte[] getDatas() {
   return (byte[])datas;
  }
}

And it works fine !!

Laurent

- Original Message -
From: "Vidur Dhanda" [EMAIL PROTECTED]
To: "Orion-Interest" [EMAIL PROTECTED]
Sent: Tuesday, November 28, 2000 1:38 PM
Subject: Re: Error in ORList (Re: byte array OR mapping...)


 I had posted something similar as a bug (sorry, can't recall the number;
if you
 want I can try and look) and received a message several days ago that it
had
 been fixed in 1.4.5.  Perhaps, when that version comes out your error will
also
 go away.

 Vidur

 Laurent Cornelis wrote:

  Yes I know that a byte is a primitive, but byte array (byte[]) is an
object.
  In my Entity Bean, this array represent a graphic (a jpg), one of my
entity
  bean can have more than one graphic (I represent it now with a List of
  Graph).
 
  
 
  I changed my EJB to :
 
  public class ResultBean implements EntityBean {
 
[...]
 
public String id;
[...]
public List graphs;
[...]
  }
 
  
 
  Here is my Graph Object :
 
  public class Graph implements Serializable {
public byte[] datas;
  }
 
  
 
  And in my orion-ejb-jar.xml :
 
  cmp-field-mapping name="graphs"
  list-mapping table="graphics"
   value-mapping type="ubiquity.rapids.ejb.result.Graph"
cmp-field-mapping
 fields /
/cmp-field-mapping
   /value-mapping
 /list-mapping
  /cmp-field-mapping
 
  --
 
  Now, when I deploy :
 
  snip
 
  Auto-creating table: create table results (id CHAR(255) not null primary
  key, matlabCommand CHAR(255) null, numericResult BINARY null,
graphCommand
  CHAR(255) null, generatedOn timestamp null, producedBy CHAR(255) null)
 
  Orion Launcher create table results (id CHAR(255) not null primary key,
  matlabCommand CHAR(255) null, numericResult BINARY null, graphCommand
  CHAR(255) null, generatedOn timestamp null, producedBy CHAR(255) null)
 
  Auto-creating table: create table graphics (id CHAR(255) not null, datas
  BINARY null)
 
  Orion Launcher create table graphics (id CHAR(255) not null, datas
BINARY
  null)
 
  Found 7 syntax errors in "C:/orion/Graph_ORList20.java":
 
  33. [B __fieldTemp21;
  
 
  *** Syntax: Unexpected symbol ignored
 
  92.
  if((([B)null) == null) insertAllStatement.setNull(1,
  java.sql.Types.LONGVARBINARY);
   
 
  *** Syntax: Unexpected symbol ignored
 
  93. else
  insertAllStatement.setBinaryStream(1, new
  java.io.ByteArrayInputStream((([B)null)), (([B)null).length);
   
 
  *** Syntax: Unexpected symbol ignored
 
  93. else
  insertAllStatement.setBinaryStream(1, new
  java.io.ByteArrayInputStream((([B)null)), (([B)null).length);
 
  
 
  *** Syntax: Unexpected symbol ignored
 
 117.
  if((([B)null) == null) insertAllStatement.setNull(1,
  java.sql.Types.LONGVARBINARY);
   
 
  *** Syntax: Unexpected symbol ignored
 
 118. else
  insertAllStatement.setBinaryStream(1, new
  java.io.ByteArrayInputStream((([B)null)), (([B)null).length);
 

 
  *** Syntax: Unexpected symbol ignored
 
 118. else
  insertAllStatement.setBinaryStream(1, new
  java.io.ByteArrayInputStream((([B)null)), (([B)null).length);
 
  
 
  *** Syntax: Unexpected symbol ignored
  Error compiling
file:/C:/orion/applications/rapids/rapids-ejb-result.jar:
  Error in source
 
  /snip
 
  -
 
  All these errors in Graph_ORList20.java are just because Orion generate
[B
  insteed of byte[], so the compiler don't understand it... My question is
:
  Can I write my own Graph_ORList and tell Orion where it is or how can I
  correct this error ? (Is this an Orion bug ??)
 
  Thanks
 
  Laurent
 
  - Original Message -
  From: "Tim Drury" [EMAIL PROTECTED]
  To: "Orion-Interest" [EMAIL PROTECTED]
  Sent: Monday, November 27, 2000 4:47 PM
  Subject: RE: byte array OR mapping...
 
   
The '[B' is the String returned when I do
byte[].getClass().toString()
  
   I don't think you want to do that.  Firstly, a byte is not a class.
   byte is a primitive like int, float, char, etc. which are not classes
   in Java (maybe you

byte array OR mapping...

2000-11-27 Thread Laurent Cornelis

Hello,

I have an Entity Bean  :

public class ResultBean implements EntityBean {

  [...]

  public String id;
  [...]
  public byte[][] graphResult;

}

The graphResult field is an array of byte arrays. I want it to be stored as
a list of BLOBs. Here is my mapping for this field (orion-ejb-jar.xml) :

cmp-field-mapping name="graphResult"
list-mapping table="graphics"
value-mapping type="[B"
cmp-field-mapping
fields /
/cmp-field-mapping
/value-mapping
/list-mapping
/cmp-field-mapping

The '[B' is the String returned when I do byte[].getClass().toString()

But when I deploy :

Error compiling file:/C:/orion/applications/rapids/rapids-ejb-result.jar:
Dependent OR class [B cannot be abstract unless the ejb-jar.xml has a
dependent tag for it


What's wrong ??? Can someone helps me ??

Thanks

Laurent





Re: JetSpeed

2000-11-17 Thread Laurent Cornelis


For me, putting the Jetspeed jars in /orion/lib gives me the following
error when calling
http://hostname/servlet/jetspeed

java.io.FileNotFoundException: /tmp/turbine.log (O sistema não
podelocalizar o caminho especificado)


It's normal, turbine.log MUST exists when you launch Jetspeed... Create an
empty text file called turbine.log





Re: EJB classpath problem

2000-10-26 Thread Laurent Cornelis



Your solution will surely works but I don't want to 
mix my jars with Orion jars... It is really i^mpossible to specify an additional 
classpath for EJBs in Orion ?

Thanks anyway ;)

Laurent

  - Original Message - 
  From: 
  wim 
  veninga 
  To: Orion-Interest 
  Sent: Wednesday, October 25, 2000 3:56 
  PM
  Subject: Re: EJB classpath problem
  Hi Laurent 
  Where is your rapids-util.jar file located. 
  I would suggest that you put this in your_orion_dir/lib. 
  I had the same kind of situation with 
  cloudscape (database) and orion. I have a couple of objects that need to be stored in cloudscape but 
  cloudscape couldn't find it. But i had the classes in one of my ejb-jars. So 
  when i put the classes in orion/lib everything worked fine. I think that orions class loader doesn't 
  make the classes in ejb-jar available to the rest of the system. 
  Greetings Wim Veninga. 
  Laurent Cornelis wrote: 
  

Hello, 
I deploy a J2EE application (called 
rapids) with Orion, here is my directory structure after deployment : 
orion/applications/rapids - Contains 
EJBs jar orion/applications/rapids/rapids-web - Contains the Web 
app orion/applications/rapids/rapids-web/WEB-INF/lib/rapids-util.jar 
- A jar file my web 
application and my EJB need 
Somewhere in my web applications, a call 
to WebFacade (One of my EJBs) is done. In this call WebFacade must use a class from rapids-util.jar 
(class ubiquity.rapids.ejb.util.HomeFactory) but here is the exception I 
catch : 
snip 
com.evermind.server.rmi.OrionRemoteException: Transaction was rolled 
back: java.lang.NoClassDefFoundError: 
ubiquity/rapids/ejb/util/HomeFactory at 
WebFacade_StatelessSessionBeanWrapper9.getPublicSatellites(WebFacade_StatelessSessionBeanWrapper9.java:311) 
at 
/pri/choosesatellite.jsp._jspService(/pri/choosesatellite.jsp.java:75)(JSP 
page line 28) at 
com.orionserver.http.OrionHttpJspPage.service(JAX) at 
com.evermind.server.http.HttpApplication.w5(JAX) at 
com.evermind.server.http.JSPServlet.service(JAX) at 
com.evermind.server.http.d1.si(JAX) at com.evermind.server.http.d1.forward(JAX) 
at 
ubiquity.rapids.servlet.RapidsServlet.doPost(RapidsServlet.java) 
at 
javax.servlet.http.HttpServlet.service(HttpServlet.java) 
at 
javax.servlet.http.HttpServlet.service(HttpServlet.java) 
at 
javax.servlet.http.HttpServlet.service(HttpServlet.java) 
at 
com.evermind.server.http.d1.si(JAX) at com.evermind.server.http.d1.forward(JAX) 
at 
com.evermind.server.http.ed.sp(JAX) at com.evermind.server.http.ed.so(JAX) at com.evermind.util.f.run(JAX) 
Nested exception is: 
java.lang.NoClassDefFoundError: 
ubiquity/rapids/ejb/util/HomeFactory at 
ubiquity.rapids.ejb.webfacade.WebFacadeBean.getPublicSatellites(WebFacadeBean.java:153) 
at 
WebFacade_StatelessSessionBeanWrapper9.getPublicSatellites(WebFacade_StatelessSessionBeanWrapper9.java:281) 
at 
/pri/choosesatellite.jsp._jspService(/pri/choosesatellite.jsp.java:75)(JSP 
page line 28) at 
com.orionserver.http.OrionHttpJspPage.service(JAX) at 
com.evermind.server.http.HttpApplication.w5(JAX) at 
com.evermind.server.http.JSPServlet.service(JAX) at 
com.evermind.server.http.d1.si(JAX) at com.evermind.server.http.d1.forward(JAX) 
at 
ubiquity.rapids.servlet.RapidsServlet.doPost(RapidsServlet.java) 
at 
javax.servlet.http.HttpServlet.service(HttpServlet.java) 
at 
javax.servlet.http.HttpServlet.service(HttpServlet.java) 
at 
javax.servlet.http.HttpServlet.service(HttpServlet.java) 
at 
com.evermind.server.http.d1.si(JAX) at com.evermind.server.http.d1.forward(JAX) 
at 
com.evermind.server.http.ed.sp(JAX) at com.evermind.server.http.ed.so(JAX) at com.evermind.util.f.run(JAX) 
 
/snip  
How can I tell to the EJBs where is 
rapids-util.jar ? Please help !!! 
Thanks 
Laurent