[JBoss-user] Entity Bean Performance Tuning Help

2002-10-18 Thread Luttrell, Peter



I have something that is taking 
longer then I would like and am trying to tune jboss to reduce the time it 
takes.
 
My test scenario is as 
such:
 
JBoss3.0.3 on 
jdk1.4.1_01
1 2.0 CMP Enity bean with about 
10 fields and 3 relationships.
I'm using commit-option A so 
all beans should be cached (see cache policy below) once 
loaded.
The first time that I run 
this it obviously takes longer (filling the cache), however subsequent 
times aren't as fast as i would like; see below:
 
I have a method, which does 
this:
 
    1) begin 
manual transaction with jta
 
    2) calls 
findBySomeCriteria() which returns some 750 ejbs
    ->takes 200-300ms 
(good)
 
    3) then 
iterate through each, calling one of the methods
    i do this to fill the 
readahead cache for all the beans in an attempt to isolate the performance 
problem
    ->takes 80-100ms 
(good)
 
    4) then 
iterate through each, and constructing a dataobject that I use for display 
purposes
    ->takes 2000-2500ms (this 
seams way too long)

    5) commit 
the transaction, blablabla..
 
The problem is step 4 seams to 
be taking longer then it should.
 
I then added some trace to the 
dataobject constructor method, where I basically pass in a reference to the ejb 
and call most of the methods on it. The trace dumps out the total time the 
constructor took. I noticed a weird pattern. Most of the constructions took 0ms, 
but every 5th or so it took 15-16ms, which is where all of my time is 
going. Note that it is not exactly every 5th and tends to vary a bit. Here's a 
sample of the output:
 
18:46:06,840 INFO  
[STDOUT] displayBean construction took 0 ms18:46:06,840 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,840 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,840 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,855 INFO  [STDOUT] 
displayBean construction took 15 ms18:46:06,855 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,855 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,855 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,855 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,871 INFO  [STDOUT] 
displayBean construction took 16 ms18:46:06,871 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,871 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,871 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,871 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,886 INFO  [STDOUT] 
displayBean construction took 15 ms18:46:06,886 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,886 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,886 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,886 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,902 INFO  [STDOUT] 
displayBean construction took 16 ms18:46:06,902 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,902 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,902 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,902 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,918 INFO  [STDOUT] 
displayBean construction took 16 ms18:46:06,918 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,918 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,918 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,918 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,933 INFO  [STDOUT] 
displayBean construction took 15 ms18:46:06,933 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,933 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,933 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,949 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,949 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,965 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,965 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,965 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,965 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,965 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,980 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,980 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,980 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,980 INFO  [STDOUT] 
displayBean construction took 0 ms18:46:06,996 INFO  [STDOUT] 
displayBean construction took 16 ms
 
my ejb-jar.xml 
file:
 
I have not declared any 
security-constraints for the bean.
I have tried it with 
transactions on and off 
(Required/Supports), which effected performance a little but did not correct the 
delays i'm seeing.
 
my 
jboss.xml
 
I have the bean tied to a 
custom container config. Here's the custom config, which i basically copied 
directly from the standardjboss.xml file. Note the changes to the cache capacity 
and age, etc. This is intended to keep the beans in the 
cache.
 
    
   LongLasting 
Large CMP 2.x EntityBean 
Ca

Re: [JBoss-user] Rading a file from Ejb

2002-10-18 Thread Rodrigo Chandía
Ok, It is working.

I tried once again and It loaded the file. (?!)

Anyway, Is this a good way (a portable way, that is) to load a file from 
inside an EJB?

Regards,

Rodrigo Chandia

El Viernes 18 de Octubre del 2002 06:00 PM, Rodrigo Chandía escribió:
> Deare Jboss-users:
>
> In my app I need to read a file from inside a Session Bean. Initially I
> thought the best way would be to simpli stick the file into:
>
> $JBOSS_HOME/server/default/conf
>
> and then use
>
> InputStream is = getClass().getClassLoader()
> .getResourceAsStream(FILE_LICENSE_NAME);
>
> but it does not seem to work because I keep getting null (I guess I am not
> getting the same class loader log4j gets :P )
>
> So my question is, is it possible to do it this way?
> What is the recommended (portalbe) way to do this from an EJB?
>
> Regards,
>
> Rodrigo Chandia
>
>
>
> ---
> This sf.net email is sponsored by:
> Access Your PC Securely with GoToMyPC. Try Free Now
> https://www.gotomypc.com/s/OSND/DD
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user



---
This sf.net email is sponsored by:
Access Your PC Securely with GoToMyPC. Try Free Now
https://www.gotomypc.com/s/OSND/DD
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] org.firebirdsql.gds.GDSException: deadlock

2002-10-18 Thread David Jencks
I think you should be using a sequence on Oracle and a generator on
Firebird.  I think you can write stored procedures on each to provide an
identical interface.

If you wish to keep using a table, in firebird you will need to set up a
separate connection pool with serializable isolation to defeat the record
versioning, or keep trying until you get a successful update.

david jencks

On 2002.10.18 15:14:33 -0400 Victor Batista wrote:
> Hello!
> I am using JBoss 3.0.2 with bundled tomcat 4.0.4.  I am also
> using the Firebird database with
> Firebird-jca-jdbc-driver RC1 (I also tried RC1a).
> I am having the following exception when I have two
> concurrent Transactions:
>  
> 19:13:47,351 ERROR [GlobalTxEntityMap] Store failed on entity: [.xpto.]
> javax.ejb.EJBException: Store failed; CausedByException is:
> GDS exception: org.firebirdsql.gds.GDSException: deadlock
> update conflicts with concurrent update
>  
> I have a session bean which handles sequence values through
> an Entity Bean. The session bean starts one transaction each time the
> sequence must be incremented (this is done in one method of the session
> bean):
>  
> sessionMethod
> start transaction
> query sequence value
> update sequence value with previous
> value + 1
> end transaction
>  
>  
> If I have two concurrent transactions to increment the same
> sequence, Firebird crashes with the exception above. I have tested this
> with Oracle and it works fine. I have accomplished my test inserting a
> sleep of several seconds (30) between the query and the update. 
> The second transaction blocks before the read, and only
> continues after the first one finishes. With Oracle, the second
> transaction reads the value stored by the previously transaction with
> firebird, it reads the same value as the previous transaction (Although
> it waits for the first to finish).
> For instance, if the value of one sequence is 10 and I start
> 2 concurrent transactions to get the new value, I get the following:
>  
> Oracle:
> Tx1 - gets 10, stores 11 and the session method returns 11
> Tx2 - waits for the first Tx to finish, gets 11, stores 12
> and the session method returns 12.
>  
> Firebird:
> Tx1 - gets 10, stores 11 and the session method returns 11
> Tx2 - waits for the first Tx to finish, gets 10, tries to
> store 11, but crashes with the exception above.
>  
> Can any one help me, please? Any help would be welcome.
>  
> Thanks in advance,
> Victor Batista
> 
>  xmlns:w="urn:schemas-microsoft-com:office:word"
> xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
> xmlns="http://www.w3.org/TR/REC-html40";>
> 
> 
> 
> 
> 
> 
> 
> 
> cid:filelist.xml@;01C276E2.F8AF7510">
>   name="time"/>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  style='mso-bookmark:OLE_LINK1'> style='font-size:10.0pt;font-family:Arial'>Hello style='mso-bookmark:OLE_LINK1'> style='font-size:10.0pt;font-family:Arial'>!
> 
>  face=Arial> 
>style='mso-tab-count:1'>   
>  style='mso-bookmark:OLE_LINK1'> style='font-size:
> 10.0pt;font-family:Arial;mso-ansi-language:EN-US'>I am using  class=SpellE>JBoss 3.0.2 with bundled tomcat 4.0.4.  style='mso-spacerun:yes'> I am also using the Firebird
> database
> with
> 
>  face=Arial>Firebird-jca-jdbc-driver RC1 (I also
> tried
> RC1a).
> 
>  face=Arial>style='mso-tab-count:1'>   
> I
> am having the following exception when I have two concurrent
> Transactions:

[JBoss-user] org.firebirdsql.gds.GDSException: deadlock

2002-10-18 Thread Victor Batista








Hello!

    I am using JBoss 3.0.2 with bundled tomcat 4.0.4.  I am also using the Firebird database
with

Firebird-jca-jdbc-driver RC1 (I also tried
RC1a).

    I
am having the following exception when I have two concurrent Transactions:

 

19:13:47,351 ERROR [GlobalTxEntityMap] Store failed
on entity: [.xpto.]

javax.ejb.EJBException: Store failed; CausedByException is:

    GDS
exception: org.firebirdsql.gds.GDSException: deadlock

update conflicts
with concurrent update

 

    I have a session bean which
handles sequence values through an Entity Bean. The session bean starts one
transaction each time the sequence must be incremented (this is done in one
method of the session bean):

 

    sessionMethod

    start transaction

        query sequence value

            update sequence value with previous value + 1

    end transaction

 

 

    If
I have two concurrent transactions to increment the same sequence, Firebird
crashes with the exception above. I have tested this with Oracle and it works
fine. I have accomplished my test inserting a sleep of several seconds (30)
between the query and the update. 

    The
second transaction blocks before the read, and only continues after the first
one finishes. With Oracle, the second transaction reads the value stored by the
previously transaction with firebird, it reads the same value as the previous
transaction (Although it waits for the first to finish).

    For
instance, if the value of one sequence is 10 and I start 2 concurrent
transactions to get the new value, I get the following:

 

    Oracle:

    Tx1
– gets 10, stores 11 and the session method returns 11

    Tx2
– waits for the first Tx
to finish, gets 11, stores 12 and the session method returns 12.

 

    Firebird:

    Tx1
– gets 10, stores 11 and the session method returns 11

    Tx2
– waits for the first Tx
to finish, gets 10, tries to store 11, but crashes with the exception above.

 

    Can
any one help me, please? Any help would be welcome.

 

    Thanks
in advance,

    Victor
Batista








[JBoss-user] JBoss 3.2 Release Plans

2002-10-18 Thread Hunter Hillegas
Are there plans for another beta release of JBoss 3.2?

Hunter



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



Re[2]: [JBoss-user] CMR Bug

2002-10-18 Thread Alex Loubyansky
Hello Michael,

thanks for the test case. But it's definitely not a JBoss bug.
The problem is that, in bean A you use one column for two CMR fields.

  B-Output
  
  
  One-B-Has-Many-A
  
 
   id
   bId
 
  
  
...
  B-Input
  
  
  One-B-Has-Many-A
  
 
   id
   bId
 
  
  

So, in bean A CMR fields input and output are mapped to one column
bId. Thus, after their state is persisted, they will have the same value.
Try to change one column to bbId.

BTW, look at the sql for table A:
CREATE TABLE A
(uUID VARCHAR(256) NOT NULL,
name VARCHAR(256),
bId INTEGER,
bId INTEGER,
CONSTRAINT PK_A PRIMARY KEY (uUID))

I think most databases won't like it, as opposite to Hypersonic.

alex

Thursday, October 17, 2002, 10:48:15 PM, you wrote:

MN> Hi Alex!

MN> Sorry for coming back to you so late.
MN> I have written a test case that demonstrates the bug. It still works with
MN> JBoss 3.0.0 but does not with either JBoss 3.0.3 or 3.2.0beta. I have
MN> assembled a project consisting of ANT build and run scripts along with the
MN> source code and required libraries in order to make it straightforward to
MN> run the example.
MN> The example test case does two things:
MN> 1.) First of all it creates entity beans of type A and B and sets up the
MN> relationships among them. Within the same transaction it prints the
MN> relationships to the console. -> Everything is all right
MN> 2.) Within a new transaction it once again finds the beans and prints their
MN> relationships to the console via System.out.println - just as before. ->
MN> It's interesting to note that both relationships that previously pointed to
MN> different beans now point to the same bean. That's the bug!

MN> Unfortunately the whole thing is several megabytes in size... to large to be
MN> sent to the jboss mailing list. Therefore I want to ask whether it would be
MN> ok if I sent you the zipped files to your personal e-mail address
MN> ([EMAIL PROTECTED]). As the primary CMP developer, Dain might be interested
MN> as well.

MN> One further note: different JBoss versions have different jnp-client.jar and
MN> jboss-client.jar. Therefore it might be necessary to copy the corresponding
MN> version of jbossall-client.jar into the project's lib directory.

MN> Thanks Michael
MN> - Original Message -
MN> From: "Alex Loubyansky" <[EMAIL PROTECTED]>
MN> To: "Michael Nowotny" <[EMAIL PROTECTED]>
MN> Sent: Monday, October 14, 2002 6:43 PM
MN> Subject: Re: [JBoss-user] CMR Bug


>> Hello Michael,
>>
>> you need to provide a test-case. It works for me, though in
>> jboss-3.2.0beta2.
>>
>> alex
>>
>> Monday, October 14, 2002, 12:50:01 AM, you wrote:
>>
>> MN> Hi!
>>
>> MN> There is still a CMR bug present in JBoss 3.2.0 Beta. This bug is
MN> easily described:
>> MN> Whenever one entity bean type A has more than one relationship to bean
MN> type B which should point to different instance of bean type B, these two
MN> references point to the same bean instance. I.e.
>> MN> they are not managed independently of each other.
>> MN> This bug is not present in JBoss version 3.0.0, was introduced in
MN> 3.0.1 and has been present ever since.
>>
>> MN> Having to stick to 3.0.0 and thereby not beeing able to take advantage
MN> of the latest JBoss features is somewhat annoying - although not critical.
MN> Especially when you take into account the
>> MN> improvements that have been made concerning start-up and deployment
MN> time.
>>
>> MN> Thanks in advance!
>> MN> Michael

-- 
Best regards,
 Alex Loubyansky




---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] JNDI port error in JBoss 3.0.0, 1 and.2

2002-10-18 Thread Sacha Labourey
Hello,

I've just re-read your first message and I had badly read it first!

Is your colleague running the jboss configuration named "all" (or is the
clustering service deployed on his machine)?

If yes, then that is the problem: not finding the JNDI server, your client
will try to find on by using a multicast discovery paquet. If HA-JNDI runs,
then this one is used. Then, for the exception, either:
 - your jboss client jar and your colleague's JBoss version doen't match
 - they match but you are using a 3.0.0 release or something like this and I
think there was a bug in the stub marshalling.

cheers,


sacha

> -Message d'origine-
> De : [EMAIL PROTECTED]
> [mailto:jboss-user-admin@;lists.sourceforge.net]De la part de
> Jonathan.O'[EMAIL PROTECTED]
> Envoye : vendredi, 18 octobre 2002 16:03
> A : [EMAIL PROTECTED]
> Objet : RE: [JBoss-user] JNDI port error in JBoss 3.0.0, 1 and.2
>
>
> Sacha,
> Nice try, but no way. I have an ant target that lets me switch from one
> version of JBoss to another. I was very careful to make sure I was using
> 3.0.3
> Ciao,
> Jonathan O'Connor
> Ph: +353 1 872 3305
> Mob: +353 86 824 9736
> Fax: +353 1 873 3612
>
>
>
>
>
> "Sacha Labourey" <[EMAIL PROTECTED]>
> Sent by: [EMAIL PROTECTED]
> 18.10.2002 13:07
> Please respond to jboss-user
>
>
> To: <[EMAIL PROTECTED]>
> cc:
> Subject:RE: [JBoss-user] JNDI port error in JBoss
> 3.0.0, 1 and.2
>
>
> ?!? You still use 3.0.0 client JARS?
>
> You *must* use the client jars that come with the release that you test
> (i.e. the one in JBOSS_HOME/client)
>
> Cheers,
>
>
>  Sacha
>
>
>
> ---
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] JNDI port error in JBoss 3.0.0, 1 and.2

2002-10-18 Thread Jonathan . O'Connor
Sacha,
Nice try, but no way. I have an ant target that lets me switch from one 
version of JBoss to another. I was very careful to make sure I was using 
3.0.3
Ciao,
Jonathan O'Connor
Ph: +353 1 872 3305
Mob: +353 86 824 9736
Fax: +353 1 873 3612





"Sacha Labourey" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
18.10.2002 13:07
Please respond to jboss-user

 
To: <[EMAIL PROTECTED]>
cc: 
Subject:RE: [JBoss-user] JNDI port error in JBoss 3.0.0, 1 and.2


?!? You still use 3.0.0 client JARS?

You *must* use the client jars that come with the release that you test
(i.e. the one in JBOSS_HOME/client)

Cheers,


 Sacha



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] JNDI port error in JBoss 3.0.0, 1 and.2

2002-10-18 Thread Sacha Labourey
?!? You still use 3.0.0 client JARS?

You *must* use the client jars that come with the release that you test
(i.e. the one in JBOSS_HOME/client)

Cheers,


Sacha

> -Message d'origine-
> De : [EMAIL PROTECTED]
> [mailto:jboss-user-admin@;lists.sourceforge.net]De la part de
> Jonathan.O'[EMAIL PROTECTED]
> Envoye : vendredi, 18 octobre 2002 12:25
> A : [EMAIL PROTECTED]
> Objet : RE: [JBoss-user] JNDI port error in JBoss 3.0.0, 1 and.2
>
>
> Sascha,
> I just setup 3.0.3, and I get the same error messages as with
> 3.0.0, 3.0.1
> and 3.0.2.
> I'm not surprised by this because I'm using the JBoss client jars, and I
> doubt if these have changed very much between minor releases.
>
> I suspect that this has nothing to do with JBoss at all, but is in fact
> some insidious problem in our JVM (Sun's 1.4.1 for Windows) or even
> something in the OS.
>
> Also, I have searched my disk for the magic 10.100.1.30:1100 and its not
> to be found. Here's my jndi.properties file:
> # Sample ResourceBundle properties file
> java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
> java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
> java.naming.provider.url=jnp://localhost:1099
> #java.naming.provider.url=jnp://srv-dublin-01:1400
> #java.naming.provider.url=jnp://localhost:1400
>
> java.naming.rmi.security.manager=yes
>
> Ciao,
> Jonathan O'Connor
> Ph: +353 1 872 3305
> Mob: +353 86 824 9736
> Fax: +353 1 873 3612
>
>
>
>
> "Sacha Labourey" <[EMAIL PROTECTED]>
> Sent by: [EMAIL PROTECTED]
> 18.10.2002 08:35
> Please respond to jboss-user
>
>
> To: <[EMAIL PROTECTED]>
> cc:
> Subject:RE: [JBoss-user] JNDI port error in JBoss
> 3.0.0, 1 and.2
>
>
> Could you please check with the latest stable release, 3.0.3?
>
> > -Message d'origine-
> > De : [EMAIL PROTECTED]
> > [mailto:jboss-user-admin@;lists.sourceforge.net]De la part de
> > Jonathan.O'[EMAIL PROTECTED]
> > Envoye : jeudi, 17 octobre 2002 19:13
> > A : [EMAIL PROTECTED]
> > Objet : [JBoss-user] JNDI port error in JBoss 3.0.0, 1 and.2
> >
> >
> > Folks,
> > Steps to produce error:
> > 1. Make sure my jboss server is not running.
> > 2. Start my client app which tries to connect to the JBoss server
> >
> > Result:
> > Error message that refers to a completely different
> > java.naming.provider.url (actually one of my colleagues ports on a
> > different server machine)
> >
> > Expected result:
> > Error message that refers to my java.naming.provider.url (in my case
> > localhost:1099)
> >
> > Environment: Happens on JBoss 3.0.0, 3.0.1 and 3.0.2 running under Linux
> > or Windows 2000.
> >
> > (ejb.RemoteHomeFactory   122 ) Exception occurred while
> > looking up a remote home object
> > javax.naming.CommunicationException: Failed to retrieve stub from server
> > 10.100.1.30:1100.  Root exception is
> > java.io.StreamCorruptedException: unexpected block data
> > at
> > java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1288)
> > at
> > java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
> > at
> > java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
> > at
> >
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
> > at
> > java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
> > at
> > java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
> > at
> > java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
> > at
> >
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
> > at
> > java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
> > at
> > java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
> > at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
> > at
> > org.jnp.interfaces.NamingContext.getServer(NamingContext.java:169)
> > at
> > org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:942)
> > at
> > org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1017)
> > at
> org.jnp.interfaces.NamingContext.lookup(NamingContext.java:447)
> > at
> org.jnp.interfaces.NamingContext.lookup(NamingContext.java:440)
> > at javax.naming.InitialContext.lookup(InitialContext.java:347)
> > at
> > xcom.traxbahn.util.ejb.RemoteHomeFactory.lookUpHome(RemoteHomeFact
> > ory.java:111)
> >
> > Ciao,
> > Jonathan O'Connor
> > Ph: +353 1 872 3305
> > Mob: +353 86 824 9736
> > Fax: +353 1 873 3612
> >
> >
> > ---
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > ___
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> >
>
>
>
> 

RE: [JBoss-user] JNDI port error in JBoss 3.0.0, 1 and.2

2002-10-18 Thread Jonathan . O'Connor
Sascha,
I just setup 3.0.3, and I get the same error messages as with 3.0.0, 3.0.1 
and 3.0.2.
I'm not surprised by this because I'm using the JBoss client jars, and I 
doubt if these have changed very much between minor releases.

I suspect that this has nothing to do with JBoss at all, but is in fact 
some insidious problem in our JVM (Sun's 1.4.1 for Windows) or even 
something in the OS.

Also, I have searched my disk for the magic 10.100.1.30:1100 and its not 
to be found. Here's my jndi.properties file:
# Sample ResourceBundle properties file
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=jnp://localhost:1099
#java.naming.provider.url=jnp://srv-dublin-01:1400
#java.naming.provider.url=jnp://localhost:1400

java.naming.rmi.security.manager=yes

Ciao,
Jonathan O'Connor
Ph: +353 1 872 3305
Mob: +353 86 824 9736
Fax: +353 1 873 3612




"Sacha Labourey" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
18.10.2002 08:35
Please respond to jboss-user

 
To: <[EMAIL PROTECTED]>
cc: 
Subject:RE: [JBoss-user] JNDI port error in JBoss 3.0.0, 1 and.2


Could you please check with the latest stable release, 3.0.3?

> -Message d'origine-
> De : [EMAIL PROTECTED]
> [mailto:jboss-user-admin@;lists.sourceforge.net]De la part de
> Jonathan.O'[EMAIL PROTECTED]
> Envoye : jeudi, 17 octobre 2002 19:13
> A : [EMAIL PROTECTED]
> Objet : [JBoss-user] JNDI port error in JBoss 3.0.0, 1 and.2
>
>
> Folks,
> Steps to produce error:
> 1. Make sure my jboss server is not running.
> 2. Start my client app which tries to connect to the JBoss server
>
> Result:
> Error message that refers to a completely different
> java.naming.provider.url (actually one of my colleagues ports on a
> different server machine)
>
> Expected result:
> Error message that refers to my java.naming.provider.url (in my case
> localhost:1099)
>
> Environment: Happens on JBoss 3.0.0, 3.0.1 and 3.0.2 running under Linux
> or Windows 2000.
>
> (ejb.RemoteHomeFactory   122 ) Exception occurred while
> looking up a remote home object
> javax.naming.CommunicationException: Failed to retrieve stub from server
> 10.100.1.30:1100.  Root exception is
> java.io.StreamCorruptedException: unexpected block data
> at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1288)
> at
> java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
> at
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
> at
> 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
> at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
> at
> java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
> at
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
> at
> 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
> at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
> at
> java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
> at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
> at
> org.jnp.interfaces.NamingContext.getServer(NamingContext.java:169)
> at
> org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:942)
> at
> org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1017)
> at 
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:447)
> at 
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:440)
> at javax.naming.InitialContext.lookup(InitialContext.java:347)
> at
> xcom.traxbahn.util.ejb.RemoteHomeFactory.lookUpHome(RemoteHomeFact
> ory.java:111)
>
> Ciao,
> Jonathan O'Connor
> Ph: +353 1 872 3305
> Mob: +353 86 824 9736
> Fax: +353 1 873 3612
>
>
> ---
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user





---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] HELP: I'm unable to connect to jboss from my Swing app

2002-10-18 Thread JohnsBrn
You cannot access the java:comp/env environment context from a client application, it 
is a local jvm context. Try looking up ejb/tspace/UserManager instead.

Herve Tchepannou <[EMAIL PROTECTED]> wrote:

>- I have a Session bean deployed on JBoss
>- I have a swing app that try to connect to the remove component like this:
>
>1: java.lang.Object objRef =
>initialContext.lookup("java:comp/env/ejb/tspace/UserManager")
>2: cachedRemoteHome =
>(tspace.framework.user.interfaces.UserManagerRemoteHome)
>PortableRemoteObject.narrow(objRef,
>tspace.framework.user.interfaces.UserManagerRemoteHome.class);
>
>
>But the line #1 fails and I receive the following error:
>[java] javax.naming.NameNotFoundException: ejb not bound
>[java] at
>org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
>
>[java] at
>org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
>
>[java] at
>org.jnp.server.NamingServer.getObject(NamingServer.java:509)
>[java] at
>org.jnp.server.NamingServer.lookup(NamingServer.java:253)
>[java] at
>org.jnp.server.NamingServer.lookup(NamingServer.java:256)
>[java] at
>org.jnp.interfaces.NamingContext.lookup(NamingContext.java:45
>
>[java] at
>org.jnp.interfaces.NamingContext.lookup(NamingContext.java:56
>
>[java] at
>org.jnp.interfaces.NamingContext.lookup(NamingContext.java:44
>
>[java] at
>javax.naming.InitialContext.lookup(InitialContext.java:347)
>[java] at
>tspace.framework.user.util.GroupUtil.getLocalHome(GroupUtil.j
>5)
>[java] at
>tspace.framework.user.ejb.UserManagerBean.findSubGroups(UserM
>rBean.java:225)
>[java] at
>tspace.framework.user.ejb.UserManagerBean.findSubGroups(UserM
>rBean.java:212)
>[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>Method)
>[java] at
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
>pl.java:39)
>[java] at
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
>cessorImpl.java:25)
>[java] at java.lang.reflect.Method.invoke(Method.java:324)
>[java] at
>org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.
>e(StatelessSessionContainer.java:660)
>[java] at
>org.jboss.resource.connectionmanager.CachedConnectionIntercep
>nvoke(CachedConnectionInterceptor.java:186)
>[java] at
>org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.inv
>tatelessSessionInstanceInterceptor.java:77)
>[java] at
>org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(Abstra
>nterceptor.java:107)
>[java] at
>org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(Tx
>ceptorCMT.java:151)
>[java] at
>org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCM
>a:60)
>[java] at
>org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInte
>or.java:130)
>
>My swing app jndi.properties look like:
>
>java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
>java.naming.provider.url=localhost
>java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
>
>Does any one knows where the problem is?
>thanx in advance.
>
>PS: I checked with Jboss JNDIView and my component existed in the JNDI tree
>
>Herve Tchepannou
>Software Engineer
>Objexis Coorporation
>Phone: (514) 932 3295 Ext. 231
>mailto:htchepannou@;objexis.com
>
>Objexis Coorporation
>http://www.objexis.com
>1635 Sherbrooke West, Suite #405
>Montreal, Qc H3H 1E2
>Tel: 514.932.3295
>Fax: 514.932.4639
>http://www.objexis.com
>
>Important - This message may contain privileged and confidential
>information.  It is intended only for the use of the individual(s) named
>above. If the reader of this message is not the intended recipient you are
>hereby notified that any use, dissemination, distribution or reproduction of
>this message is prohibited. If you have received this message in error
>please notify Objexis Corporation immediately and promptly delete this
>message and any copies thereof. Any views expressed in this message are
>those of the individual sender and may not necessarily reflect the views of
>Objexis Corporation.
>
>

__
The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/


---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] Re: Help with cmr relationship please

2002-10-18 Thread Gene Ge
Hi,kiuma

I have seen your question and Alex's reply and wonder whether you have 
solved the problem.

I'm a little confusing by your user-role's 1:N relationship. I think in most 
applications it should be N:N, for one user may be in many roles and many 
users may in the same role.

OK, let's first suppose you really need 1:N. In this situation, first you 
need a primary key and declare it as the PK field of your RoleBean, second 
you should not(and never) declare your foreign key column(such as 
pricinpleId) in your db table as a cmp field in your RoleBean(it's 
important!). So, when you want to add a new Role in your ***application***, 
you should only call roleBean.create(PK, name, ...) without foreign key and 
the result is your foreign key column in your table is null.  And, when you 
want to add a new role to your ***User***, you should first have a 
UserBean(create or find one), and then call user.getRoles to get the roles' 
Collection, after that, find a RoleBean( such as by findByPrimaryKey), call 
your roles' Collection's add method and pass the RoleBean you found as 
parameter( like roleCollection.add(roleBean)). This way, jboss will auto set 
the value of foreign key column(pricinple) in your role table as the value 
of your user's PK. Please pay attention to the difference of the word with 
"***" I marked.

If your really requirement is a N:N relationship, it will be more complex 
and I can help you if you want.

Hope it's helpful and good luck!

Gene


kiuma wrote:

Hi all,

I've the following problem:

I've mapped principals and roles in a 1..n relationship

When I try to add a role using:
roleHome.create( new RoleData(pPrincipalId, "caller_principal",
"CallerPrincipal") );

I've the following error back

08:53:40,972 ERROR [LogInterceptor] EJBException:
javax.ejb.EJBException: Creation Role failure: Could not create
entity:java.sql.SQLException: ERROR:  Attribute 'principalid' specified
more than once

Since I'm already a newbie I can't figure out what this message means.

My cmr generated by xdoclet is:
for jboss:


   
 user-roles
 

 

role-has-user
 
 
 

user-has-role
 

  principalId
  principalid

 
 
   
 


Obviously if I don't use the relationship in my code I can add that role.


_
Broadband? Dial-up? Get reliable MSN Internet Access. 
http://resourcecenter.msn.com/access/plans/default.asp



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] JNDI port error in JBoss 3.0.0, 1 and.2

2002-10-18 Thread Jonathan . O'Connor
Folks,
Steps to produce error:
1. Make sure my jboss server is not running.
2. Start my client app which tries to connect to the JBoss server

Result:
Error message that refers to a completely different 
java.naming.provider.url (actually one of my colleagues ports on a 
different server machine)

Expected result:
Error message that refers to my java.naming.provider.url (in my case 
localhost:1099)

Environment: Happens on JBoss 3.0.0, 3.0.1 and 3.0.2 running under Linux 
or Windows 2000.

(ejb.RemoteHomeFactory   122 ) Exception occurred while 
looking up a remote home object
javax.naming.CommunicationException: Failed to retrieve stub from server 
10.100.1.30:1100.  Root exception is 
java.io.StreamCorruptedException: unexpected block data
at 
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1288)
at 
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at 
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at 
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at 
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at 
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at 
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at 
java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
at 
org.jnp.interfaces.NamingContext.getServer(NamingContext.java:169)
at 
org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:942)
at 
org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1017)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:447)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:440)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at 
xcom.traxbahn.util.ejb.RemoteHomeFactory.lookUpHome(RemoteHomeFactory.java:111)

Ciao,
Jonathan O'Connor
Ph: +353 1 872 3305
Mob: +353 86 824 9736
Fax: +353 1 873 3612


---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user