[JBoss-user] Declaring finders: problem and work-around

2002-04-16 Thread Richard Kasperowski

This page tells us how to declare custom finders:

  <http://www.jboss.org/online-manual/HTML/ch06s07.html>

The examples use the > and < operators, e.g.:

  studentCount > {0} AND teacherName = {1}

I tried something similar in my custom finder, using <= and >=, e.g.:

  rideDate <= {0} and rideDate >= {1}

If you try this in your "jaws.xml", you'll see an error message like 
this when you deploy your application:

[WARN,XmlFileLoader] msg=The content beginning "<=" is not legal markup. 
Perhaps the "=" (d;) character should be a letter., col=-1, line=56
org.xml.sax.SAXParseException: The content beginning "<=" is not legal 
markup. Perhaps the "=" (d;) character should be a letter.

The work-around: Escape the < and > with < and >, e.g.:

   rideDate <= {0} and rideDate >= {1}

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] classpath confusion

2002-01-04 Thread Richard Kasperowski

Guy Rouillier wrote:

> Don't put anything in classpath.  It's tempting, and it can make 
> development easier, and you can probably get along fine for awhile.  But 
> sooner or later, you'll get bizarre problems.  The most common is that 
> updates to your EJBs don't take (i.e, they appear to deploy properly, 
> but when you invoke methods on a new version, the old version is run.)  
> For 2.4.x, set JBOSS_CLASSPATH as required.  For 3.0, which I haven't 
> used much, there are additional mechanisms for specifying required 
> runtime jars.

What's the best way to deploy a SOAP service through JBoss+TomCat 
without messing with JBoss's classpath?  The SOAP documentation tells me 
that I must put my service's classes in my servlet container's classpath.

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Design Question...

2001-07-31 Thread Richard Kasperowski

Tim Yates wrote:

> Yeah, the reason we do it this way (and not via HTTP sessions or cookies),
> is that it was decided early on that it should be possible to style the site
> differently dependant on the device that was accessing it, and we couldn't
> guarantee that storing the HTTPSession, or using cookies would work on any
> of the four major browsing devices...


If you're worried about clients that don't use cookies, you could set 
your JSP/servlet container to use URL rewriting instead of cookies to 
identify the session.  Then your container could automatically reap 
expired sessions for you.

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Custom Finders

2001-07-25 Thread Richard Kasperowski

Devraj Mukherjee wrote:

> Can anyone please send me a copy of their jaws.xml where they have made 
> use of Custom Finders?




   true

   
 true
 true
 true
   

   

 
   UniqueIdsBean
   unique_ids
 

 
   BicycleBean
   bicycle
   
 name
 name
   
   
 findAll
 
 name
   
 

 
   RideBean
   ride
   
 findAll
 
 dateYear, dateMonth, dateDay
   
 

   




-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] tomcat site traffic logging

2001-06-29 Thread Richard Kasperowski

Richard Bottoms wrote:

> Any one set up Apache like logging for tomecat? If JBoss-tomcat is going to
> see significant us as part of a site content delivery engine we'll need to
> be able to capture the same log info Apache does. Both for troubleshooting
> purposes and to monitor site traffic.


This is one of the reasons to run TomCat through Apache.

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Strange Behavior When DataSource goes down.

2001-06-28 Thread Richard Kasperowski

David Jencks wrote:

> Hi,
> I find it hard to understand what you want.
> 
> jboss does try out connections from configured datasources on startup, and
> hangs if they can't connect.
> 
> I don't see how this is a severe problem: if your datasource isn't working,
> neither will your app.


When a datasource becomes unavailable after startup, it might be 
desirable for the application to tell the user, "sorry, the database is 
unavailable."?   A user might find that more satisfactory than being 
denied service.

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] CMP findAll: how to specify order of returned ob jects?

2001-06-27 Thread Richard Kasperowski

Nordahl, David C wrote:

> You can put an order field in the jaws entry
> 
> 
>  
>   SteveBean
>   true 
>   STEVE
>   
>   findByAll
>last_name ASC   
>   
> 


danch (Dan Christopherson) wrote:
 > You should be able to do that as a 'defined finder' with an empty query
 > parameter - see the JAWS section of the online manual.


Worked like a charm.

Thanks,

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Key generation by random numbers

2001-06-26 Thread Richard Kasperowski

[EMAIL PROTECTED] wrote:

> On Tue, Jun 26, 2001 at 11:06:42AM -0400, Richard Kasperowski wrote:
> 
>>[EMAIL PROTECTED] wrote:
>>
>>
>>>As a follow-up to the debate on how to get auto-increment primary
>>>keys:
>>>
>>>Is it feasible to use a random number generator to generate primary
>>>keys? I don't really need my records to have steadily increasing keys
>>>and my number of records will presumably be much smaller than the size
>>>of my value space (4 billion? depending on data type for prim-key). So
>>>if I do something along the following when making a new record;
>>>
>>>boolean created = false;
>>>do 
>>>{
>>>   Long key = generateRandomLong();
>>>   created = ejb.create(key, contents);
>>>} 
>>>while (!created);
>>>
>>
>>One problem with using random numbers is that they're not guaranteed to 
>>be unique--two calls to generateRandomLong() can return the same value. 
>>
> 
> Yes, but that isn't really a problem because you'll just try again and
> it happens sufficiently rarely that the extra time used is
> insignificant. At least, that would be the theory.


But what if it's not sufficiently rare?  In the worst case, it will take 
O(n) time to find the next usable random number.  You might as well just 
use a serial number; it will always take O(1) time to find the next 
usable serial number.

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Key generation by random numbers

2001-06-26 Thread Richard Kasperowski

[EMAIL PROTECTED] wrote:

> As a follow-up to the debate on how to get auto-increment primary
> keys:
> 
> Is it feasible to use a random number generator to generate primary
> keys? I don't really need my records to have steadily increasing keys
> and my number of records will presumably be much smaller than the size
> of my value space (4 billion? depending on data type for prim-key). So
> if I do something along the following when making a new record;
> 
> boolean created = false;
> do 
> {
>Long key = generateRandomLong();
>created = ejb.create(key, contents);
> } 
> while (!created);


One problem with using random numbers is that they're not guaranteed to 
be unique--two calls to generateRandomLong() can return the same value. 
  Another problem is that computing the next random number might be 
relatively computationally expensive.  I'd say serial numbers are better.

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] CMP example of primitive key using int

2001-06-25 Thread Richard Kasperowski

Hiep Luong wrote:

> I've been trying to get the cabinbean example in the RMH
> Enterprise JavaBeans book to work.  This example has a primary key that is
> primitive int.  The way they code it is by creating a cabinPK class which
> goes into the prim-key-class element in the deployment descriptor with a
> corresponding primkey-field element.  It compiled but when I ran this, the
> table gets created but no primary key constraint is created in oracle but no
> exceptions either.  Beans are created just fine and I see data in the table
> BUT when I try to retrieve  the bean by using findbyprimarykey method I get
> "No such entry!" exception always.  Has anyone successful got this to work?


'int' is a primitive.  A primary key must be a Serializable.  You cannot 
use 'int' as a primary key.  Try using 'Integer' instead, and see p. 157 
of Monson-Haefel's _Enterprise JavaBeans_ for an example.

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] CMP findAll: how to specify order of returned objects?

2001-06-21 Thread Richard Kasperowski

I have CMP bean with a findAll operation that returns a Collection of 
objects.  The order of the objects in the collection seems to be 
arbitrary: sometimes the sequence is A B C, other times the sequence is 
B A C, and other times objects are returned in a different sequence.

As far as I can tell, JBoss doesn't support EJB QL.  How, then, can I 
specify the order of the objects in the returned Collection?

Thanks,

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] CMP field type

2001-06-21 Thread Richard Kasperowski

Boris Garbuzov wrote:

> Please tell me if I am any limited with persistent field types for CMP. Can I 
>specify any
> complex class of mine, and container will do it for me? Now I do not care about 
>efficiency. I
> think, container can do it by serializing my class or braking it down recursively.


Yes, you can store any object type persistently.  The file 
"standardjaws.xml" defines the mapping from Java types to database 
column types.

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] hello.ear example: Servlet works OK, but not JSP

2001-06-20 Thread Richard Kasperowski

danch (Dan Christopherson) wrote:

> What is the context root set to in the web.xml for the web app?
> 
> You should be able to hit JSPs via 'http://localhost:8080//foo.jsp


Context root in web.xml?  Do you mean in application.xml?

Ah, there's the clue we needed.  In application.xml for the hello 
example, context-root is "/".  So *these* URL work:

  http://localhost:8080/
  http://localhost:8080/index.jsp

Thanks for the clue,

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] hello.ear example: Servlet works OK, but not JSP

2001-06-20 Thread Richard Kasperowski

Gabriel Mihalache wrote:

>>Using a .ear file as in Allen's example, how do I get JBoss+TomCat to 
>>handle things that aren't servlets?
>>
> 
> Do you have the /lib/tools.jar from your JDK in you classpath?
> You need it to compile JSPs!


Yeah, that would emit a different error message.  The Java compiler is 
there and works fine: I can use the TomCat JSP examples with no problem.

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] hello.ear example: Servlet works OK, but not JSP

2001-06-20 Thread Richard Kasperowski

Allen Fogleson's hello example from June 16 is a nice tutorial and works 
well enough.

I'm having a problem with it, though.  This URL works fine:

  http://localhost:8080/hello

It maps directly to the servlet.

These URLs don't work:

  http://localhost:8080/hello/
  http://localhost:8080/hello/index.jsp

They result in "Not Found 404".

Using a .ear file as in Allen's example, how do I get JBoss+TomCat to 
handle things that aren't servlets?

Thanks,

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Proxy server issues - any ideas?

2001-06-19 Thread Richard Kasperowski

[EMAIL PROTECTED] wrote:

> 
> Well, that obviously wasn't happening at a recent trade show - on 
> location, our
> application was behaving strangely (taking 15-20 times longer to 
> execute, sharing
> session data...).  So, SOMETHING was going on - since we aren't doing 
> URL rewriting
> ourselves, the client-side cookies were getting set to the same cookie! 
>  We attribute
> that to going through a proxy server on site.  Maybe the proxy server 
> wasn't set up
> properly or something, I don't know.


My experience is actually with Resin.  I've run multiple clients on a 
single machine, each with its own session, no problem.  I've done it 
both with cookies and with URL rewriting.  (We switched to URL rewriting 
because of FUD about cookies being evil.)

Is TomCat's (or whatever you're using) session identification stuff broken?

If so, it's not that hard to add your own session IDs.  Gee, that would 
stink, though.

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] optimal JVM setting for running jBoss on Solaris

2001-06-19 Thread Richard Kasperowski

Ernest Chen wrote:

> This might not be a jBoss question.
> 
>  
> 
> I'm interested to perform some load testing for an upcoming 
> personalization project using jBoss.  What we have is a Sun Enterprise 
> 4500 machine with 6 CPU and 4 GB memory, our database is running 
> Oracle on another SUN 4500 with equivalent configuration.
> 
>  
> 
> My questions is, how do I configure jboss and JVM to maximize CPU 
> utilization and Memory utilization?


One thing to do is to start the JVM with a large heap.  If the heap 
doesn't have to grow, you won't have heap-growing time delays.  With 
Sun's JVM, the command line option is "-Xms".

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Proxy server issues - any ideas?

2001-06-19 Thread Richard Kasperowski

[EMAIL PROTECTED] wrote:

> 
> This is a question to those who are bit more experienced in
> dealing with proxy servers and issues with them.
> 
> Namely, how to handle session management through a proxy
> where everyone ends up sharing the same session (because
> the app server sees the same ip for every request)??
> 
> There's the obvious - passing a session id around and having
> to manage things ourselves.  But, I'm wondering if there aren't
> other solutions to this that don't involve so much work on our end.


Sessions are identified by a client-side cookie or URL rewriting.  Each 
client gets its own session, regardless of IP address.

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] How to specify relationships between CMP EJBs?

2001-06-18 Thread Richard Kasperowski

I'm trying to understand how container managed persistence make this 
happen.  I have two EJBs like so:

-
public interface Foo extends EJBObject {
 Long getId() throws RemoteException;
 void setId(Long param) throws RemoteException;
 String getName() throws RemoteException;
 void setName(String param) throws RemoteException;
 Bar getBar() throws RemoteException;
 void setBar(Bar param) throws RemoteException;
}

public interface Bar extends EJBObject {
 Long getId() throws RemoteException;
 void setId(Long param) throws RemoteException;
 String getName() throws RemoteException;
 void setName(String param) throws RemoteException;
}
-

The idea here is that a Foo has a Bar.  The Bar must already exist.

I want this to work through CMP.  I can't quite figure out how to tell 
JBoss that there's a relationship between Foo and Bar.  I've been 
playing around with the tags "relationships" and "cmr-field", but I 
haven't been able to get it right.

Does anyone have an example that I could follow?

Thanks,

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Want to see the SQL DDL generated by JBoss

2001-06-18 Thread Richard Kasperowski

Thanks, that's what I wanted.

Others should note that the SQL stuff is logged in "server.log", and 
doesn't show up in stdout.

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/



danch (Dan Christopherson) wrote:

> You should be able to see this if you put 'true' in 
> jaws.xml or standardjaws.xml. This will come out at DEBUG level, though, 
> so make sure that you have one of your logs (log4j.properties in recent 
> versions, the logger MBean setups in jboss.conf in older) set to output 
> DEBUG level and above.
> 
> Richard Kasperowski wrote:
> 
>> When JBoss creates a table for my CMP EJB, I want to see the DDL code 
>> Jboss creates.  Is there a switch I can flip somewhere to make the DDL 
>> code visible?



___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] The method return values in the home interface must be of valid types for RMI/IIOP.

2001-06-15 Thread Richard Kasperowski

Emerson wrote:

> Your Remote interface canĀ“t extend anything but javax.ejb.EJBObject.


My remote interface extends only EJBObject.  That's not the problem.


Alexander B Kogan wrote:
 > Remove EJBException from "throws".

I just removed it from the home interface methods that JBoss was 
complaining about.


Nordahl, David C wrote:
 > I ran into this a little bit ago.. There is a good thread on it in the
 > archive where someone listed all the possible reasons it can occur..  Try
 > taking out the EJBException from the stuff that gives an error.  If 
you're
 > using TogetherSoft, it throws those in and the verifier gives that 
cryptic
 > error.

The jboss.org web site isn't working right now.  I'll check the archive 
later.  (This new user didn't know there was a list archive.  Thanks for 
the tip.)

I am indeed using Together Control Center, and it did put those 
exceptions in my code.  I removed them.  I'll log a complained with 
TogetherSoft.


And then another user with same problem, Phan Anh Tran, wrote:
 > Found the problem...In my remote interface, I used a number of data types
 > which were not RMI-IIOP compliant.

That was it.  My EJB code generator made my business methods (currently 
just setters and getters) throw  EJBException.  I removed those bogus 
exceptions and now all is well.


Thanks, everyone, for pulling me along.

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] jboss.org web site broken?

2001-06-15 Thread Richard Kasperowski

It looks like it's not serving JSP.  Who can fix it?

Thanks,

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Auto-increment CMP primary key?

2001-06-15 Thread Richard Kasperowski

Nordahl, David C wrote:

> You'd need to create a PrimaryKeyBean


> like mentioned in earlier posts today

   ^

Duh!  Sorry for the noise!

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] Auto-increment CMP primary key?

2001-06-14 Thread Richard Kasperowski

Another newbie question:

Using a totally out-of-the-box JBoss+TomCat, I built a container managed 
EJB.  The EJB's primary key is a Long; the idea is that a simple serial 
number is sufficient.  In my bean's ejbCreate(), is there a recommended 
way to automatically generate the next Long?

Thanks,

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] The method return values in the home interface must be of valid types for RMI/IIOP.

2001-06-13 Thread Richard Kasperowski

I'm a new JBoss user trying to debug my code with respect to this 
warning message at deploy time.  I've tried making the remote interface, 
Bicycle, extend Serializable, but the warning doesn't go away.  What am 
I doing wrong?

-
[Verifier]
Bean   : BicycleBean
Method : public abstract Bicycle create() throws CreateException, 
EJBException, RemoteException, SQLException
Section: 9.2.8
Warning: The method return values in the home interface must be of valid 
types for RMI/IIOP.

[Verifier]
Bean   : BicycleBean
Method : public abstract Bicycle findByPrimaryKey(Integer) throws 
FinderException, RemoteException, EJBException
Section: 9.2.8
Warning: The method return values in the home interface must be of valid 
types for RMI/IIOP.
-

Thanks,

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user