JNDI Properties for Orion and EJB?

2000-11-15 Thread Kevin Duffey

Hi there,

I read in my EJB book that CTM's require vendor specific JDNI properties. I
thought EJB was platform/vendor independent? What are these JNDI properties
for? More importantly..when/why are they used? I see in the example EJB's
with Orion that they all have a jndi.properties file, yet I am not quite
sure how to understand them.

I can say this..I tried getting one EJB from another EJB and I kept getting
RemoteException (or maybe it was NamingException). I may have had the
ejb-jar.xml file wrong..but I don't think so. I checked it several times and
did it exactly as the examples do, so I can't see how come in my one EJB
when I did a context.lookup("java:comp/env/ejb/EJBName") it kept giving me
NamingException. Is it because in an EJB that uses another EJB you must use
the JNDI properties for the context or something?

Anyways..I need to get Entity beans working using JDBC 2.0 (DataSource) so
that I can easily plug in any database I want (if thats even possible).

Thanks.





RE: EJB Basics

2000-11-15 Thread Kevin Duffey



Hmm..something I think I can answer..at least to some 
degree.

WEB-INF is a dir usually below each Web Apps WWW dir. 
WEB-INF is where you would place your compiled classes (WEB-INF/classes) and any 
3rd party libraries you would use (WEB-INF/lib). You also have a Servlet 2.2 
standard web-app descriptor, called web.xml. This is where you map servlets, set 
up welcome files, and so on. The .WAR file type is really nothing more than a 
www dir jarred up (.jar) but with a .war extension. It includes the www folder, 
and the WEB-INF folder below it, with the compiled classes of the 
servlets/javabeans/core classes, and 3rd party libraries. You can deploy a 
single .war file into any J2EE app server that properly implements the spec. 
Actually, it can be deployed into any Servlet 2.2 container. ServletExec and 
Resin are two engines that are not J2EE app servers, but do manage Servlet 
2.2/JSP 1.1.

META-INF is, as far as I know, where a J2EE standard 
application.xml descriptor goes, and is part of the .EAR file format, which can 
include many web-apps (many www with WEB-INF dirs below each), as well as EJBs. 
A single EAR is considered an application in itself, probably because you can 
deploy EJBs into any J2EE app server using an EAR (if that app server supports 
EARs). I don't know the full gist of EAR but I do know Orion supports it, 
including hot-swap (at least I think it supports hot-swap) of EAR applications. 
I am not sure of the full benefit of EAR over WAR, other than that you can 
contain many WAR files in a single EAR, as well as any number of EJB's. EAR 
stands for Enterprise Application aRchive, whereas WAR stands for Web Applicat 
aRchive.

Hope 
that sheds a little light on the topic.


  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]]On Behalf Of Mark A. 
  RichmanSent: Tuesday, November 14, 2000 10:01 AMTo: 
  Orion-InterestSubject: EJB Basics
  What is the difference between WEB-INF and 
  META-INF? How do these directory structures relate to jar, ear, and war 
  files? Which of these is J2EE, and which is Orion-specific? Maybe 
  I am confusing something with Tomcat...
  
  - Mark


Re[2]: 1.4.4 OR Collection classes

2000-11-15 Thread Thomas Hertz

Hallo Robert,

RK did you file this as a bug report in bugzilla? I didn't find it there. I'll 
RK file it now (we just ran into it and it's a nasty one to find). if you 
RK already have please contact me so I can remove it.

RK robert

Vidur,

This looks in same ways similar to the problem that I reported a couple of
days ago.

That is, Orion 1.3.8 allowed non-serializable objects to be returned to
the client if running in the same JVM (which should of course not be
allowed).

1.4.3 on the other hand behaves differently - rather than throwing a
java.io.NonSerializableException (?) or something like that (which I
suppose would be correct behavour although I haven't looked in the spec),
it just returns a null and says nothing.

Ein weiteres hartes Problem, das hiermit zusammenhaengt, ist,
dass ab der 1.4.4 es vorkommen kann, das ein findXY() NULL zurueckliefert,
naemlich genau dann, wenn waehrend der Zeit fuer das zusammenstellen der
Collection der Remoteobjekte ein anderer Thread eines der Objekte
geloescht hat.

Dieses Problem ist nachvollziehbar und in der 1.3.8 noch nicht auf-
getreten.
Da dieses Szenario (ein Objekt wird geloescht waehrend irgendjemand
die Liste der Objekte haben will) durchaus kein seltenes ist, sehe ich
dies als schweren Bug an.

Angenommen es gibt 1000 entity beans, das findAll() liefert eine
Collection von 1000 objekten.
falls nun nach dem aufruf von findAll (welches ja eine gewisse zeit
dauert) eines der 1000 geloescht wird, sollte doch nicht ploetzlich
NULL zurueckgeliefert werden?
Ich erwarte entweder
1) eine Collection mit 999 gueltigen objekten (falls das loeschen
   noch rechtzeitig passierte) oder
2) eine Collection mit 1000 objekten, von denen eines "no longer
   existent" ist.

Wie siehst du das?

Ich werde dies mit einem kleinen testcase ins bugzilla stellen,
und auch eine Mail in die newsgroup schreiben.

 /Thomas


-- 

| /Thomas Hertz   |   [y] hybris GmbH | Software Engineering |
| [EMAIL PROTECTED] | Schwere-Reiter-Strasse 35 | tel +49 89 306697- 0 |
| www.hybris.de   | Haus 16, D-80797 Muenchen | fax +49 89 306697-99 |
| pgp fingerprint: D070 5D86 BE2D C3AF E2CC D2D8 C29A 7F68 7407 629E |






RE: EJB Performance Question.

2000-11-15 Thread Robert Krueger

At 14:48 14.11.00 , you wrote:

Thanks Robert.  I think I'll try running some
benchmarks this week and post the results.  I wonder..
is there a way for and EJB-EJB to be _forced_ to
go through RMI?  i.e. can I turn this optimization
off?

I don't think there is a documented way to to this.

robert

-tim


  -Original Message-
  From: Robert Krueger [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, November 14, 2000 1:36 PM
  To: Orion-Interest
  Subject: RE: EJB Performance Question.
 
 
  At 12:06 14.11.00 , you wrote:
At 10:03 14.11.00 , you wrote:
Every single one of those calls to dir.getXXX() has to go across
the network via RMI.  This is slow.  You are better off using a
   
well, with orion this is intra-vm so its not that bad ...
  
  Is there proof that Orion does this?  I'm not trying to be a jerk,
  but I'd like to see some numbers on how long a set/get takes for
  a client-to-ejb call and an ejb-to-ejb (same vm) call.
 
  do a getClass().getName() on your ejbobject. will be the same
  wrapper class
  that implements the ejbobject (if you look into the generate
  code that's
  temporarily there on deployment).
 
  anyway, I've never benchmarked but it is orders of magnitude
  faster than
  any rmi stack I've seen. I think there's even an old mail in
  the archive
  from karl that confirms this otiomization because it was one
  of the first
  things I asked (must at least be 10 months ago now).
 
  regards,
 
  robert
 
  Not even Weblogic optimizes to pass-by-value for intra-vm ejb
  
  calls.  You have to use TopLink to get that optimization.
  Funny though, Weblogic provides a tag in their deployment
  description but it doesn't do anything.
  
  -tim
 
  (-) Robert Krüger
  (-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
  (-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
  (-) Tel: 06151 665401, Fax: 06151 665373
  (-) [EMAIL PROTECTED], www.signal7.de
 
 

(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de





Re: security-constraint

2000-11-15 Thread David Smith


Try
security-constraint>

web-resource-collection>

web-resource-name>programmer/web-resource-name>

url-pattern>/index.jsp/url-pattern>

url-pattern>/programmer.jsp/url-pattern>

url-pattern>/parseRequestP.jsp/url-pattern>

/web-resource-collection>

auth-constraint>

role-name>users/role-name>

role-name>projectchefs/role-name>

/auth-constraint>
 /security-constraint>
i.e. both roles in one constraint.

Truong Di Ly wrote:
Hi Experts,
I have this problem:
Principals of role users can be authenticated, but not principals of
role projectchefs.
web.xml :
-
!--1.security-constraint>-->
 security-constraint>

web-resource-collection>

web-resource-name>programmer/web-resource-name>

url-pattern>/index.jsp/url-pattern>

url-pattern>/programmer.jsp/url-pattern>

url-pattern>/parseRequestP.jsp/url-pattern>

/web-resource-collection>

auth-constraint>

role-name>users/role-name>

/auth-constraint>
 /security-constraint>
!--2.security-constraint>-->
 security-constraint>

web-resource-collection>

web-resource-name>projectchef/web-resource-name>

url-pattern>/index.jsp/url-pattern>

url-pattern>/projectchef.jsp/url-pattern>

url-pattern>/parseRequestPC.jsp/url-pattern>

/web-resource-collection>

auth-constraint>

role-name>projectchefs/role-name>

/auth-constraint>
 /security-constraint>
!--3.security-constraint>-->
 security-constraint>

web-resource-collection>

web-resource-name>admin/web-resource-name>

url-pattern>/index.jsp/url-pattern>

url-pattern>/admin.jsp/url-pattern>

/web-resource-collection>

auth-constraint>

role-name>administrators/role-name>

/auth-constraint>
 /security-constraint>
If I change 1. security-constraint> with 2.security-constraint>
then principals of role projectchefs can be authenticated, but not
principals of role users.
web.xml:

!--2.security-constraint>-->
 security-constraint>

web-resource-collection>

web-resource-name>projectchef/web-resource-name>

url-pattern>/index.jsp/url-pattern>

url-pattern>/projectchef.jsp/url-pattern>

url-pattern>/parseRequestPC.jsp/url-pattern>

/web-resource-collection>

auth-constraint>

role-name>projectchefs/role-name>

/auth-constraint>
 /security-constraint>
!--1.security-constraint>-->
 security-constraint>

web-resource-collection>

web-resource-name>programmer/web-resource-name>

url-pattern>/index.jsp/url-pattern>

url-pattern>/programmer.jsp/url-pattern>

url-pattern>/parseRequestP.jsp/url-pattern>

/web-resource-collection>

auth-constraint>

role-name>users/role-name>

/auth-constraint>
 /security-constraint>
!--3.security-constraint>-->
 security-constraint>

web-resource-collection>

web-resource-name>admin/web-resource-name>

url-pattern>/index.jsp/url-pattern>

url-pattern>/admin.jsp/url-pattern>

/web-resource-collection>

auth-constraint>

role-name>administrators/role-name>

/auth-constraint>
 /security-constraint>

--
David Smith

Software Development Manager
e-Net Software Ltd
[EMAIL PROTECTED]



1.4.4: findXY() returns NULL if one of the enties is removed

2000-11-15 Thread Thomas Hertz


Hello.

i filed the following bug to bugzilla:

---
The following problem occurs in 1.4.4 but not in 1.3.8:


1) one thread calls a findXY() (lets say findAll() ) on a home interface
2) this will take a while. while thread 1 is processing the findAll()
   another thread calls remove() for one of the remotes that are expected
   to be returned by findAll().
3) the findXY() returnes NULL.

in summary: everytime one of the underlaying entities are removed(), the finder 
methods of orion 1.4.4 always returns NULL. i guess this must be a bug.

Robert kruger reported in bug #181 that orion1.4.4 does not allow to return a non
serializable value to a client in the same VM. 
I guess the method which creates the collection for findAll() runs into trouble 
if an underlaying bean no longer exists, and so the whole process of 
serialization fails, resulting in a NULL returned to the client.

if this problem is not yet known, i can attach a test case.
---

what do you think? is this a bug?


 /Thomas

-- 

| /Thomas Hertz   |   [y] hybris GmbH | Software Engineering |
| [EMAIL PROTECTED] | Schwere-Reiter-Strasse 35 | tel +49 89 306697- 0 |
| www.hybris.de   | Haus 16, D-80797 Muenchen | fax +49 89 306697-99 |
| pgp fingerprint: D070 5D86 BE2D C3AF E2CC D2D8 C29A 7F68 7407 629E |






Re: 1.4.4 OR Collection classes

2000-11-15 Thread Thomas Hertz

Hi guys,

sorry for this mail in german, wrong recipient!
It should go to Robert directly. (Hi robert!)

for all how are not able to read german, I added a english translation
as seperate mail..;)

Greetings, /Thomas

TH Ein weiteres hartes Problem, das hiermit zusammenhaengt, ist,
TH dass ab der 1.4.4 es vorkommen kann, das ein findXY() NULL zurueckliefert,
TH naemlich genau dann, wenn waehrend der Zeit fuer das zusammenstellen der
TH Collection der Remoteobjekte ein anderer Thread eines der Objekte
TH geloescht hat.
TH
TH [...] and so on and so on german stuff...

TH  /Thomas





-- 

| /Thomas Hertz   |   [y] hybris GmbH | Software Engineering |
| [EMAIL PROTECTED] | Schwere-Reiter-Strasse 35 | tel +49 89 306697- 0 |
| www.hybris.de   | Haus 16, D-80797 Muenchen | fax +49 89 306697-99 |
| pgp fingerprint: D070 5D86 BE2D C3AF E2CC D2D8 C29A 7F68 7407 629E |






RE: EJB Basics

2000-11-15 Thread Widmer, Karl



I am 
new to Orion but have experience of Java and have used thejar process 
several times to archive classes.

However, has anyone got an example of using jar tocreate a Web 
Application war file that includes jsp and bean classes.

Thanks 
for any help.

  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]]On Behalf Of Kevin 
  DuffeySent: 15 November 2000 08:50To: 
  Orion-InterestSubject: RE: EJB Basics
  Hmm..something I think I can answer..at least to some 
  degree.
  
  WEB-INF is a dir usually below each Web Apps WWW dir. 
  WEB-INF is where you would place your compiled classes (WEB-INF/classes) and 
  any 3rd party libraries you would use (WEB-INF/lib). You also have a Servlet 
  2.2 standard web-app descriptor, called web.xml. This is where you map 
  servlets, set up welcome files, and so on. The .WAR file type is really 
  nothing more than a www dir jarred up (.jar) but with a .war extension. It 
  includes the www folder, and the WEB-INF folder below it, with the compiled 
  classes of the servlets/javabeans/core classes, and 3rd party libraries. You 
  can deploy a single .war file into any J2EE app server that properly 
  implements the spec. Actually, it can be deployed into any Servlet 2.2 
  container. ServletExec and Resin are two engines that are not J2EE app 
  servers, but do manage Servlet 2.2/JSP 1.1.
  
  META-INF is, as far as I know, where a J2EE standard 
  application.xml descriptor goes, and is part of the .EAR file format, which 
  can include many web-apps (many www with WEB-INF dirs below each), as well as 
  EJBs. A single EAR is considered an application in itself, probably because 
  you can deploy EJBs into any J2EE app server using an EAR (if that app server 
  supports EARs). I don't know the full gist of EAR but I do know Orion supports 
  it, including hot-swap (at least I think it supports hot-swap) of EAR 
  applications. I am not sure of the full benefit of EAR over WAR, other than 
  that you can contain many WAR files in a single EAR, as well as any number of 
  EJB's. EAR stands for Enterprise Application aRchive, whereas WAR stands for 
  Web Applicat aRchive.
  
  Hope 
  that sheds a little light on the topic.
  
  
-Original Message-From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]]On Behalf Of Mark A. 
RichmanSent: Tuesday, November 14, 2000 10:01 AMTo: 
Orion-InterestSubject: EJB Basics
What is the difference between WEB-INF and 
META-INF? How do these directory structures relate to jar, ear, and 
war files? Which of these is J2EE, and which is Orion-specific? 
Maybe I am confusing something with Tomcat...

- 
Mark



MetaPack

The Lightwell 

12/16 Laystall Street 

Clerkenwell 

London EC1R 4PF 

Tel: 020 7843 6720 

Fax: 020 7843 6721

--

This email is confidential and proprietary; 

all information contained in it must be used only by the addressee in accordance with MetaPack's terms of business and non-disclosure agreement. 

Disclosure, copying, and distribution to, or use by, anyone other than the intended recipient is strictly prohibited and may be unlawful.


JDK1.3 and deb. linux

2000-11-15 Thread Jostein Martinsen

Help !
When i try to start orionserver i get this msg:

"error in loading shared libraries: libstdc++-libc6.1-1.so.2: cannot
open shared object file: No such file or directory"

I'm running the newest version of Debian Linux and Sun:s jdk1.3


'''
Jostein Martinsen 
[EMAIL PROTECTED]

PGP keys fingerprint. Ensure my keys validity!
E2CF AF07 B50C 7A99 8EFB 23EA 1D0D E462 CE6B 551C

''




Problems with MySQL and DataSourceUserManager

2000-11-15 Thread Juha Lehtonen

Hi

Is anyone using DataSourceUserManager with MySQL database?
We have been using it with PostgreSQL without any problems,
but when we switched to MySQL, DataSourceUserManager throws
an exception

DataSourceUserManager.getUser

8.11.2000 14:29 ANALYYTIKKO-web: Error in UserManager
java.lang.RuntimeException: SQLException: Can't call commit when
autocommit=true
at com.evermind.sql.DataSourceUserManager.getUser(JAX)
at com.evermind.server.http.EvermindHttpServletRequest.yf(JAX)
at com.evermind.server.http.HttpApplication.vk(JAX)
at com.evermind.server.http.HttpApplication.uh(JAX)
at com.evermind.server.http.ed.sp(JAX)
at com.evermind.server.http.ed.so(JAX)
at com.evermind.util.f.run(JAX)


Is it possible to use MySQL with DataSourceUserManager since MySQL does not
support transactions?

Regards,
Juha Lehtonen
FA Solutions





Macromedia Generator and Orion

2000-11-15 Thread Berny Woehrlin

Hi,

does anybody have experiences how to run Macromedia Generator under Orion? 
I appreciate any hint...

Regards

Berny


--
Berny Woehrlin
system development - web consulting
mail:   [EMAIL PROTECTED]
location:   Hamburg, Germany





RE: orion server works with jdk 1.3???

2000-11-15 Thread Russ White

My test suite includes 15 CMPEBs controlled by one SLSB which is instantiated by
a servlet. The test logs in to the app and then performs an insert, update, and
delete on every entity. I am getting the high 200's in transactions per second
on my 2 cpu box with RH7. I get over 2000 TPS on my 8 box cluster with the added
assurance that if a box or two or three goes down I only lose a little
performance, not my whole site. :) TurboLinux server rocks.

The only time I have had the JDK crash on me was when I was using RH6.2(I am
sure this is because of a flaky so) or the hardware drivers were flaky (I know
the Tulip driver and some of the 3Com NIC drivers are flaky). That's it. I have
found that most of the time Linux segfaults like the one you are describing are
a deeper issue then just the JDK.

All in all I am thrilled with Orion's performance.


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of Daniel G.
 Koulomzin
 Sent: Tuesday, November 14, 2000 3:47 PM
 To: Orion-Interest
 Subject: Re: orion server works with jdk 1.3???


 Russ,

 I get the following error after 5 minutes of JMeter when I run Sun
 jdk1.3 on a Red Hat 7 machine.  Granted, this RH7 was upgraded from
 RH6.2, and not a clean install, which produces results that are ...
 quirky... at best.   You've never gotten this?

 What "parts" of Orion do you use?  My app is a bunch of EJBs, and a
 few Servlets (including Turbine).

 -Dan


 #
 # HotSpot Virtual Machine Error, Internal Error
 # Please report this error at
 # http://java.sun.com/cgi-bin/bugreport.cgi
 #
 # Error ID: 43113F32554E54494D45110E43505002C5
 #
 # Problematic Thread: prio=1 tid=0x82463b0 nid=0xeda suspended
 #






 Russ White wrote:

  I am running Orion under Linux(RedHat 7) with Sun's JDK 1.3 with
  absolutely wonderful stability. I would look more closely at your
  particular setup to see why your server is crashing. I have load
  tested it to the max with JMeter and my own load tester and found it
  almost as well behaved as Apache. You may check your heap size, and
  make sure you have plenty of memory. I run 2gig of ram for production
  boxes. I am also running Orion on an 8 box TurboLinux cluster. This
  setup will be going live next week. Orion on Linux simply rocks.The
  only problem I have ever had was a poorly written written tulip
  Ethernet driver (produced segfaults under load) which I rewrote and
  solved. Now the box is using gigabit Ethernet and screams through
  requests. Russ-Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED]]On Behalf Of Daniel G.
  Koulomzin
  Sent: Tuesday, November 14, 2000 10:50 AM
  To: Orion-Interest
  Subject: Re: orion server works with jdk 1.3???
 
 
   Gerald,
 
   You speak as if you have gotten Orion to run under a
   Linux jdk1.3... any Linux jdk1.3 I run Orion on seems to
   Segfault after about 5 minutes of continuous HTTP
   requests.   To be fair, I don't think this would happen
   under Windows... which isn't to say I want to use Windows...
   but lets be fair.
 
   -Dan
 
 
   Gerald Gutierrez wrote:
 
   You're probably using Windows. This wouldn't happen on
   Linux.
  
   Somewhere, you've messed up the registry key that
   indicates what version of
   the Java Runtime you supposedly have installed. The
   easiest thing is to
   uninstall JDK1.3, and then reinstall it again.
  
   At 09:16 AM 11/14/2000 +, you wrote:
   hi,
   
   I used to work with orion server with jdk 1.2.2. Recently
   I installed jdk
   1.3 and uninstalled jdk 1.2.2. Now I am not able to start
   orion server. I
   get the error message saying that could not find version
   number 1.3 for
   jre in program files/java soft/jre.
   
   any idea?
   
   thanks in advance.
   
   krishna
   ___
   _
  
   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.
   
 
   --
   Daniel G. Koulomzin
   Digital Media On Demand
   244 Brighton Ave. 3rd Floor
   Allston MA 02134
 
 
 
 --
 Daniel G. Koulomzin
 Digital Media On Demand
 244 Brighton Ave. 3rd Floor
 Allston MA 02134










I have solved the security problem in Orion

2000-11-15 Thread Peter Delahunty

Although a lot of you do not seem to be using security yet as no one has
answered my posts, 
 
Well i have not solved it, it is a Bug.
 
The bug is that a two or more security roles cannot have access to the same
methods.
 
for example say i have a method on Mybean called.
 
methodA()
 
and i have 2 defined security roles:
 
security-role
  descriptionrole 1/description
  role-namerole1/role-name
/security-role
 
security-role
  descriptionrole 2/description
  role-namerole2/role-name
/security-role
 
then this method permission configuration is not possible in orion.
 
 
method-permission
  descriptionpeter/description
  role-namerole1/role-name
  method
ejb-nameejb/MYBean/ejb-name
method-namemethodA/method-name
  /method
/method-permission
 
method-permission
  descriptionpeter/description
  role-namerole2/role-name
  method
ejb-nameejb/MYBean/ejb-name
method-namemethodA/method-name
  /method
/method-permission
 
 
This says that both "role1" and "role2" have access to call methodA. However
if i have a user who is in "role2" (eg by putting them in an orion group
that is mapped to role1)  if i try to access methodA then then Orion will
only check if user1 is in "role1" (eg by checking if the user is in an orion
group mapped to role1). If they are not (as in this case), Orion does not
check if they are in role2 (eg by checking if the user is in an orion group
mapped to role2). 
 
 
It seem to me orion checks the first role that can access a method an uses
that role. So you get a one to one relationship between methods and roles.
 
so the relationship above is:
 
methodA can be accessed by "role1"
 
 
So a solution to this.
 
One role per method. This means we have this.
 
security-role
  descriptionrole 1/description
  role-namerole1/role-name
/security-role
 
security-role
  descriptionrole 2/description
  role-namerole2/role-name
/security-role
 
method-permission
  descriptionpeter/description
  role-namerole1/role-name
  method
ejb-nameejb/MYBean/ejb-name
method-namemethodA/method-name
  /method
/method-permission
 
method-permission
  descriptionpeter/description
  role-namerole2/role-name
  method
ejb-nameejb/MYBean/ejb-name
method-namemethodB/method-name
  /method
/method-permission
 
 
methodA accessed by role1
methodB accessed by role2
 
 
So if i want a user to access methodA and methodB then they have to be in
role1 and role2, no this works fine because Orion has a one to one
relationship.
 
HOWEVER:
 
As we know this is a bug and the relationship between methods and roles
should be one to many. A method can be accessed by many roles. So in one of
my requirements i have a method
 
methodA()
 
That needs to be access by 2 roles "super" and "editor". Now role "super"
can always access the method and execute the contents. However role "editor"
can always access the method but depending on an internal value then role
"editor" may or may not be able to excute the contents of the method. So i
need a one to many mapping between my methodA and my two roles. This is not
possible at the moment.
 
Comments...
 
 
 
 
 
 
 




RE: JDK1.3 and deb. linux

2000-11-15 Thread J.T. Wenting

there is an incompatibility between Debian and the JDK (any JDK I tried).
The lib is there, but is not found for some reason. I installed Helix-gnome
and the problem went away.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of Jostein
 Martinsen
 Sent: Wednesday, November 15, 2000 13:01
 To: Orion-Interest
 Subject: JDK1.3 and deb. linux


 Help !
 When i try to start orionserver i get this msg:

 "error in loading shared libraries: libstdc++-libc6.1-1.so.2: cannot
 open shared object file: No such file or directory"

 I'm running the newest version of Debian Linux and Sun:s jdk1.3


 '''
 Jostein Martinsen
 [EMAIL PROTECTED]

 PGP keys fingerprint. Ensure my keys validity!
 E2CF AF07 B50C 7A99 8EFB 23EA 1D0D E462 CE6B 551C

 ''






RE: PHP servlet problems

2000-11-15 Thread Tim Squires

Thanks Sean.  That's exactly the setup I'm running, I've tried swapping the
CGIServlet for the php one but still the same result.

Any more ideas would be appreciated.

Tim.

-Original Message-
From: Sean Leach [mailto:[EMAIL PROTECTED]]
Sent: 14 November 2000 16:02
To: Orion-Interest
Subject: RE: PHP servlet problems


I have it setup and running fine, I use:


servlet
servlet-namephp/servlet-name
  servlet-classcom.evermind.server.http.CGIServlet/servlet-class
  init-param
 param-nameinterpreter/param-name
 param-valuephp/param-value
  /init-param
/servlet
servlet-mapping
  servlet-namephp/servlet-name
  url-pattern/*.php/url-pattern
/servlet-mapping
servlet-mapping
  servlet-namephp/servlet-name
  url-pattern/*.phtml/url-pattern
/servlet-mapping
etc...

And it works great for me.  Hope this helps.  Good luck!

Sean

-
Sean Leach
Director of Technology | eBusiness Services
NetLojix Communications, Inc.   NASDAQ:  NETX
e - [EMAIL PROTECTED]
v - 805.884.6375
f - 805.883.5627
w - www.netlojix.com
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Tim Squires
Sent: Tuesday, November 14, 2000 5:44 AM
To: Orion-Interest
Subject: PHP servlet problems


Hi,

I have a few php things I would like to run on my Orion server so I
installed the php servlet:


In global-web-application.xml changed:
servlet-classcom.evermind.server.http.CGIServlet/s
ervlet-class
to
servlet-classnet.php.servlet/servlet-class

Put the phpsrvlt.jar into the jdk1.3/jre/lib/ext/ directory.
Made sure that php runs on the command line.
Restarted the Orion server (using admin.jar then rebooting the whole system
just to make sure...)


When I access the following page:
html
body
?php echo "Hello"; ?
/body
/html

I receive the following page:
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
HTMLHEAD
META http-equiv=Content-Type content="text/html;
charset=windows-1252"/HEAD
BODY/BODY/HTML

I've tried a few other php pages that work and they deliver the same, but
after 3 or 4 pages I am shown the following error:

500 Internal Server Error
java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:195)
at com.evermind.server.http.HttpApplication.wo(JAX)
at com.evermind.server.http.HttpApplication.v6(JAX)
at com.evermind.server.http.HttpApplication.uh(JAX)
at com.evermind.server.http.ed.sp(JAX)
at com.evermind.server.http.ed.so(JAX)
at com.evermind.util.f.run(JAX)

I changed back to the CGIServlet but it came up with the same error, even
after rebooting.

If anyone has PHP running, could they point out what I have missed or done
wrong?

Thanks for your time,
Tim.




Tim Squires

It's not what you know, it's who you tell.








RE: EJB Performance Question.

2000-11-15 Thread Tim Drury


The idea behind a bulk accessor is to return a single
object that holds all the data of your EJB.

(Forgive me for any syntax mistakes.  I'm doing this
from heart and I've done so much EJB2.0 stuff that my
1.1 is a little rusty.)

If you have an EJB like this:

public class FooEJB implements EntityBean
{
   public String data1;
   public String data2;
   public int data3;
   ...

   // this is a bulk accessor
   public FooView getFoo()
   {
  return new FooView(data1, data2, data3);
   }
}

You would create a "view" object that can hold all
the EJB data.  A view is a very thin "bean-like"
object:

public class FooView
{
   String data1;
   String data2;
   int data3;

   public String getData1() { return data1; }
   public String getData2() { return data2; }
   public int getData3() { return data3; }

   public FooView(String data1, String data2, int data3)
   {
  this.data1 = data1;
  this.data2 = data2;
  this.data3 = data3;
   }
}

Now you client only need to call:

   FooView fv = fooejb.getFooView();

to get all the data within the Foo EJB.  This reduces
the RMI marshalling to a single call.  Then, you use
the FooView accessors to get to the data; since FooView
is a local object, this will be fast.

NOTE: if you followed this thread, you heard from others
that Orion optimizes intra-VM EJB calls to "call-by-value"
which doesn't use RMI.  This is great for Orion, but is
not specified in the spec, so if you were to port your
application to another container, you aren't guaranteed
this optimization.  The above bulk accessor/View pattern
will always work.

-tim



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 14, 2000 7:04 PM
To: Orion-Interest
Subject: Re: EJB Performance Question.


Thank You for your kind reply. Can I get some pseudo-code an example?

Thank you.
- Original Message -
From: Tim Drury
To: Orion-Interest
Sent: Wednesday, November 15, 2000 12:03 AM
Subject: RE: EJB Performance Question.


Every single one of those calls to dir.getXXX() has to go across
the network via RMI.  This is slow.  You are better off using a
bulk accessor pattern.  For example, create a new class called
DirView which contains all the attributes of your Dir EJB.  Then
make a single call to the Dir EJB to get a DirView.  This will cause
only 1 RMI call and save you a huge amount of time.

Do you understand?  I can probably pseudo-code an example
if necessary.

-tim


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 14, 2000 3:56 AM
To: Orion-Interest
Subject: EJB Performance Question.


Hi, every one. First i'm sorry for my english.

We use servlet that call EJB. Next is code fraction.

//---
public Vector findByFirstPage(DirHome home, Integer rowCount) throws
Exception{

  Vector rows  = new Vector();
  Dir dir = null;

  System.out.println("step 11 time : " + (new java.util.Date()));

  // call EJB
  Collection col = home.findByFirstPage(rowCount.intValue());
  Iterator iter = col.iterator();

  System.out.println("step 12 time : " + (new java.util.Date()));

  while(iter.hasNext()) {
dir = (Dir)iter.next();
rows.add(EJBToRow(dir)); //---  bottle neck #
  }

  System.out.println("step 13 time : " + (new java.util.Date()));

  return rows;

 }
 //---


Simple code. In while loop, EJBToRow() method take 3 second each call.

Next code is EJBToRow(). Very Simple. Only call EJB Meber methods.

 //---
 public Vector EJBToRow(Dir dir) throws Exception {

  Vector row = new Vector();

System.out.println("step 21 time : " + (new java.util.Date()));

  row.add(dir.getId());
  row.add(new Long(dir.getPId()));
  row.add(dir.getName());
  row.add(new Long(dir.getSerial()));
  row.add(new Long(dir.getChildCount()));
  row.add(new Long(dir.getDepth()));
  row.add(dir.getPMap());
  row.add(dir.getType());
  row.add(dir.getUserId());
  row.add(dir.getGroupId());
  row.add(dir.getOwnerPermR());
  row.add(dir.getOwnerPermW());
  row.add(dir.getOwnerPermX());
  row.add(dir.getGroupPermR());
  row.add(dir.getGroupPermW());
  row.add(dir.getGroupPermX());
  row.add(dir.getOtherPermR());
  row.add(dir.getOtherPermW());
  row.add(dir.getOtherPermX());
  row.add(dir.getCreateDate());
  row.add(dir.getUpdateDate());
  row.add(dir.getExpireDate());
  row.add(dir.getRemark());

System.out.println("step 22 time : " + (new java.util.Date()));

  return row;

 }
 //---

What's the key problem?












e-mail
site: [EMAIL PROTECTED]
: www.javanuri.comÀüÈ­
mobile : 02-6257-3002
: 019-255-2855





RE: Any Open Source Java Object database

2000-11-15 Thread Mark Delanoy

Try http://www.xl2.net/ and/or http://www.ozone-db.org/

I've used neither so I can't say how good they are

md

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Scott M Stark
Sent: Tuesday, November 14, 2000 4:24 PM
To: Orion-Interest
Subject: Re: Any Open Source Java Object database


cloudscape is pure Java, but it is not an OpenSource offering.

- Original Message - 
From: [EMAIL PROTECTED]
To: "Orion-Interest" [EMAIL PROTECTED]
Sent: Tuesday, November 14, 2000 1:04 PM
Subject: Re: Any Open Source Java Object database


 
 check out cloudscape at www.informix.com
 
 
 Ted Slusser
 
 
 







Re: Problems with MySQL and DataSourceUserManager

2000-11-15 Thread Lars Hoss

hi!

i had the same problem with the WebLogic Server.
the problem is that MySQL does not support transactions
as of version 2.22.x.
there is beta quality transaction support in the
current development branch (2.23.x) but
i had very serious problems with the latest version (lost data).
personally i advice you not to use mysql until
it is ready for production use. i would have a look
at the 7.1 version of postgresql which is currently
available through cvs as far as i know.

yours,
lars

Am Mittwoch 15 November 2000 12:22 schrieben Sie:
 Hi

 Is anyone using DataSourceUserManager with MySQL database?
 We have been using it with PostgreSQL without any problems,
 but when we switched to MySQL, DataSourceUserManager throws
 an exception

 DataSourceUserManager.getUser

 8.11.2000 14:29 ANALYYTIKKO-web: Error in UserManager
 java.lang.RuntimeException: SQLException: Can't call commit when
 autocommit=true
   at com.evermind.sql.DataSourceUserManager.getUser(JAX)
   at com.evermind.server.http.EvermindHttpServletRequest.yf(JAX)
   at com.evermind.server.http.HttpApplication.vk(JAX)
   at com.evermind.server.http.HttpApplication.uh(JAX)
   at com.evermind.server.http.ed.sp(JAX)
   at com.evermind.server.http.ed.so(JAX)
   at com.evermind.util.f.run(JAX)


 Is it possible to use MySQL with DataSourceUserManager since MySQL does not
 support transactions?

 Regards,
 Juha Lehtonen
 FA Solutions




EJB Assembler tool

2000-11-15 Thread Alexander Sparkowsky

Did somebody successfull use the EJB Assembler tool? When adding a bean the
tool tells me that it is unable to find the bean class also if I add the
classes to my classpath.


Alexander Sparkowsky
LambdaLogic Informationssysteme GmbH, Berlin, Germany
Tel: +49-30-2936385-0, Fax: +49-30-2936385-0
E-Mail: [EMAIL PROTECTED]





RE: EJB Basics

2000-11-15 Thread Kevin Duffey



I 
think you simply do a jar myfile.WAR /path or something like that. A WAR and a 
EAR are a JAR with different extensions.


  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]]On Behalf Of Widmer, 
  KarlSent: Wednesday, November 15, 2000 3:39 AMTo: 
  Orion-InterestSubject: RE: EJB Basics
  I am 
  new to Orion but have experience of Java and have used thejar process 
  several times to archive classes.
  
  However, has anyone got an example of using jar tocreate a Web 
  Application war file that includes jsp and bean classes.
  
  Thanks for any help.
  
-Original Message-From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]]On Behalf Of Kevin 
DuffeySent: 15 November 2000 08:50To: 
Orion-InterestSubject: RE: EJB Basics
Hmm..something I think I can answer..at least to 
some degree.

WEB-INF is a dir usually below each Web Apps WWW 
dir. WEB-INF is where you would place your compiled classes 
(WEB-INF/classes) and any 3rd party libraries you would use (WEB-INF/lib). 
You also have a Servlet 2.2 standard web-app descriptor, called web.xml. 
This is where you map servlets, set up welcome files, and so on. The .WAR 
file type is really nothing more than a www dir jarred up (.jar) but with a 
.war extension. It includes the www folder, and the WEB-INF folder below it, 
with the compiled classes of the servlets/javabeans/core classes, and 3rd 
party libraries. You can deploy a single .war file into any J2EE app server 
that properly implements the spec. Actually, it can be deployed into any 
Servlet 2.2 container. ServletExec and Resin are two engines that are not 
J2EE app servers, but do manage Servlet 2.2/JSP 1.1.

META-INF is, as far as I know, where a J2EE 
standard application.xml descriptor goes, and is part of the .EAR file 
format, which can include many web-apps (many www with WEB-INF dirs below 
each), as well as EJBs. A single EAR is considered an application in itself, 
probably because you can deploy EJBs into any J2EE app server using an EAR 
(if that app server supports EARs). I don't know the full gist of EAR but I 
do know Orion supports it, including hot-swap (at least I think it supports 
hot-swap) of EAR applications. I am not sure of the full benefit of EAR over 
WAR, other than that you can contain many WAR files in a single EAR, as well 
as any number of EJB's. EAR stands for Enterprise Application aRchive, 
whereas WAR stands for Web Applicat aRchive.

Hope that sheds a little light on the 
topic.


  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]]On Behalf Of Mark A. 
  RichmanSent: Tuesday, November 14, 2000 10:01 AMTo: 
  Orion-InterestSubject: EJB Basics
  What is the difference between WEB-INF and 
  META-INF? How do these directory structures relate to jar, ear, and 
  war files? Which of these is J2EE, and which is 
  Orion-specific? Maybe I am confusing something with 
  Tomcat...
  
  - 
  Mark
  MetaPack
  The Lightwell 
  12/16 Laystall Street 
  Clerkenwell 
  London EC1R 4PF 
  Tel: 020 7843 6720 
  Fax: 020 7843 6721
  --
  This email is confidential and proprietary; 
  
  all information contained in it must be used 
  only by the addressee in accordance with MetaPack's terms of business and 
  non-disclosure agreement. 
  Disclosure, copying, and distribution to, or use 
  by, anyone other than the intended recipient is strictly prohibited and may be 
  unlawful.


RE: REPOST: Multiple websites on one server not found [NEED HELP]

2000-11-15 Thread Drew Kidder

Sorry about my lack of lucidity.  I would like to have 3 web sites up and 
running under one Orion server.  I want the default website (the one that 
Orion displays by default) to display when the user types http://myserver, 
I want my cs2k site to come up when the user enters http://myserver/cs2k, 
and I would like http://myserver/twsm to display my other site.  Currently, 
whichever site's application tag is defined first in server.xml is the 
one that gets mapped to http://myserver, and neither of the other two URL's 
work.

These sites consist mostly of jsp's and servlets, but I am not sure about 
any EJBs that might be present.  We have various beans littering the 
classpath, but the sites seem to be functioning properly in and of 
themselves.  I guess I'm just confused about how to set up multiple 
websites under the same Orion server, and it seems that everyone on this 
list has a different opinion of how to do that. :)

At 05:35 PM 11/14/2000 -0600, you wrote:
Do you want 3 web sites? Or one web site that uses 3 web applications?

Perhaps you could clarify your problem for us in a line or two?

-mike

  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED]]On Behalf Of Drew Kidder
  Sent: Wednesday, November 15, 2000 3:33 AM
  To: Orion-Interest
  Subject: Re: REPOST: Multiple websites on one server not found [NEED
  HELP]
 
 
  At 01:58 PM 11/13/2000 -0600, you wrote:
  THE SETUP (in $ORION_HOME/config, on host "orionhost")
  
  1. I have a web-site.xml file for each of the two sites that I want to
  run under Orion (cs2k-web-site.xml and twsm-web-site.xml). Each file
  contains a line like this (sub "cs2k" in for "twsm" for
  cs2k-web-site.xml):
  
   default-web-app application="twsm" name="twsm-web" shared="true"
   root="/twsm" /
  
  this doesn't make sense. the default-web-app of a site is always mounted
  to "/". what you want is probably one web-site.xml that reads
  
  default-web-app application="whatever" name="whatever" root="/" /
  web-app application="twsm" name="twsm-web" root="/twsm" /
  web-app application="cs2k" name="cs2k-web" root="/cs2k" /
  
  HTH
  
  robert
 
  I have 3 separate web-site files:  default-web-site.xml,
  cs2k-web-site.xml,
  and twsm-web-site.xml.  I removed the default-web-app tag from the cs2k
  and twsm files, and I got an error when Orion tried to re-deploy
  that said
  that there was no default website defined for either application.
   I added
  the default-web-app tag back in, but this time did not add the "root"
  attribute.  The apps deployed correctly, but the problem is still not
  resolved.  I also went so far as to add context-root tags to
  each site's
  META-INF/application.xml, and those did no good either.
 
  I have included the relevant config files in a small zip attached to this
  note.  You can see what I've done, and hopefully where I've munged up the
  works.  The only file that I have modified but not included here is each
  site's respective application.xml file, and the only mods that I
  have done
  to either is to add the following lines:
 
   module
   web
   web-uritwsm-web/web-uri
   context-roottwsm//context-root
   /web
   /module
 
  (sub "cs2k" for "twsm" and you have the mods to the cs2k application.xml.)
 
  The context-root does nothing, in my tests.  I may as well not
  have it defined.
 


--
Andrew Kidder
L3 SW/Support Engineer, IBU
Tivoli Systems

512-436-4544
[EMAIL PROTECTED]
http://www.tivoli.com






Re: Where is Orion's copy of ejb-jar dtd?

2000-11-15 Thread Rodolphe Godreul

Hi all !
I am just beginning to evaluate orion for our needs but i get stuck with
the same error :
Error loading package at file:[]/helloworld-ejb.jar, Error parsing
META-INF/ejb-jar.xml in [...]/helloworld-ejb.jar: Fatal error at line
377: Character conversion error: "Unconvertible UTF-8 character
beginning with 0x91" (line number may be too low).

thanks for any help...
rodolphe

this is my ejb.jar.xml :
-

?xml version="1.0"?
!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise
JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'
ejb-jar

 display-nameHelloWorld Bean jar/display-name
 descriptionA simple HelloWorld/description

 enterprise-beans
  session
   display-nameHelloWorld/display-name
   descriptionA simple HelloWorld/description
   ejb-namecom.genesys.is.helloworld.ejb.HelloWorld/ejb-name
   homecom.genesys.is.helloworld.ejb.HelloWorldHome/home
   remotecom.genesys.is.helloworld.ejb.HelloWorld/remote
   ejb-classcom.genesys.is.helloworld.ejb.HelloWorldEJB/ejb-class
   session-typeStateless/session-type
   transaction-typeContainer/transaction-type
  /session
 /enterprise-beans

 assembly-descriptor
 /assembly-descriptor

/ejb-jar
-





it's in orion.jar in the META-INF dir but it's just the official sun
version as far as I know. your errors don't indicate that it's a dtd
problem. the first looks like you use non-7bit-ascii characters and
didn't
declare the correct encoding in your xml (just a guess).

robert

At 08:00 07.11.00 , you wrote:
The reason I ask is that I think it' screwed up. When I try to run an
app
with -validateXML turned on i get:

Error loading package at
file:/C:/@web/ClassNotes/EjbJmsJndi/@StudentEjbApp/, Error parsing
META-INF
/ejb-jar.xml in C:\@web\ClassNotes\EjbJmsJndi\@StudentEjbApp: Fatal
error at
line 377: Character conversion error: "Unconvertible UTF-8 character
beginning with 0x91" (line number may be too low).

When I run it again using the xerces parser I get:

Error loading package at
file:/C:/@web/ClassNotes/EjbJmsJndi/@StudentEjbApp/, Error parsing
META-INF
/ejb-jar.xml in C:\@web\ClassNotes\EjbJmsJndi\@StudentEjbApp: Fatal
error at
line 912 offset 1: A ') ' is required in the declaration of element
type
"role-source". Warning at line 1: Valid documents must have a !DOCTYPE

declaration. Fatal error at line 1: Document root element is missing.


Dave Ford
Smart Soft - The Java Training Company
http://www.SmartSoftTraining.com







Re: JDK1.3 and deb. linux

2000-11-15 Thread Storm Linux User

I use Debian Potato 2.2 without problems. I' tried Sun JDK1.2.2, Sun JDK1.3 
and IBM JDK1.3, all of then without problems on Debian Potato. Have you 
updated you system? I'd sugest you to do:

apt-get update
apt-get upgrade

Doing this, you will get installed the latest versions of your packages, 
including glibc 2.1.

[]s
Guilherme Ceschiatti
[EMAIL PROTECTED]

On Wednesday 15 November 2000 12:09, you wrote:
 there is an incompatibility between Debian and the JDK (any JDK I tried).
 The lib is there, but is not found for some reason. I installed Helix-gnome
 and the problem went away.

  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED]]On Behalf Of Jostein
  Martinsen
  Sent: Wednesday, November 15, 2000 13:01
  To: Orion-Interest
  Subject: JDK1.3 and deb. linux
 
 
  Help !
  When i try to start orionserver i get this msg:
 
  "error in loading shared libraries: libstdc++-libc6.1-1.so.2: cannot
  open shared object file: No such file or directory"
 
  I'm running the newest version of Debian Linux and Sun:s jdk1.3
 
 
  '''
  Jostein Martinsen
  [EMAIL PROTECTED]
 
  PGP keys fingerprint. Ensure my keys validity!
  E2CF AF07 B50C 7A99 8EFB 23EA 1D0D E462 CE6B 551C
 
  ''




Re: EJB Assembler tool

2000-11-15 Thread Gerald Gutierrez


I've found that you need to add the class files to the "files" section of 
the EJB assembler before it'll find anything. Right click and do the 
"import" on the "files" section displayed on the left of the screen.



At 04:39 PM 11/15/2000 +0100, you wrote:
Did somebody successfull use the EJB Assembler tool? When adding a bean the
tool tells me that it is unable to find the bean class also if I add the
classes to my classpath.


Alexander Sparkowsky
LambdaLogic Informationssysteme GmbH, Berlin, Germany
Tel: +49-30-2936385-0, Fax: +49-30-2936385-0
E-Mail: [EMAIL PROTECTED]






EJB using core classes?

2000-11-15 Thread Kevin Duffey

Hi all,

I am attempting (again) deploying EJB. While I think I have the pricipals
down, (still trying to figure out JNDI properties..what they are for), I am
confused about one thing. I have an application named ss. In Orion I have
set the path to c:\ss. There is the META-INF dir, which I have
application.xml in..that points has module ejbss.jar/ejb /module. It
also has my web module in it that points to www (from ss..so ss/www). I
compile my ejb (a simple login ejb) which seems to be ok. In the ss.jar, I
have the META-INF dir with ejb-jar.xml in it accessing my
com.ss.ejb.login.LoginXXX classes. These are Stateless session classes. I
also have in the ejb-jar.xml file the
com/ss/ejb/login/LoginSessionEJB.class, and so on. So when I start up Orion,
it shows its deploying the EJB, however..it says it can't find class
core/login/Login.class. Now..in my package, I have ss.core, ss.ejb, and
ss.ui. ss.core.login.Login is a "bean" that I will use in both the EJB
entity class, and my UI javabean class. I don't know if this is the wrong
way to do it, but I figure..why put the same getter/setter methods twice (in
both the UI javabean class that gets/sets the JSP page form info, and the
EJB class that loads/stores the same info). I am not too familiar with EJB
just yet, but I see no reason why this wouldn't work. In my entity bean, I
would somehow reference the core.login.Login class, and use that reference
to load/store the entity. Can that even be done? Or is the only way to get
entity beans via CMP to work is directly have the methods in the entity? I
would think if my methods that are used to load/store the entity use the
reference to get/set the fields of the reference Login, this should be ok.

At any rate..my main question here is, the EJB class in the jar file is
referencing the core class. I don't have the core package in the jar file. I
thought if I deployed the jar file into the same web-app as the other
classes were in, it would have access to these classes. I compile classes to
WEB-INF/classes. Is this not the case? Is there some trickery to getting EJB
classes to see the WEB-INF/classes?

Thanks for any help.





RE: EJB Performance Question.

2000-11-15 Thread Gerald Gutierrez

At 10:11 AM 11/15/2000 +0100, you wrote:
At 14:48 14.11.00 , you wrote:

Thanks Robert.  I think I'll try running some
benchmarks this week and post the results.  I wonder..
is there a way for and EJB-EJB to be _forced_ to
go through RMI?  i.e. can I turn this optimization
off?

I don't think there is a documented way to to this.

Not to be a jerk but to provide some constructive criticism to Orion ... I 
don't think there is a documented way to do many, many things. Considering 
that it is a closed-source product, I think documentation should be one of 
the most important things to accompany the actual binaries.





RE: ClassCastException servletproblem

2000-11-15 Thread Patrik Andersson



Use 
the Java Reflections utilities. Issue myObject.getClass().getName() on the 
object that you are trying to cast to something and print it out... the variable 
you call statement... is that a JDBC statement? If it is you should not cast it 
to whatever the jdbc driver vendor has implemented it as.

regards,
Patrik 
Andersson

  -Original Message-From: Erik Sundberg 
  [mailto:[EMAIL PROTECTED]]Sent: den 14 november 2000 
  22:10To: Orion-InterestSubject: ClassCastException 
  servletproblem
  hi,
  
  Just started doing servlet programming and using 
  Orion.
  I made this servlet which compiles just fine but 
  at runtime
  the server responde with a ClassCastException and 
  I just
  can´t understand why. Here is where I get 
  the errors:
  
  cpool = 
  (ConnectionPool)context.getAttribute("cpool");
  
  org.gjt.mm.mysql.Statement state = 
  (org.gjt.mm.mysql.Statement)statement;
  
  the ConnectionPool class is placed in the same 
  package as the
  Servlet and the jdbc driver is in the /lib 
  dir.
  
  I hope this explains my problem, hope anyone can 
  help me
  I have spent alot of time trying to find out what 
  can be wrong.
  The casts is legal for sure.
  
  thanks,
  
  -erik


RE: REPOST: Multiple websites on one server not found [NEED HELP]

2000-11-15 Thread Robert Krueger

At 09:52 15.11.00 , you wrote:
Sorry about my lack of lucidity.  I would like to have 3 web sites up and 
running under one Orion server.  I want the default website (the one that 
Orion displays by default) to display when the user types http://myserver, 
I want my cs2k site to come up when the user enters http://myserver/cs2k, 
and I would like http://myserver/twsm to display my other 
site.  Currently, whichever site's application tag is defined first in 
server.xml is the one that gets mapped to http://myserver, and neither of 
the other two URL's work.

These sites consist mostly of jsp's and servlets, but I am not sure about 
any EJBs that might be present.  We have various beans littering the 
classpath, but the sites seem to be functioning properly in and of 
themselves.  I guess I'm just confused about how to set up multiple 
websites under the same Orion server, and it seems that everyone on this 
list has a different opinion of how to do that. :)

no, you have to get the terminology right, so people understand what you're 
trying to do ;-). you DON'T want to set up 3 websites in j2ee/orion 
terminology but have one website witth three web applications. your website 
is http://myserver. you got answers to set up different websites by the 
people who thought you wanted to do that because you said so and you got 
answers to set up one website with three web applications because that's 
what you described as in this email and the ones before.

web site == one address like http://myserver (which will have a default web 
application mounted at "/")
web application == twsm which you want to mount to the website 
http://myserver  under "/twsm" which results in http://myserver/twsm

hope this clears up the confusion and of course it's all your fault ;-).

best regards,

robert




(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de





Re: EJB using core classes?

2000-11-15 Thread Robert Krueger

snip/


At any rate..my main question here is, the EJB class in the jar file is
referencing the core class. I don't have the core package in the jar file. I
thought if I deployed the jar file into the same web-app as the other
classes were in, it would have access to these classes. I compile classes to
WEB-INF/classes. Is this not the case? Is there some trickery to getting EJB
classes to see the WEB-INF/classes?

no, it's impossible and not meant to be that way.

two possible cases:

- your class is not application specific but a general utility in which 
case you could put it in a library that is specified in the library path of 
global-application and therefore visible for all web an ejb modules in all 
application or you have to explicitly put it where the ejb code gets it
- it is application specific and used by both web an ejb then you have to 
put it in a separate jar which you reference in orion-application.xml (or 
the dir it's located in, look at the library element) and it will be 
visible to both ejb and web modules.

HTH

robert

Thanks for any help.


(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de





specify datasource for entity bean

2000-11-15 Thread TDSlusser

Hi,

I may have missed it in the docs but I can't figure out how to configure
the datasource a CMP entity bean uses for persistence.  I can change the
orion-ejb-jar.xml file that is auto-created when the beans are deployed but
how can I change it  _before_ deploying the bean?

Thanks,
Ted Slusser





RE: specify datasource for entity bean

2000-11-15 Thread Rick Bos

Put orion-ejb-jar.xml in this directory:

/ear/ejb/orion/orion-ejb-jar.xml


.ie

/ear/ejb/META-INF/ejb-jar.xml
/ear/ejb/orion/orion-ejb-jar.xml

Normally I deploy first, and then move the created orion-ejb-jar.xml
from application-deployments to this location.  I believe it is also
possible
to create an orion-ejb-jar.xml yourself, and Orion will add any necessary
additional tags.



 -Original Message-
 From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
 Sent: November 15, 2000 12:52 PM
 To:   Orion-Interest
 Subject:  specify datasource for entity bean
 
 Hi,
 
 I may have missed it in the docs but I can't figure out how to configure
 the datasource a CMP entity bean uses for persistence.  I can change the
 orion-ejb-jar.xml file that is auto-created when the beans are deployed
 but
 how can I change it  _before_ deploying the bean?
 
 Thanks,
 Ted Slusser
 




Turning off Auto-create Tables

2000-11-15 Thread Marc Rabil

I am trying to deploy an app that uses CMP to connect to an Interbase server
via the Interclient driver.  On deploy, Orion starts auto-creating tables
that I don't need (since the database already exists) and gives me the error
below.  How can I turn auto-create off or point it at the right DB?

java.lang.VerifyError: (class: interbase/interclient/ErrorKey, method: _$372
signature: (Ljava/lang/String;Ljava/lang/String;I)V) Expecting to find
unitialized object on stack
at
interbase.interclient.SQLException.init(SQLException.java:96)...

Thanks,

Marc





Re: specify datasource for entity bean

2000-11-15 Thread Gerald Gutierrez


Put it inside the EAR file; I believe it goes into a special "orion" 
directory. I think that directory is called "orion" and is a sibling to 
META-INF.

You can also do it on an application scope with orion-application.xml.


At 11:52 AM 11/15/2000 -0600, you wrote:
Hi,

I may have missed it in the docs but I can't figure out how to configure
the datasource a CMP entity bean uses for persistence.  I can change the
orion-ejb-jar.xml file that is auto-created when the beans are deployed but
how can I change it  _before_ deploying the bean?

Thanks,
Ted Slusser






Re: EJB using core classes?

2000-11-15 Thread Gerald Gutierrez


Uhh ... isn't this unnecessarily vendor-specific? I've had utility classes 
used by both web and ejb layers and I just stick them with the EJB JAR file 
and things seem to work out fine.

At 06:20 PM 11/15/2000 +0100, you wrote:
snip/


At any rate..my main question here is, the EJB class in the jar file is
referencing the core class. I don't have the core package in the jar file. I
thought if I deployed the jar file into the same web-app as the other
classes were in, it would have access to these classes. I compile classes to
WEB-INF/classes. Is this not the case? Is there some trickery to getting EJB
classes to see the WEB-INF/classes?

no, it's impossible and not meant to be that way.

two possible cases:

- your class is not application specific but a general utility in which 
case you could put it in a library that is specified in the library path 
of global-application and therefore visible for all web an ejb modules in 
all application or you have to explicitly put it where the ejb code gets it
- it is application specific and used by both web an ejb then you have to 
put it in a separate jar which you reference in orion-application.xml (or 
the dir it's located in, look at the library element) and it will be 
visible to both ejb and web modules.

HTH

robert

Thanks for any help.

(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de






Custom Tags Bug? Please help...

2000-11-15 Thread Claudio Cordova

Hello, I have questions about custom tags, I don't know for sure they are
bugs but they seem like it.

BUG #1

I have a custom tag with a required attribute called "class". When I use it
in a page the compiler displays an error like:

 500 Internal Server Error

Error parsing JSP page /webdev/advtags/forTag.jsp line 13

Property 'class' of bean/tag 'com.taglib.wdjsp.mut.ForPropertyTag' is read
only


The tag has a "setClass" method. Why is this happening? If I change the
attribute name to anything else it works!


BUG #2

The method "isValid" from the TagExtraInfo class is getting called as many
times as there are attributes in the tag...Each time the TagData object has
one more attribute value?  Is this correct?







Multiple threads and new InitialContext

2000-11-15 Thread KirkYarina

Is new InitialContext supposed to be thread safe?  It doesn't seem to be...

I have a client test program that creates multiple threads, each of which 
does a getInitialContext.  This fails about 2 times out of three, usually 
with a:

ObjectIdMgrTest:-- Getting Initial Context --
javax.naming.NamingException: Error reading application-client descriptor: 
Error
  looking up EJBHome: Lookup error: java.io.EOFException; nested exception is:
 java.io.EOFException
 at 
com.evermind.server.ApplicationClientInitialContextFactory.getInitial
Context(JAX)
 at 
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
68)
 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 
sbd.sd.ejb.sb.objectidmgr.ObjectIdMgrTest.getInitialContext(ObjectIdM
grTest.java:305)
 at 
sbd.sd.ejb.sb.objectidmgr.ObjectIdMgrTest.run(ObjectIdMgrTest.java:16
1)
 at java.lang.Thread.run(Thread.java:484)


occasionally it will hang instead.  This is on W98, SDK 1.3.0, Orion 1.4.4.


The test is straightforward; in pseudo code...

private InitialContext iCtx;
private final static String testName = "name of test";

main()
   loop: create new thread, start

run()
   this.getInitialContext()
   hammer away...

getInitialContext()
   this.iCtx = new InitialContext()



to get around this I modified getInitialContext to

   synchronized (testName)
 this.iCtx = new InitialContext()


This works when tried a dozen or so times.

Is this an Orion bug?  If not, how should it be handled?



Kirk Yarina
[EMAIL PROTECTED]





Re: Problems with MySQL and DataSourceUserManager

2000-11-15 Thread Louis

Hi,
If I use EJB, can I use postgresql?  I know that postgresql jdbc driver
is still not jdbc2 complaint.


Louis
- Original Message -
From: "Lars Hoss" [EMAIL PROTECTED]
To: "Orion-Interest" [EMAIL PROTECTED]
Sent: Wednesday, November 15, 2000 8:37 AM
Subject: Re: Problems with MySQL and DataSourceUserManager


 hi!

 i had the same problem with the WebLogic Server.
 the problem is that MySQL does not support transactions
 as of version 2.22.x.
 there is beta quality transaction support in the
 current development branch (2.23.x) but
 i had very serious problems with the latest version (lost data).
 personally i advice you not to use mysql until
 it is ready for production use. i would have a look
 at the 7.1 version of postgresql which is currently
 available through cvs as far as i know.

 yours,
 lars

 Am Mittwoch 15 November 2000 12:22 schrieben Sie:
  Hi
 
  Is anyone using DataSourceUserManager with MySQL database?
  We have been using it with PostgreSQL without any problems,
  but when we switched to MySQL, DataSourceUserManager throws
  an exception
 
  DataSourceUserManager.getUser
 
  8.11.2000 14:29 ANALYYTIKKO-web: Error in UserManager
  java.lang.RuntimeException: SQLException: Can't call commit when
  autocommit=true
  at com.evermind.sql.DataSourceUserManager.getUser(JAX)
  at com.evermind.server.http.EvermindHttpServletRequest.yf(JAX)
  at com.evermind.server.http.HttpApplication.vk(JAX)
  at com.evermind.server.http.HttpApplication.uh(JAX)
  at com.evermind.server.http.ed.sp(JAX)
  at com.evermind.server.http.ed.so(JAX)
  at com.evermind.util.f.run(JAX)
 
 
  Is it possible to use MySQL with DataSourceUserManager since MySQL does
not
  support transactions?
 
  Regards,
  Juha Lehtonen
  FA Solutions






RE: EJB using core classes?

2000-11-15 Thread Duffey, Kevin

Thanks. That at least clears this up. What if I EAR the whole thing and
deploy the EAR? Would the EJB then be able to see the classes..or at that
wouldn't make any difference?


 -Original Message-
 From: Robert Krueger [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, November 15, 2000 9:20 AM
 To: Orion-Interest
 Subject: Re: EJB using "core" classes?
 
 
 snip/
 
 
 At any rate..my main question here is, the EJB class in the 
 jar file is
 referencing the core class. I don't have the core package in 
 the jar file. I
 thought if I deployed the jar file into the same web-app as the other
 classes were in, it would have access to these classes. I 
 compile classes to
 WEB-INF/classes. Is this not the case? Is there some 
 trickery to getting EJB
 classes to see the WEB-INF/classes?
 
 no, it's impossible and not meant to be that way.
 
 two possible cases:
 
 - your class is not application specific but a general 
 utility in which 
 case you could put it in a library that is specified in the 
 library path of 
 global-application and therefore visible for all web an ejb 
 modules in all 
 application or you have to explicitly put it where the ejb 
 code gets it
 - it is application specific and used by both web an ejb then 
 you have to 
 put it in a separate jar which you reference in 
 orion-application.xml (or 
 the dir it's located in, look at the library element) and it will be 
 visible to both ejb and web modules.
 
 HTH
 
 robert
 
 Thanks for any help.
 
 
 (-) Robert Krüger
 (-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
 (-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
 (-) Tel: 06151 665401, Fax: 06151 665373
 (-) [EMAIL PROTECTED], www.signal7.de
 




counter.jar

2000-11-15 Thread Hani Suleiman

Would anyone be tremendously upset if I rewrote counter.jar based on info
I get from decompiling it?

I have two things in mind:

1) To make the changes needed to switch it to ejb 2.0
2) Minor optimisation in the generation of ID's (to create the
initialContext once and hold onto it, rather than creating a new one at
every invocation)





RE: Custom Tags Bug? Please help...

2000-11-15 Thread Duffey, Kevin

I would think class is a reserved word in java. For example MyClass.class
refers to the Class of the class. I would rename it from class to myClass or
something. Same for your getter/setter methods.

 -Original Message-
 From: Claudio Cordova [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, November 15, 2000 9:55 AM
 To: Orion-Interest
 Subject: Custom Tags Bug? Please help...
 
 
 Hello, I have questions about custom tags, I don't know for 
 sure they are
 bugs but they seem like it.
 
 BUG #1
 
 I have a custom tag with a required attribute called "class". 
 When I use it
 in a page the compiler displays an error like:
 
  500 Internal Server Error
 
 Error parsing JSP page /webdev/advtags/forTag.jsp line 13
 
 Property 'class' of bean/tag 
 'com.taglib.wdjsp.mut.ForPropertyTag' is read
 only
 
 
 The tag has a "setClass" method. Why is this happening? If I 
 change the
 attribute name to anything else it works!
 
 
 BUG #2
 
 The method "isValid" from the TagExtraInfo class is getting 
 called as many
 times as there are attributes in the tag...Each time the 
 TagData object has
 one more attribute value?  Is this correct?
 
 
 




Re: counter.jar

2000-11-15 Thread Jason Rimmer

You shouldn't have to decompile it, as it's supposedly open source.
Here's the message in May from Karl:
http://www.mail-archive.com/orion-interest@orionserver.com/msg01478.html.
Though I certainly would not mind the fixes you're proposing.

--
Jason Rimmer
[EMAIL PROTECTED]


- Original Message -
From: "Hani Suleiman" [EMAIL PROTECTED]
To: "Orion-Interest" [EMAIL PROTECTED]
Sent: Wednesday, November 15, 2000 4:07 PM
Subject: counter.jar


 Would anyone be tremendously upset if I rewrote counter.jar based on info
 I get from decompiling it?

 I have two things in mind:

 1) To make the changes needed to switch it to ejb 2.0
 2) Minor optimisation in the generation of ID's (to create the
 initialContext once and hold onto it, rather than creating a new one at
 every invocation)








ORION and VAJ?

2000-11-15 Thread listhub

Briefly looking at the archives I saw this question with no real resolution so
please forgive the bandwidth while I ask again.

Has anyone succeeded in running Orion from within Visual Age Java?

All comments welcome.
john
--
E-Mail: [EMAIL PROTECTED]
Date: 15-Nov-00
Time: 18:39:20

This message was sent by XFMail
--




Re: Client hits STOP button..is there a way to detect this beforesen ding a response?

2000-11-15 Thread Gary Shea

Interesting question.  My instincts say you can't win as long
as your data integrity is determined by your ability to determine
the exact status when the situation is inherently a race condition.
That may be overly pessimistic given that it takes the client
a finite amount of time to stop one transaction and start the next,
but still, I'd try a different approach.

For instance, give each request a serial number, hold each
response in the session separately, and build the serial number
into the links of the output page.  Then you know it will work,
but the overhead is minimal (you're assuming that this won't
happen often, so it's rare that you'll have multiple results
sitting in the session).

I haven't run into this problem yet, so I'm glad you pointed
it out ;)

Gary

Today, Duffey, Kevin ([EMAIL PROTECTED]) wrote:
 Hi,
 
 I have a need to find out if the connection back to the browser from a
 servlet is still good or not, before an attempt to send the response occurs.
 Is this possible? I know when I do a response.sendRedirect() or
 requestDispatcher().forward() Orion will throw an exception if the
 connection to the browser (or client for that matter) has been terminated.
 The problem is..I want to check for this before an attempt is made, so that
 incase the connection is lost, I don't populate the javabean. I'll give a
 reason why this is necessary (and very helpful). I have my code organized
 into JSP pages, ControllerServlet/Action classs, JavaBeans and Session
 classes. Session classes are STATELESS classes, so that I can get ready to
 move to EJB when I get time. Each time a request is submitted, it goes to an
 action class method to be handled. The action class instantiates a new
 session class (I am not bothering with a pooled setup for session classes at
 this point as EJB will do this for me when I move to it). The session class
 performs some logic..usually database acitivty of some sort. The action
 class is then given a result (usually a Vector of some sort of objects). The
 action class then sets a bean variable to point to the vector of results.
 The bean is stateful and is session scope (HttpSession). At the end of the
 action, the response is forwarded to a JSP page. That page then uses the
 bean and its reference to results to display them.
 
 So here is the problem. If a user submits a form (say..to search for all
 clients) and lets say that search will take two minutes. 10 seconds later,
 the client sees he/she made a mistake on what they were searching for. As if
 often the case..they hit STOP on the browser, change their mistake and
 submit the form again. On the server..there are now two threads
 running..because the first one hasn't completed yet (assuming the user
 submitted the form the 2nd time fairly quickly). The 2nd request is
 quick..it populates the javabean reference to a Vector of objects say in 20
 seconds. The response is sent back and the user sees a list of say 20 items.
 Now, while they are looking over this list, the 1st request they sent is
 still going on. At some point it too populates the SAME javabean with its
 results, which are now different than what the client is actually looking at
 on the page. The action tries to return its response but it finds its
 connection was terminated. It throws an exception (which I catch), and
 voila..the client sees nothing. Where the problem lies though..is when the
 first request populates the javabean that the 2nd request already populated.
 So when the user clicks on say item 3 of what he sees..it refers to item 3
 in the results Vector that has now been replaced with the first requests
 results. Therefore, the information is incorrect.
 
 So, what I am trying to do is find a way that if the connection is no longer
 available BEFORE the bean is populated and anything else happens, it just
 stops in its tracks. That way..if the user submitted another request, the
 first one wont repopulate the bean with information that is inaccurate to
 what the client is seeing.
 
 Thanks for any ideas and info on this topic.
 
 






Re: Client hits STOP button..is there a way to detect this before sending a response?

2000-11-15 Thread Hani Suleiman

Here's another approach.

Put a timestamp in your session to denote when a search request was
started, and have the searcher object track this timestamp too. When you
get the results back, check that the timestamps match before populating
your bean. If another search had happened in the meantime, then the
timestamps won't match, and so you can ensure that no mismatch happens.

On Wed, 15 Nov 2000, Boris Erukhimov wrote:

 
 
 "Duffey, Kevin" wrote:
 
 
  So here is the problem. If a user submits a form (say..to search for all
  clients) and lets say that search will take two minutes. 10 seconds later,
  the client sees he/she made a mistake on what they were searching for. As if
  often the case..they hit STOP on the browser, change their mistake and
  submit the form again. On the server..there are now two threads
  running..because the first one hasn't completed yet (assuming the user
  submitted the form the 2nd time fairly quickly). The 2nd request is
  quick..it populates the javabean reference to a Vector of objects say in 20
  seconds. The response is sent back and the user sees a list of say 20 items.
  Now, while they are looking over this list, the 1st request they sent is
  still going on. At some point it too populates the SAME javabean with its
  results, which are now different than what the client is actually looking at
  on the page. The action tries to return its response but it finds its
  connection was terminated. It throws an exception (which I catch), and
  voila..the client sees nothing. Where the problem lies though..is when the
  first request populates the javabean that the 2nd request already populated.
  So when the user clicks on say item 3 of what he sees..it refers to item 3
  in the results Vector that has now been replaced with the first requests
  results. Therefore, the information is incorrect.
  Thanks for any ideas and info on this topic.
 
 I guess what you need is to implement what is called a "delayed response" to
 avoid
 make user waiting about 2 min.
 
 Here is a flow:
 1. User makes search or whatever request which is handled with delayed
 response.
 Your action or session class launches a separate thread to do the actual job
 if
  let's say an "in process" flag is set to "false" or not exist in your
 HttpSession.
  If thread is launched set that flag to "true". If not (meaning thread is
 running) go to the step 2.
 
 2. Your action class responds with JSP page saying "Please wait ".
  Put in the page a simple javascript code sending another request after some
 timeout, say 8 sec.
 
 3. Your action class process incoming request and checks if flag "in process" is
 still on.
  If yes it responds with the same "Please wait..." page which will schedule
 another try in 8 sec.
  If no, it responds with your result page populated by bean, which itself
 uses result
  data passed through HttpSession from completed job thread.
 
 Note that actual job is now almost untied from browser connection. If user hits
 "Stop" and then decides to repeat search request still being within the same
 HttpSession and his previously
 launched job thread is not completed, he will receive "Please wait ..." page.
 
 Hope it helps
 ~boris
 
 
 
 
 
 





RE: Client hits STOP button..is there a way to detect this before sending a response?

2000-11-15 Thread Duffey, Kevin

Thanks for the reply..

Your idea has some merit..the only problem is, we have so many different
searches and profile updates that could be happening..I would need to keep
track of each of those separately.

Here is what I had in mind if there isn't any way to detect ahead of time
that a connection to the browser was terminted.

1) When stateless session class returns its Vector of objects, the action
class creates points a "second" pointer in the bean to the results that are
already there (unless they are null at that point). Then it assigns the main
results variable (defined as Vector results = null; in the bean) to the new
list of items. It then forwards to the page. But before it forwards, if the
connection was lost and it throws the exception, in the catch() block I
could just point the results reference back to the "second" pointer so it
doesn't lose that..in other words..because the 2nd pointer references the
old vector, the GC can't recollect it, thereby saving it..incase of a
problem. In the finally block, I would set this 2nd variable to null. It
should be safe to do it there..because the catch() block would execute
BEFORE the finally() block..incase the connection is lost..therefore it can
still assign the main results back to the 2nd variable reference before the
finally() block sets it to null.

Do you think this would work? My main worry is that of concurrency. What if
the user hits submit, stop, submit, stop, submit, stop, and so on..several
times (should never happen..most likely wont..but its still a
possibility..and I like to make sure we think about all
possibilities..especially these days where people purposely attack sites and
bring them to a halt). If that happens, there could be x number of
threads..all running at the same time. Thread 3 might finish before thread
1. Therefore, I am wondering if using only a 2nd reference variable will
really be enough, or if one thread finishes in between another thread (in
other words..the jvm switches to another running thread right in the middle
of one running), if the variables could get screwed up. I don't want to use
the Singleton model though.


 -Original Message-
 From: Hani Suleiman [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, November 15, 2000 3:49 PM
 To: Orion-Interest
 Subject: Re: Client hits STOP button..is there a way to detect this
 before sending a response?
 
 
 Here's another approach.
 
 Put a timestamp in your session to denote when a search request was
 started, and have the searcher object track this timestamp 
 too. When you
 get the results back, check that the timestamps match before 
 populating
 your bean. If another search had happened in the meantime, then the
 timestamps won't match, and so you can ensure that no 
 mismatch happens.
 
 On Wed, 15 Nov 2000, Boris Erukhimov wrote:
 
  
  
  "Duffey, Kevin" wrote:
  
  
   So here is the problem. If a user submits a form (say..to 
 search for all
   clients) and lets say that search will take two minutes. 
 10 seconds later,
   the client sees he/she made a mistake on what they were 
 searching for. As if
   often the case..they hit STOP on the browser, change 
 their mistake and
   submit the form again. On the server..there are now two threads
   running..because the first one hasn't completed yet 
 (assuming the user
   submitted the form the 2nd time fairly quickly). The 2nd 
 request is
   quick..it populates the javabean reference to a Vector of 
 objects say in 20
   seconds. The response is sent back and the user sees a 
 list of say 20 items.
   Now, while they are looking over this list, the 1st 
 request they sent is
   still going on. At some point it too populates the SAME 
 javabean with its
   results, which are now different than what the client is 
 actually looking at
   on the page. The action tries to return its response but 
 it finds its
   connection was terminated. It throws an exception (which 
 I catch), and
   voila..the client sees nothing. Where the problem lies 
 though..is when the
   first request populates the javabean that the 2nd request 
 already populated.
   So when the user clicks on say item 3 of what he sees..it 
 refers to item 3
   in the results Vector that has now been replaced with the 
 first requests
   results. Therefore, the information is incorrect.
   Thanks for any ideas and info on this topic.
  
  I guess what you need is to implement what is called a 
 "delayed response" to
  avoid
  make user waiting about 2 min.
  
  Here is a flow:
  1. User makes search or whatever request which is handled 
 with delayed
  response.
  Your action or session class launches a separate thread 
 to do the actual job
  if
   let's say an "in process" flag is set to "false" or 
 not exist in your
  HttpSession.
   If thread is launched set that flag to "true". If not 
 (meaning thread is
  running) go to the step 2.
  
  2. Your action class responds with JSP page saying "Please 
 wait ".
   Put in the 

RE: Client hits STOP button..is there a way to detect this before sending a response?

2000-11-15 Thread Hani Suleiman



On Wed, 15 Nov 2000, Duffey, Kevin wrote:

 Thanks for the reply..
 
 Your idea has some merit..the only problem is, we have so many different
 searches and profile updates that could be happening..I would need to keep
 track of each of those separately.
 
 Here is what I had in mind if there isn't any way to detect ahead of time
 that a connection to the browser was terminted.
 
snipped

I think your proposed solution seems kinda kludgy (either that, or I'm a
bit slow and don't fully understand it...) also as you said it only tracks
two references, and can be foiled by starting 2 long running searches,
aborting them, then doing a quick third one.

You don't need to keep track of each request, you just need to provide
very basic tagging of results so they can be verified against requests.

A slight variant: Instead of passing in the timestamp have the bean return
one as part of the result, which you could then sanity check to ensure
that the timestamp in the session is before the time the search bean
thinks it started. If you get a mismatch, then discard the results as
they're stale.

This does leave a race condition, where the critical section is in between
placing the timestamp in the session and the search bean creating its own
timestamp, you can minimise this by synchronising your code up to (but not
including!) calling the search bean, and creating the 'result' timestamp
first thing in the search bean method.

  
  Here's another approach.
  
  Put a timestamp in your session to denote when a search request was
  started, and have the searcher object track this timestamp 
  too. When you
  get the results back, check that the timestamps match before 
  populating
  your bean. If another search had happened in the meantime, then the
  timestamps won't match, and so you can ensure that no 
  mismatch happens.
  





RE: Custom Tags Bug? Please help...

2000-11-15 Thread Scott Stirling

It is.  It's so obvious it can easily be overlooked:

For example:

public class Foo extends Object { }

How do you get a class to compile that has a field named 'class'?  I
couldn't do it.  The normal convention is to use the field name 'clazz' when
you mean 'class' in Java.

One thing to check is that the type of this variable is the same when its
set(Type t) and get(){ return Type t;} methods are called, and that you
aren't mixing types with a 1.3 JVM.  The 1.3 JVM is stricter about some of
the JavaBean conventions.

Scott Stirling

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Duffey, Kevin
Sent: Wednesday, November 15, 2000 4:03 PM
To: Orion-Interest
Subject: RE: Custom Tags Bug? Please help...


I would think class is a reserved word in java. For example MyClass.class
refers to the Class of the class. I would rename it from class to myClass or
something. Same for your getter/setter methods.

 -Original Message-
 From: Claudio Cordova [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, November 15, 2000 9:55 AM
 To: Orion-Interest
 Subject: Custom Tags Bug? Please help...


 Hello, I have questions about custom tags, I don't know for
 sure they are
 bugs but they seem like it.

 BUG #1

 I have a custom tag with a required attribute called "class".
 When I use it
 in a page the compiler displays an error like:

  500 Internal Server Error

 Error parsing JSP page /webdev/advtags/forTag.jsp line 13

 Property 'class' of bean/tag
 'com.taglib.wdjsp.mut.ForPropertyTag' is read
 only


 The tag has a "setClass" method. Why is this happening? If I
 change the
 attribute name to anything else it works!


 BUG #2

 The method "isValid" from the TagExtraInfo class is getting
 called as many
 times as there are attributes in the tag...Each time the
 TagData object has
 one more attribute value?  Is this correct?








RE: Orion, JNDI Weblogic

2000-11-15 Thread Colin Jacobs

In case this helps anyone else desperately searching the archives one day
hence:

The jsp *works* under Tomcat (NT), Caucho Resin 1.1.5 (NT), WebLogic (NT),
and Orion 1.3.8/JDK 1.3 on linux.

The exception occurs under Orion 1.3.8 *and* Orion 1.4.0 on NT under jdk
1.2.2 *and* jdk 1.3.

Once again, I'd appreciate if anyone had any clues; I suspect possibly a
bug, possibly a classpath conflict; I had to put a lot of weblogic classes
in the classpath, and the weblogicaux.jar has a lot of com.sun.* classes in
it, such as com.sun.java.util.collections.*, etc.

Colin

-Original Message-
From: Colin Jacobs [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 15, 2000 12:18 PM
To: Orion-Interest
Subject: Orion, JNDI  Weblogic


Hi there.

We're using WebLogic on our core platform for now, alas, but I'm hoping to
go with Orion in our web farm, using it as a JSP/Servlet environment
initially, and then expanding its duties to erode on WebLogic.

I've run into a little snag in my initial test. I've got some test EJBs
deployed on weblogic, and I'm trying to use them in a simple JSP I deployed
in the orion default-web-app directory. I'm using the following JSP snippet:

%@ page contentType="text/html"
import="java.io.*,java.lang.Integer,javax.naming.*,javax.ejb.*,weblogic.comm
on.*,test.*,java.util.Hashtable" %

%
  PingHome home = null;
 
  Hashtable env = new Hashtable(5);
  env.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
  env.put(Context.PROVIDER_URL, "t3://cjacobs:7001");
  Context ctx = new InitialContext(env);
  try {
home = (PingHome) ctx.lookup("PingHome");
  } catch(Exception e) {
 // ...
  }
%

The line "home = (PingHome) ctx.lookup("PingHome");" generates the following
exception, (full stack trace below).

javax.naming.CommunicationException [Root exception is
weblogic.rjvm.PeerGoneException: 
 - with nested exception:
[java.lang.NoClassDefFoundError: weblogic/service/BasicServiceStub]]

I'm kind of mystified - the class weblogic.service.BasicServiceStub *is* in
the classpath (Class.forName() doesn't generate an error).
weblogic/service/... looks like a path, not a class. WebLogic itself has
complained "Exception on send : weblogic.rmi.ConnectException: Attempt to
sendMsg using a closed connection" several times during these tests.

I only get the exception if the lookup succeeds, i.e.
ctx.lookup("SpoddySpodSpod") throws a javax.naming.NameNotFoundException as
expected.

I tried this code in Tomcat, and it worked perfectly. Any ideas? 

Thanks,

Colin

javax.naming.CommunicationException.  Root exception is
weblogic.rjvm.PeerGoneException: 
 - with nested exception:
[java.lang.NoClassDefFoundError: weblogic/service/BasicServiceStub]
at
weblogic.rmi.extensions.AbstractRequest.sendReceive(AbstractRequest.java:76)
at
weblogic.jndi.toolkit.BasicWLContext_WLStub.lookup(BasicWLContext_WLStub.jav
a:246)
at weblogic.jndi.toolkit.WLContextStub.lookup(WLContextStub.java,
Compiled Code)
at javax.naming.InitialContext.lookup(InitialContext.java:354)
at
__jspPage1_externalTest_jsp._jspService(__jspPage1_externalTest_jsp.java:58)
at com.orionserver.http.OrionHttpJspPage.service(JAX)
at com.evermind.server.http.HttpApplication.xa(JAX)
at com.evermind.server.http.JSPServlet.service(JAX)
at com.evermind.server.http.d3.so(JAX, Compiled Code)
at com.evermind.server.http.d3.sm(JAX)
at com.evermind.server.http.ef.su(JAX, Compiled Code)
at com.evermind.server.http.ef.dn(JAX, Compiled Code)
at com.evermind.util.f.run(JAX, Compiled Code)

Here's my global-web-application.xml classpath:
orion-web-app
jsp-cache-directory="./persistence"
servlet-webdir="/servlet"
development="false"

classpath path="e:\weblogic\classes" /
classpath path="e:\weblogic\lib\weblogicaux.jar" /
...


Colin Jacobs
Senior Software Engineer
Optfor Derivatives, Inc.
http://www.opt4.com

I don't pretend to have all the answers. I don't
even pretend to know what the questions are. Hey,
where am I? -- Jack Handey





Help with OR mapping

2000-11-15 Thread Vidur Dhanda

Hello,

I need some help with OR mapping a CMP EntityBean.  I'm not even sure
how to do this in BMP.  The class is called SIDDefinitions. The primary
key is a class called SID and there is only one other field called
definitions -- it is a List of Definition.  Definition is an interface
and the application allows arbitrary implementations of that interface.
The primary key class, SID, has two members -- String name and a List
fields.  The elements of List are another class -- Field.  Field has two
String members -- name and value.  A schematic would look like:
SIDDefinitions
SID
String name
List Field
String name
String value
List Definition

How do I even begin to map this to relations?  I'm restricted to EJB
1.1.  Does anyone recognize a pattern that I can use?  Please help, I'm
totally stumped by this.

Thanks,
Vidur






Correction: Help with OR mapping

2000-11-15 Thread Vidur Dhanda

Sorry, 

I forgot to describe that tables that I think will be required.
SIDDefinitions
sidID   int primary key (database generated)
definiitons blob

SIDName
sidID   name primary key

SIDValue
sidID   int
fieldName   String
fieldValue  String
primary key (sidID, fieldName)

Thanks,
Vidur   

Hello,

I need some help with OR mapping a CMP EntityBean.  I'm not even sure
how to do this in BMP.  The class is called SIDDefinitions. The primary
key is a class called SID and there is only one other field called
definitions -- it is a List of Definition.  Definition is an interface
and the application allows arbitrary implementations of that interface.
The primary key class, SID, has two members -- String name and a List
fields.  The elements of List are another class -- Field.  Field has two
String members -- name and value.  A schematic would look like:
SIDDefinitions
SID
String name
List Field
String name
String value
List Definition

How do I even begin to map this to relations?  I'm restricted to EJB
1.1.  Does anyone recognize a pattern that I can use?  Please help, I'm
totally stumped by this.

Thanks,
Vidur




RE: Client hits STOP button..is there a way to detect this before sending a response?

2000-11-15 Thread Kevin Duffey

Hi again,

Actually..I hashed out your first idea with two other guys and it seems like
it should work. Let me see if I got this straight.

1) When the action class is called..create a timestamp.
2) Create the stateless session class.
3) Get the javabean associated with the series of pages (session scope)
4) set the timestamp in the bean.
5) set the timestamp in the session.
6) do session logic.
7) check to see if the session timestamp and bean timestamp are the same.
8) if so, set the bean reference to the session return results
9) if not, ignore everything else...most likely the connection was lost
10) return jsp page

So in code it might look something like:


{
  SomeSession ss = new SomeSession();
  SomeBean bean = getBean(); // gets the javabean used by jsp page

  Date date = new Date();
  ss.setDate(date);
  bean.setDate(date);

  ss.doLogic();
  if(checkDate( ss.getDate(), bean.getDate()) )
  {
bean.setResults( ss.listAllResults() )
  }
}


Is that good enough? You said something about a race condition. I recall
reading about this in my threading book, but I never was quite clear on it.
My assumption is that it would be possible for two thread/requests to
interrupt one another, thus in the middle of one thread checking the date,
another one could be altering it, or something like that.

Here is why I don't think this would ever happen. First, because each bean
is tied to an HttpSession, on a per-client basis, it would be almost
impossible for a client to submit to the same method in the same action
class at the same time..much less at least seconds apart. It is possible
that the two sessions do different amounts of work..such as one searching
for everything, and one searching for a few items..with both ending up
finishing at the same time. In this case..what to do?

There is one other thing to think about though. By actually fixing this
problem, we introduce another one. By allowing a user to hit STOP on the
browser and submit the form again, each request (at least in our case) will
pull a connection from the connection pool. If you have one user that
submits, stops, submits, stops, etc..and possibly several sessions (not
http..but logic session classes) running on the server for just a single
user..its very possible we will run out of connections in the connectin pool
(our own home brewn class right now). We did add some code that will open
new connections, but until we move to EJB and have the container manage all
of this, it can get quite bad if too many requests from one user keep going.
Ofcourse, at some point the session/logic class thread will be done and the
connection will get returned.

However, my thinking is..a J2EE web app is like an application. The user
shouldn't be prevented from stopping a form right after its submitted..maybe
they see something they forgot, or some wrong info. If it was a desktop
application..they could stop it, change, and restart the transaction (unless
its using RMI or CORBA or something to talk to a logic tier of servers). So,
I think as a web-application, they should be able to do this too. If this
means we should have 1000 connections in the pool (hopefully not), then so
be it..but the end user should never be burdened because we simply only
allow them to do one transaction at a time. We did however allow them to do
one transactio per module on our site..meaning, if they were to send a fax,
and check for an invoice, each one is a separate module..so they could get
away with doing each one of those at the same time.

Anyways..I look forward to what you have to say about my understanding of
what you said in the first email reply, and see if I am on target with
implementing this.

Thanks again.





 On Wed, 15 Nov 2000, Duffey, Kevin wrote:

  Thanks for the reply..
 
  Your idea has some merit..the only problem is, we have so many different
  searches and profile updates that could be happening..I would
 need to keep
  track of each of those separately.
 
  Here is what I had in mind if there isn't any way to detect
 ahead of time
  that a connection to the browser was terminted.
 
 snipped

 I think your proposed solution seems kinda kludgy (either that, or I'm a
 bit slow and don't fully understand it...) also as you said it only tracks
 two references, and can be foiled by starting 2 long running searches,
 aborting them, then doing a quick third one.

 You don't need to keep track of each request, you just need to provide
 very basic tagging of results so they can be verified against requests.

 A slight variant: Instead of passing in the timestamp have the bean return
 one as part of the result, which you could then sanity check to ensure
 that the timestamp in the session is before the time the search bean
 thinks it started. If you get a mismatch, then discard the results as
 they're stale.

 This does leave a race condition, where the critical section is in between
 placing the timestamp in the session and the search bean creating its own
 

RE: Client hits STOP button..is there a way to detect this before sending a response?

2000-11-15 Thread Kevin Duffey

Thats a good approach to take for things like a "list" of items, such as a
search engine or a list of rows from a table. But what about when your
building up a single transaction, and you need to keep the state of several
pages across requests? While there is even less of a chance of what I am
asking about happening in that case..it could happen.

My worse fear is someone doing a DOS (Denial Of Service) on our
site..imagine 1000 virtual users, and possibly each having the same cookie
passed in so the server sees it as a single session.

You would think though..since when trying to return a response the
application server can throw an exception..there would be some way of
checking if the connection still exists before sending the response back.
That would solve this problem. :)

I did think about using request scope..I just wasn't sure how I could
maintain the other pages info across requests without sending large amounts
of data as part of the query string..and I don't want to use hidden form
fields.


 Quick answer - i dont know how to do an 'early detection' of the user
 pressing the stop button. I dont think its possibly - at least I
 dont think
 there is a non-super-difficult way of doing it.

 I think you may need to do more than just put your results bean in the
 session when providing a means to return results to the user.

 For example, what happens if both requests occur successfully

 ie the user
 has 2 browser windows open and does 2 successful searches). Seems
 as though
 whatever search finished first will have its results bean overwritten.

 In our project we almost exclusively use the request scope to put
 our beans
 in. When the user clicks the 'get me more button' we pass extra parameters
 that tell the server to get the next X rows.

 eg
 user clicks 'find' - get me the first X rows where 
 user clicks 'more' - get me the first X rows where primary key is  the
 primary key of the last row returned in the previous search.

 Basically then each search is independent of the last and you dont have to
 worry about cleaning up session beans, overwriting session beans etc.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of Duffey, Kevin
 Sent: Thursday, 16 November 2000 8:42 AM
 To: Orion-Interest
 Subject: Client hits STOP button..is there a way to detect this before
 sending a response?


 Hi,

 I have a need to find out if the connection back to the browser from a
 servlet is still good or not, before an attempt to send the
 response occurs.
 Is this possible? I know when I do a response.sendRedirect() or
 requestDispatcher().forward() Orion will throw an exception if the
 connection to the browser (or client for that matter) has been terminated.
 The problem is..I want to check for this before an attempt is
 made, so that
 incase the connection is lost, I don't populate the javabean. I'll give a
 reason why this is necessary (and very helpful). I have my code organized
 into JSP pages, ControllerServlet/Action classs, JavaBeans and Session
 classes. Session classes are STATELESS classes, so that I can get ready to
 move to EJB when I get time. Each time a request is submitted, it
 goes to an
 action class method to be handled. The action class instantiates a new
 session class (I am not bothering with a pooled setup for session
 classes at
 this point as EJB will do this for me when I move to it). The
 session class
 performs some logic..usually database acitivty of some sort. The action
 class is then given a result (usually a Vector of some sort of
 objects). The
 action class then sets a bean variable to point to the vector of results.
 The bean is stateful and is session scope (HttpSession). At the end of the
 action, the response is forwarded to a JSP page. That page then uses the
 bean and its reference to results to display them.

 So here is the problem. If a user submits a form (say..to search for all
 clients) and lets say that search will take two minutes. 10 seconds later,
 the client sees he/she made a mistake on what they were searching
 for. As if
 often the case..they hit STOP on the browser, change their mistake and
 submit the form again. On the server..there are now two threads
 running..because the first one hasn't completed yet (assuming the user
 submitted the form the 2nd time fairly quickly). The 2nd request is
 quick..it populates the javabean reference to a Vector of objects
 say in 20
 seconds. The response is sent back and the user sees a list of
 say 20 items.
 Now, while they are looking over this list, the 1st request they sent is
 still going on. At some point it too populates the SAME javabean with its
 results, which are now different than what the client is actually
 looking at
 on the page. The action tries to return its response but it finds its
 connection was terminated. It throws an exception (which I catch), and
 voila..the client sees nothing. Where the problem lies though..is when the
 first request 

RE: Client hits STOP button..is there a way to detect this before sending a response?

2000-11-15 Thread Hani Suleiman


On Wed, 15 Nov 2000, Kevin Duffey wrote:

 So in code it might look something like:
 
 
 {
   SomeSession ss = new SomeSession();
   SomeBean bean = getBean(); // gets the javabean used by jsp page
 
   Date date = new Date();
   ss.setDate(date);
   bean.setDate(date);
 
   ss.doLogic();
   if(checkDate( ss.getDate(), bean.getDate()) )
   {
 bean.setResults( ss.listAllResults() )
   }
 }
 
 
 Is that good enough? 

Yep, except I'd say use new Long(System.currentTimeMillis()) instead of
new Date(). You don't need any date functionality, and Date objects are
notoriously heavy to create. Longs are more efficient in every way
compared to Dates.

 You said something about a race condition. I recall
 reading about this in my threading book, but I never was quite clear on it.
 My assumption is that it would be possible for two thread/requests to
 interrupt one another, thus in the middle of one thread checking the date,
 another one could be altering it, or something like that.
 
Imagine this scenario:

Client request comes in on thread A
Servlet gets session (in thread A)
Servlet creates timestamp (thread A)
User hits stop, then does another query (assume it takes 0 time)
Client refresh request comes in on thread B
Servlet get session (in thread B)
Servlet creates timestamp, puts it in session (thread B)
Servlet puts timestamp in session (thread A)

Because of the way threading works, you're not guaranteed that they
execute in any given order. In the scenario above, if you don't
synchronise, the 'later' value might get clobbered with an incorrect
earlier one. Granted, this is VERY unlikely, and will probably happen one
in a million times, but the potential exists nevertheless.

Regarding your connection issues, I'd say look into your transactions! Two
minutes is an awfully long time. Also you should be closing them after
every transaction anyways. It doesn't really matter if the final
presentation layer gets to the client or not, when the transaction is
complete, the connection gets closed (in a finally block).

Hani






RE: Client hits STOP button..is there a way to detect this before sending a response?

2000-11-15 Thread Matt Krevs

How about you have one hidden form field which is a unique key that
identifies the bean that should be used

Basically a user's session would have some sort of hashtable in it
containing a number of beans keyed by your hidden form field?

Then you dont have to send heaps of data around when doing multipage
transactions - just your 'transaction key' in the hidden form field.

I guess these beans in the hastable would somehow get garbage collected
after some interval.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Kevin Duffey
Sent: Thursday, 16 November 2000 3:01 PM
To: Orion-Interest
Subject: RE: Client hits STOP button..is there a way to detect this
before sending a response?


Thats a good approach to take for things like a "list" of items, such as a
search engine or a list of rows from a table. But what about when your
building up a single transaction, and you need to keep the state of several
pages across requests? While there is even less of a chance of what I am
asking about happening in that case..it could happen.

My worse fear is someone doing a DOS (Denial Of Service) on our
site..imagine 1000 virtual users, and possibly each having the same cookie
passed in so the server sees it as a single session.

You would think though..since when trying to return a response the
application server can throw an exception..there would be some way of
checking if the connection still exists before sending the response back.
That would solve this problem. :)

I did think about using request scope..I just wasn't sure how I could
maintain the other pages info across requests without sending large amounts
of data as part of the query string..and I don't want to use hidden form
fields.


 Quick answer - i dont know how to do an 'early detection' of the user
 pressing the stop button. I dont think its possibly - at least I
 dont think
 there is a non-super-difficult way of doing it.

 I think you may need to do more than just put your results bean in the
 session when providing a means to return results to the user.

 For example, what happens if both requests occur successfully

 ie the user
 has 2 browser windows open and does 2 successful searches). Seems
 as though
 whatever search finished first will have its results bean overwritten.

 In our project we almost exclusively use the request scope to put
 our beans
 in. When the user clicks the 'get me more button' we pass extra parameters
 that tell the server to get the next X rows.

 eg
 user clicks 'find' - get me the first X rows where 
 user clicks 'more' - get me the first X rows where primary key is  the
 primary key of the last row returned in the previous search.

 Basically then each search is independent of the last and you dont have to
 worry about cleaning up session beans, overwriting session beans etc.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of Duffey, Kevin
 Sent: Thursday, 16 November 2000 8:42 AM
 To: Orion-Interest
 Subject: Client hits STOP button..is there a way to detect this before
 sending a response?


 Hi,

 I have a need to find out if the connection back to the browser from a
 servlet is still good or not, before an attempt to send the
 response occurs.
 Is this possible? I know when I do a response.sendRedirect() or
 requestDispatcher().forward() Orion will throw an exception if the
 connection to the browser (or client for that matter) has been terminated.
 The problem is..I want to check for this before an attempt is
 made, so that
 incase the connection is lost, I don't populate the javabean. I'll give a
 reason why this is necessary (and very helpful). I have my code organized
 into JSP pages, ControllerServlet/Action classs, JavaBeans and Session
 classes. Session classes are STATELESS classes, so that I can get ready to
 move to EJB when I get time. Each time a request is submitted, it
 goes to an
 action class method to be handled. The action class instantiates a new
 session class (I am not bothering with a pooled setup for session
 classes at
 this point as EJB will do this for me when I move to it). The
 session class
 performs some logic..usually database acitivty of some sort. The action
 class is then given a result (usually a Vector of some sort of
 objects). The
 action class then sets a bean variable to point to the vector of results.
 The bean is stateful and is session scope (HttpSession). At the end of the
 action, the response is forwarded to a JSP page. That page then uses the
 bean and its reference to results to display them.

 So here is the problem. If a user submits a form (say..to search for all
 clients) and lets say that search will take two minutes. 10 seconds later,
 the client sees he/she made a mistake on what they were searching
 for. As if
 often the case..they hit STOP on the browser, change their mistake and
 submit the form again. On the server..there are now two threads
 running..because the first 

Re: ClassCastException servletproblem

2000-11-15 Thread Erik Sundberg





  - Original Message - 
  From: 
  Patrik Andersson 
  To: Orion-Interest 
  Sent: Wednesday, November 15, 2000 4:54 
  PM
  Subject: RE: ClassCastException 
  servletproblem
  
  Use 
  the Java Reflections utilities. Issue myObject.getClass().getName() on the 
  object that you are trying to cast to something and print it out... the 
  variable you call statement... is that a JDBC statement? If it is you should 
  not cast it to whatever the jdbc driver vendor has implemented it 
  as.
  
  I must cast it to be able to access driver 
  specific function
  org.gjt.mm.mysql.Statement state = 
  (org.gjt.mm.mysql.Statement)statement;long id = 
  state.getLastInsertID(); ( to get the latest autoincrement id)
  
  -erik