[JBoss-user] CMP getter exception

2001-10-03 Thread Eric Anderson

Hi all,
  I'm getting a mysterious exception with JBoss 2.4.1a and a fairly simple CMP bean.  
The bean is called "User" and references the "Users" table in an Oracle server.
The code that causes the exception looks like this:

UserHome uhome = (UserHome)PortableRemoteObject.narrow (ref, UserHome.class);
User User1 = uhome.findByPrimaryKey(new Long(1));
System.out.println(User1.getPassword());

The exception is thrown when getPassword() is called.  This should return a String, 
and the corresponding column in the table is of type VARCHAR2(10).
Below is the stack trace:

[J2EE Deployer Default] J2EE application: 
file:/opt/JBoss-2.4.1_Tomcat-3.2.3/jboss/deploy/VLBeans.jar is deployed.
[JAWS] Exists command executing: SELECT COUNT(*) FROM USERS WHERE objid=?
[JAWS] Set parameter: idx=1, jdbcType=BIGINT, value=1
[EntityLockInterceptor] Begin invoke, key=1
[User] Activated bean User with id = 1
[EntityInstanceInterceptor] Begin invoke, key=1
[EntitySynchronizationInterceptor] invoke called for ctx 
org.jboss.ejb.EntityEnterpriseContext@e344b02, tx=TransactionImpl:XidImpl 
[FormatId=257, GlobalId=catamount.ultracode.com//1, BranchQual=]
[JAWS] Load command executing: SELECT 
USERS.objid,USERS.user_priv_type,USERS.user_id,USERS.password,USERS.first_name,USERS.privilage_allowed,USERS.state,USERS.account_id,USERS.phone,USERS.audio_priv,USERS.qa,USERS.street,USERS.street2,USERS.phoneretrievalpin,USERS.login_allowed,USERS.email,USERS.country,USERS.user_num,USERS.city,USERS.last_name,USERS.zip,USERS.priority,USERS.middle_name,USERS.fax,USERS.phone_lines,USERS.title
 FROM USERS WHERE objid=?
[JAWS] Set parameter: idx=1, jdbcType=BIGINT, value=1
[EntitySynchronizationInterceptor] loadEntity Exception, clear tx for 
ctx=org.jboss.ejb.EntityEnterpriseContext@e344b02, tx=TransactionImpl:XidImpl 
[FormatId=257, GlobalId=catamount.ultracode.com//1, BranchQual=]
[EntityInstanceInterceptor] Ending invoke, exceptionThrown, 
ctx=org.jboss.ejb.EntityEnterpriseContext@e344b02
[EntityInstanceInterceptor] End invoke, key=1, 
ctx=org.jboss.ejb.EntityEnterpriseContext@e344b02
[EntityLockInterceptor] End invoke, key=1
[User] TRANSACTION ROLLBACK EXCEPTION:Load failed; nested exception is: 
java.lang.NullPointerException; nested exception is: 
java.rmi.ServerException: Load failed; nested exception is: 
java.lang.NullPointerException
[User] java.rmi.ServerException: Load failed; nested exception is: 
[User]  java.lang.NullPointerException
[User] java.lang.NullPointerException
[User]  at java.lang.reflect.Field.set(Native Method)
[User]  at 
org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.setCMPFieldValue(JDBCCommand.java:655)
[User]  at 
org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.loadOneEntity(JDBCLoadEntityCommand.java:217)
[User]  at 
org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.handleResult(JDBCLoadEntityCommand.java:176)
[User]  at 
org.jboss.ejb.plugins.jaws.jdbc.JDBCQueryCommand.executeStatementAndHandleResult(JDBCQueryCommand.java:59)
[User]  at 
org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:160)
[User]  at 
org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:147)
[User]  at 
org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.loadEntity(JAWSPersistenceManager.java:156)
[User]  at 
org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:362)
[User]  at 
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:286)
[User]  at 
org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:208)
[User]  at 
org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:136)
[User]  at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
[User]  at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:307)
[User]  at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
[User]  at 
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
[User]  at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
[User]  at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:427)
[User]  at 
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:393)
[User]  at java.lang.reflect.Method.invoke(Native Method)
[User]  at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:242)
[User]  at sun.rmi.transport.Transport$1.run(Transport.java:155)
[User]  at java.security.AccessController.doPrivileged(Native Method)
[User]  at sun.rmi.transport.Transport.serviceCall(Transport.java:152)
[User]  at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:462) 

I was wondering if this might have something to do with there being no VARCHAR2 
mapping in standardjaws.xml?

Eric Anderson




___
JBoss-user mailing list
[EM

[JBoss-user] Jboss default trans-attribute

2001-10-03 Thread John LYC

Hi all,

what is Jboss  for the descriptor?

Thanks
John


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



Re: [JBoss-user] Shouldn't It Be CreateException

2001-10-03 Thread Dmitri Colebatch

what you say sounds right to me.  What is the method call?  as in who is
calling create()?


On Wed, 3 Oct 2001, Frank Morton wrote:

> I'm using JBoss-2.4.1a_Tomcat-3.2.3.zip with mySQL. If I
> attempt to create two beans with the same primary key, I
> get back:
> 
> java.rmi.ServerException: RemoteException occurred in server thread; nested
> exception is:
> javax.transaction.TransactionRolledbackException: INSERTING AN
> ALREADY EXISTING BEAN, ID = test; nested exception is:
> java.lang.IllegalStateException: INSERTING AN ALREADY EXISTING BEAN,
> ID = test
> 
> I was expecting a CreateException. Is this right and can I rely
> on it with different datastores underneath to return the same
> exception?
> 
> Thanks.
> 
> 
> 
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 


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



[JBoss-user] Change primkey field 2nd time is sort of "noop"

2001-10-03 Thread David M. Karr

JBoss-2.4.1_Tomcat-3.2.3:

I have a relatively simple EJB/web application.  I have a list page, and an
edit page.  Currently, my primary key is not opaque, and I can currently change
it in the application.  Is this a big mistake?  I could use some detail on why
that might be.

I'm seeing an odd symptom when I change the primary key the SECOND time.

I start the application, which displays a "list page".  I click "Edit" on a row
to go to an "edit page", and I change one character in the primary key field
and click "Save".  This causes the list of objects to be retrieved again and
the "list page" to be redisplayed.  So far, this works correctly.  The
redisplay of the list page shows the new value.

I verified that the database has changed correctly by running a query in a
"mysql" window.

Now, I click "Edit" again and change the primary key value back to the original
and click "Save".  The list page redisplays, but with the wrong value.  If the
original value was "A", and the second value was "B", the list now displays "B"
instead of the correct value of "A".

I again verified that the database has changed correctly by running a query in
a "mysql" window.  At this point, the database has the value "A", but the value
of the attribute in the Bean instance was "B".

I put print statements into my bean class, both in the "set" method for this
attribute and the method which creates and returns the "value object", which is
an aggregation of all the fields.

In the case that fails, I see it correctly "set" the new value, but right after
that, when I see it building the value object, the primary key is the wrong
value.  It's as if those two last print statements are being executed in
different instances.

Could this all be because of my not using an opaque primary key, and changing
it?  I was planning on reviewing the patterns for generating unique opaque OID
values for primary keys, but I'd like to know for sure whether this is the
issue here.

-- 
===
David M. Karr  ; Best Consulting
[EMAIL PROTECTED]   ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004)


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



[JBoss-user] Shouldn't It Be CreateException

2001-10-03 Thread Frank Morton

I'm using JBoss-2.4.1a_Tomcat-3.2.3.zip with mySQL. If I
attempt to create two beans with the same primary key, I
get back:

java.rmi.ServerException: RemoteException occurred in server thread; nested
exception is:
javax.transaction.TransactionRolledbackException: INSERTING AN
ALREADY EXISTING BEAN, ID = test; nested exception is:
java.lang.IllegalStateException: INSERTING AN ALREADY EXISTING BEAN,
ID = test

I was expecting a CreateException. Is this right and can I rely
on it with different datastores underneath to return the same
exception?

Thanks.



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



Re: [JBoss-user] Jboss warning whenever i deploy.

2001-10-03 Thread John LYC

Thank everyone,
i will change my method signature to throws finderException...

But i agree with you guys..
it should be legal thru inheritence.

anyway, for now, i'll just do as above.
regards,
John



- Original Message -
From: "Dmitri Colebatch" <[EMAIL PROTECTED]>
To: "Sacha Labourey" <[EMAIL PROTECTED]>
Cc: "John LYC" <[EMAIL PROTECTED]>; "Jboss Mailing List"
<[EMAIL PROTECTED]>
Sent: Wednesday, October 03, 2001 8:09 PM
Subject: RE: [JBoss-user] Jboss warning whenever i deploy.


> ObjectNotFoundException is a subclass of FinderException...
>
> On Wed, 3 Oct 2001, Sacha Labourey wrote:
>
> > John,
> >
> > I guess the message is quite clear...
> >
> > > Section: 9.2.8
> > > Warning: All the exceptions defined in the throws clause of an ejbFind
> > > method of the entity bean class must be included in the throws
> > > clause of the
> > > matching find method of the home interface.
> >
> > Look at section 9.2.8 of the EJB 1.1 spec.
> >
> > in short: exception on finder methods of the bean must be present on
finder
> > declaration of the home.
> >
> > Your bean finder declaration:
> > > public String ejbFindByPrimaryKey(String key) throws
> > > ObjectNotFoundException
> >
> > => ObjectNotFoundException may be thrown
> >
> > Your home declaration for this finder:
> > > public Contact findByPrimaryKey(String primaryKey) throws
> > > RemoteException, FinderException;
> >
> > Where is the ObjectNotFoundException declaration on this method
declaration
> > of the home?
> >
> >
> >
> >
> > Sacha
> >
> >
> > ___
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> >
>
>
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>

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



RE: [JBoss-user] Local Interface?

2001-10-03 Thread David You

Yeah, I did it wrong on ejb.xml. 
and I fixed it. then the context lookup failed.
Says not bounded. 
Then I saw the email say only in 3.0. Stoped there.

david

-Original Message-
From: Dmitri Colebatch [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 03, 2001 5:30 PM
To: David You
Cc: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Local Interface?


What do you have in your ejb-jar.xml?  Are you providing local-home or
home tags?

cheers
dim

On Wed, 3 Oct 2001, David You wrote:

> I remember someone said JBoss had already supported LocalInterface?
> I tried on 2.4.1 and it got me errors:
> Any Ideas?
> 
> thanks
> david
> =
> 
> Bean   : SequenceSession
> Section: 6.10.6
> Warning: A session bean's home interface must extend the
> javax.ejb.EJBHome inter
> face.
> 
> [Verifier]
> Bean   : SequenceSession
> Method : public abstract void remove(Object) throws RemoveException,
> EJBExceptio
> n
> Section: 6.10.6
> Warning: The methods in the home interface must include
> java.rmi.RemoteException
>  in their throws clause.
> 
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 


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



Re: [JBoss-user] Local Interface?

2001-10-03 Thread Dmitri Colebatch

What do you have in your ejb-jar.xml?  Are you providing local-home or
home tags?

cheers
dim

On Wed, 3 Oct 2001, David You wrote:

> I remember someone said JBoss had already supported LocalInterface?
> I tried on 2.4.1 and it got me errors:
> Any Ideas?
> 
> thanks
> david
> =
> 
> Bean   : SequenceSession
> Section: 6.10.6
> Warning: A session bean's home interface must extend the
> javax.ejb.EJBHome inter
> face.
> 
> [Verifier]
> Bean   : SequenceSession
> Method : public abstract void remove(Object) throws RemoveException,
> EJBExceptio
> n
> Section: 6.10.6
> Warning: The methods in the home interface must include
> java.rmi.RemoteException
>  in their throws clause.
> 
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 


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



RE: [JBoss-user] JBoss-Catalina 2.4.3 - server.xml file

2001-10-03 Thread menonv

Has anyone really got the new JBoss 2.4.3 - Tomcat 4.0 bundle to work. While
I understand that applications need to be deployed via ear files why does
JBoss not support the container as it used to in the previous release? What
is my deployment unit is a war file? Does it mean that I need to package it
into a ear file just to get the whole thing to work? 

Why is it so? And what benefit do we get out of it? I just think that this
concept of not supporting the Tomcat 4.0 container as a stand alone web
container in its own rights is kind of disappointing.

Regards

Vinay

> -Original Message-
> From: Papo Napolitano [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, October 03, 2001 6:57 PM
> To:   [EMAIL PROTECTED]
> Subject:  [JBoss-user] JBoss-Catalina 2.4.3 - server.xml file
> 
> Hi,
> 
> I've installed the Jboss with Tomcat 4.0 and it doesn't work ok.
> I start, and the server is up, but it seems that Tomcat doesn't read the
> server.xml file from the conf directory.
> If I start Tomcat alone it works fine.
> 
> Any idea ??
> 
> Regards,
> Papo.
> 
> 
> 
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user


Disclaimer

This communication together with any attachments transmitted with it ('this E-mail') 
is intended only for the use of the addressee and may contain information which is 
privileged and confidential. If the reader of this E-mail is not the intended 
recipient or the employee or agent responsible for delivering it to the intended 
recipient you are notified that any use of this E-mail is prohibited. Addressees 
should check this E-mail for viruses. The Carphone Warehouse Group PLC makes no 
representations as regards the absence of viruses in this E-mail. If you have received 
this E-mail in error please notify our ISe Response Team immediately by telephone on + 
44 (0)20 8896 5828 or via E-mail at [EMAIL PROTECTED] Please then immediately 
destroy this E-mail and any copies of it.

Please feel free to visit our website: http://www.phonehouse.com


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



[JBoss-user] Local Interface?

2001-10-03 Thread David You

I remember someone said JBoss had already supported LocalInterface?
I tried on 2.4.1 and it got me errors:
Any Ideas?

thanks
david
=

Bean   : SequenceSession
Section: 6.10.6
Warning: A session bean's home interface must extend the
javax.ejb.EJBHome inter
face.

[Verifier]
Bean   : SequenceSession
Method : public abstract void remove(Object) throws RemoveException,
EJBExceptio
n
Section: 6.10.6
Warning: The methods in the home interface must include
java.rmi.RemoteException
 in their throws clause.

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



SV: [JBoss-user] getCallerPrincipal problems

2001-10-03 Thread Lennart Petersson

On the client:

* Using following auth.conf:
--- start of clip ---
other {
se.benefit.auth.jaas.ECSClientLoginModule required;
};
--- end of clip ---

As you can se we are using our own login module. Why? Actually the only reason is that 
we have a need of an extended Pricipal (se.benefit.auth.jaas.ECSPrincipal) that 
besides the username also carries a client identification (the physical client - where 
have the user logged on the system).

I've attached both ECSClientLoginModule and ECSPrincipal java files.

On the server:

* Using following auth.conf:
--- start of clip ---
other {
org.jboss.security.plugins.samples.DatabaseServerLoginModule required 
unauthenticatedIdentity="nobody" dsJndiName="java:comp/env/jdbc/ECS" 
principalsQuery="select password from iduser.userentity where username = ?" 
rolesQuery="select a.functionid, '' from iduser.authentity a, iduser.rolememberentity 
m, iduser.userentity u where a.siteid = m.siteid and a.identityid = m.roleid and 
m.siteid = u.siteid and m.identityid = u.userid and u.username = ?";
};
--- end of clip ---

As you can see we authenticates our users against a database.

Here is a code example how we use ECSPrincipal within an EJB on the server:
--- start of clip ---
 Principal p = getSessionContext().getCallerPrincipal();
 String user = null;
 String client = null;
 try
 {
user = p.getName();
client = ((ECSPrincipal)p).getClient();
 }
 catch(final ClassCastException e)
 {
 }
--- end of clip ---

- Original Message - 
From: Vinay Menon <[EMAIL PROTECTED]>
To: Lennart Petersson <[EMAIL PROTECTED]>
Sent: Wednesday, October 03, 2001 10:24 AM
Subject: Re: [JBoss-user] getCallerPrincipal problems


> That would be helpful. I am kind of new to JAAS based systems and any inputs
> would be greatly appreciated.
> 
> Thanks
> Vinay
> 
> - Original Message -
> From: "Lennart Petersson" <[EMAIL PROTECTED]>
> To: "Vinay Menon" <[EMAIL PROTECTED]>
> Sent: Wednesday, October 03, 2001 7:51 AM
> Subject: SV: [JBoss-user] getCallerPrincipal problems
> 
> 
> Yes, we have a Swing based stand-alone application that is using JBoss JAAS
> security without problems. Do you want me to be more specific? :-)
> 
> /Lennart
> 
> - Original Message -
> From: Vinay Menon <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, October 02, 2001 4:49 PM
> Subject: Re: [JBoss-user] getCallerPrincipal problems
> 
> 
> > Has anyone tried integrating non-web applications with the JBoss security
> > framework? I believe principals can be propagated from Web Containers to
> the
> > JBoss easily but what about from Swing based applications etc?
> >
> > Any thoughts?
> 
> 

 ECSPrincipal.java
 ECSClientLoginModule.java


[JBoss-user] FW: Tomcat 4 Embedded in JBoss - Logging?

2001-10-03 Thread Hunter Hillegas



-- Forwarded Message
From: Hunter Hillegas <[EMAIL PROTECTED]>
Date: Wed, 03 Oct 2001 14:47:40 -0700
To: Tomcat User List <[EMAIL PROTECTED]>
Subject: Tomcat 4 Embedded in JBoss - Logging?

I am trying to debug some taglibs that send log() messages when they do
certain things.

I am using Tomcat 4 bundled with JBoss 2.4.2 and I can't seem to figure out
where the log messages are going...

Anyone know?

Hunter

-- End of Forwarded Message


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



[JBoss-user] JBoss-Catalina 2.4.3 - server.xml file

2001-10-03 Thread Papo Napolitano

Hi,

I've installed the Jboss with Tomcat 4.0 and it doesn't work ok.
I start, and the server is up, but it seems that Tomcat doesn't read the
server.xml file from the conf directory.
If I start Tomcat alone it works fine.

Any idea ??

Regards,
Papo.



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



[JBoss-user] BASIC auth-method doesn't ask for credentials

2001-10-03 Thread nathan frund

Hi all,

I downloaded and installed JBoss-2.4.2_Tomcat-4.0 (on
RH Linux 7.1) and the JAAS howto examples.  When I run
the "command line" client via ant everything works
great but when I try to access the SecureServlet I'm
told through the browswer that access is denied
without it ever popping up a requester for
username/password.

When the SecureServlet is requested the following is
written to the shell/console:

[Default] Bad password for username=null


The following is written to the log:

[Default] Bad password for username=null
[JBossSecurityMgrRealm] User: null is NOT
authenticated
[JBossSecurityMgrRealm] User: null is NOT authorized,
requiredRoles=[Echo]

When I built the examples it wrote auth.conf to
$jboss.dist/jboss/tomcat/auth.conf so I moved it to
$jboss.dist/jboss/catalina/auth.conf

What the heck am I doing wrong? 

__
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com

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



Re: [JBoss-user] Jboss warning whenever i deploy.

2001-10-03 Thread Erin Mulder

Looks like he could easily avoid the warning by having his
ejbFindByPrimaryKey() throw FinderException instead of the
more specific ObjectNotFoundException.

Putting that aside, however, it seems that no warning should be
necessary when the home interface's throws clause contains a
superset of the implementation's.  Certainly, that is a very
reasonable interpretation of 9.2.8 based on the way Java
interfaces/implementations work.

(i.e. no compiler error/warning is issued when implementing
an interface with methods which throw more specific exceptions
than the interface requires, so long as the interface's throws
clause contains a superset)

Erin


- Original Message -
From: "Sacha Labourey" <[EMAIL PROTECTED]>
To: "John LYC" <[EMAIL PROTECTED]>; "Jboss Mailing List"
<[EMAIL PROTECTED]>
Sent: Wednesday, October 03, 2001 7:26 AM
Subject: RE: [JBoss-user] Jboss warning whenever i deploy.


> John,
>
> I guess the message is quite clear...
>
> > Section: 9.2.8
> > Warning: All the exceptions defined in the throws clause of an ejbFind
> > method of the entity bean class must be included in the throws
> > clause of the
> > matching find method of the home interface.
>
> Look at section 9.2.8 of the EJB 1.1 spec.
>
> in short: exception on finder methods of the bean must be present on
finder
> declaration of the home.
>
> Your bean finder declaration:
> > public String ejbFindByPrimaryKey(String key) throws
> > ObjectNotFoundException
>
> => ObjectNotFoundException may be thrown
>
> Your home declaration for this finder:
> > public Contact findByPrimaryKey(String primaryKey) throws
> > RemoteException, FinderException;
>
> Where is the ObjectNotFoundException declaration on this method
declaration
> of the home?
>
>
>
>
> Sacha
>
>
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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



RE: [JBoss-user] Jboss warning whenever i deploy.

2001-10-03 Thread Sacha Labourey

Hello Dimitri,

> I know its splitting hairs and all.. but shouldn't ejbFindByPK be allowed
> to only declare the ObjectNotFoundException?  I would think thats legal,
> as it is in normal inheritence (which is effectively what the verifier is
> trying to verify isn't it?)...

The spec says : "All the exceptions defined in the throws clause of an
ejbFind method of the entity bean class must be
included in the throws clause of the matching find method of the home
interface."

Thus, the spec does not seem to allow much place for "smooth" checking IMHO.
But, IMHO again, I cannot see why this shouldn't be allowed.

Currently, the verifier checks for exact exception signature. Pseudo-code:
"source.getClass() == destination.getClass()"

Cheers,



Sacha


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



RE: [JBoss-user] Jboss warning whenever i deploy.

2001-10-03 Thread Dmitri Colebatch

I know its splitting hairs and all.. but shouldn't ejbFindByPK be allowed
to only declare the ObjectNotFoundException?  I would think thats legal,
as it is in normal inheritence (which is effectively what the verifier is
trying to verify isn't it?)...

cheers
dim

On Wed, 3 Oct 2001, Sacha Labourey wrote:

> Oups... :( I missed it... Thank's Dimitri!
> 
> John, simply change the declaration of you bean method to:
> 
>   public String ejbFindByPrimaryKey(String key) throws FinderException
> 
> You will still be allowed to throw ObjectNotFoundException, but the verifier
> will no more complain.
> 
> The verifier verfies the exact class exception equality, not if they are
> "compatible" through inheritance.
> 
> Cheers,
> 
> 
> 
>   Sacha
> 
> 
> 
> 
> > -Message d'origine-
> > De : Dmitri Colebatch [mailto:[EMAIL PROTECTED]]
> > Envoye : mercredi, 3 octobre 2001 14:09
> > A : Sacha Labourey
> > Cc : John LYC; Jboss Mailing List
> > Objet : RE: [JBoss-user] Jboss warning whenever i deploy.
> >
> >
> > ObjectNotFoundException is a subclass of FinderException...
> >
> > On Wed, 3 Oct 2001, Sacha Labourey wrote:
> >
> > > John,
> > >
> > > I guess the message is quite clear...
> > >
> > > > Section: 9.2.8
> > > > Warning: All the exceptions defined in the throws clause of an ejbFind
> > > > method of the entity bean class must be included in the throws
> > > > clause of the
> > > > matching find method of the home interface.
> > >
> > > Look at section 9.2.8 of the EJB 1.1 spec.
> > >
> > > in short: exception on finder methods of the bean must be
> > present on finder
> > > declaration of the home.
> > >
> > > Your bean finder declaration:
> > >   > public String ejbFindByPrimaryKey(String key) throws
> > >   > ObjectNotFoundException
> > >
> > > => ObjectNotFoundException may be thrown
> > >
> > > Your home declaration for this finder:
> > >   > public Contact findByPrimaryKey(String primaryKey) throws
> > >   > RemoteException, FinderException;
> > >
> > > Where is the ObjectNotFoundException declaration on this method
> > declaration
> > > of the home?
> > >
> > >
> > >
> > >
> > >   Sacha
> > >
> > >
> > > ___
> > > JBoss-user mailing list
> > > [EMAIL PROTECTED]
> > > https://lists.sourceforge.net/lists/listinfo/jboss-user
> > >
> >
> >
> 
> 


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



RE: [JBoss-user] Jboss warning whenever i deploy.

2001-10-03 Thread Sacha Labourey

Oups... :( I missed it... Thank's Dimitri!

John, simply change the declaration of you bean method to:

public String ejbFindByPrimaryKey(String key) throws FinderException

You will still be allowed to throw ObjectNotFoundException, but the verifier
will no more complain.

The verifier verfies the exact class exception equality, not if they are
"compatible" through inheritance.

Cheers,



Sacha




> -Message d'origine-
> De : Dmitri Colebatch [mailto:[EMAIL PROTECTED]]
> Envoye : mercredi, 3 octobre 2001 14:09
> A : Sacha Labourey
> Cc : John LYC; Jboss Mailing List
> Objet : RE: [JBoss-user] Jboss warning whenever i deploy.
>
>
> ObjectNotFoundException is a subclass of FinderException...
>
> On Wed, 3 Oct 2001, Sacha Labourey wrote:
>
> > John,
> >
> > I guess the message is quite clear...
> >
> > > Section: 9.2.8
> > > Warning: All the exceptions defined in the throws clause of an ejbFind
> > > method of the entity bean class must be included in the throws
> > > clause of the
> > > matching find method of the home interface.
> >
> > Look at section 9.2.8 of the EJB 1.1 spec.
> >
> > in short: exception on finder methods of the bean must be
> present on finder
> > declaration of the home.
> >
> > Your bean finder declaration:
> > > public String ejbFindByPrimaryKey(String key) throws
> > > ObjectNotFoundException
> >
> > => ObjectNotFoundException may be thrown
> >
> > Your home declaration for this finder:
> > > public Contact findByPrimaryKey(String primaryKey) throws
> > > RemoteException, FinderException;
> >
> > Where is the ObjectNotFoundException declaration on this method
> declaration
> > of the home?
> >
> >
> >
> >
> > Sacha
> >
> >
> > ___
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> >
>
>


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



RE: [JBoss-user] Jboss warning whenever i deploy.

2001-10-03 Thread Dmitri Colebatch

ObjectNotFoundException is a subclass of FinderException...

On Wed, 3 Oct 2001, Sacha Labourey wrote:

> John,
> 
> I guess the message is quite clear...
> 
> > Section: 9.2.8
> > Warning: All the exceptions defined in the throws clause of an ejbFind
> > method of the entity bean class must be included in the throws
> > clause of the
> > matching find method of the home interface.
> 
> Look at section 9.2.8 of the EJB 1.1 spec.
> 
> in short: exception on finder methods of the bean must be present on finder
> declaration of the home.
> 
> Your bean finder declaration:
>   > public String ejbFindByPrimaryKey(String key) throws
>   > ObjectNotFoundException
> 
> => ObjectNotFoundException may be thrown
> 
> Your home declaration for this finder:
>   > public Contact findByPrimaryKey(String primaryKey) throws
>   > RemoteException, FinderException;
> 
> Where is the ObjectNotFoundException declaration on this method declaration
> of the home?
> 
> 
> 
> 
>   Sacha
> 
> 
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 


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



[JBoss-user] EJB 2.0 CMP SAMPLES

2001-10-03 Thread Simon Ng

I am new to  the CMP implementation of Jboss. Can anyone direct me a good
doc source and sample?




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



RE: [JBoss-user] Jboss warning whenever i deploy.

2001-10-03 Thread Sacha Labourey

John,

I guess the message is quite clear...

> Section: 9.2.8
> Warning: All the exceptions defined in the throws clause of an ejbFind
> method of the entity bean class must be included in the throws
> clause of the
> matching find method of the home interface.

Look at section 9.2.8 of the EJB 1.1 spec.

in short: exception on finder methods of the bean must be present on finder
declaration of the home.

Your bean finder declaration:
> public String ejbFindByPrimaryKey(String key) throws
> ObjectNotFoundException

=> ObjectNotFoundException may be thrown

Your home declaration for this finder:
> public Contact findByPrimaryKey(String primaryKey) throws
> RemoteException, FinderException;

Where is the ObjectNotFoundException declaration on this method declaration
of the home?




Sacha


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



[JBoss-user] Jboss warning whenever i deploy.

2001-10-03 Thread John LYC

Hi all,
when ever i deploy my ejb.jar files...

i get the following warning from jboss.. for every entity beans in my jar
file.
the entity beans are still working properly, i can call them and manipulate
the database.

here's the error msg
snip
[Verifier] ejb/entity/Contact: Verified.
[Verifier]
Bean   : ejb/entity/Country
Method : public abstract Country findByPrimaryKey(String) throws
RemoteException, FinderException
Section: 9.2.8
Warning: All the exceptions defined in the throws clause of an ejbFind
method of the entity bean class must be included in the throws clause of the
matching find method of the home interface.
--snip-

here's my home intereface
--snip--
public interface ContactHome extends EJBHome {
public Contact create(String contactOid, String name, String company,
String address1, String address2, String city, String state, String country,
String postal, String email, String phone, String fax, String id, String
accountNo) throws RemoteException, CreateException;
public Contact create(String contactOid) throws RemoteException,
CreateException;
public Contact findByPrimaryKey(String primaryKey) throws
RemoteException, FinderException;
public Collection findAll() throws RemoteException, FinderException;
}
-snip

here's my finder method...
---snip ---
public String ejbFindByPrimaryKey(String key) throws ObjectNotFoundException
{
Connection connection = null;
PreparedStatement statement = null;
try {
connection = dataSource.getConnection();
statement = connection.prepareStatement("SELECT CONTACT_OID FROM
dbo.CONTACT WHERE CONTACT_OID = ?");
statement.setString(1, key);
ResultSet resultSet = statement.executeQuery();
if (!resultSet.next()) {
throw new ObjectNotFoundException("Primary key does not
exist");
}
statement.close();
statement = null;
connection.close();

...
...
-snip--

please help me...
thank you all..
john


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