SV: Newbie Q: Can't find bean?

2000-11-13 Thread Klaus . Myrseth

Ahh i forgot something very important for your web application using the
session/entity bean in question (web.xml)...

You have to define ejb-refs for the beans you want to use, or you will not
find the bean from the JSP...

Here is an example of an ejb-ref you can put in the bottom of your file.


  ejb/SomeEntity
  Entity
  com.something.ejb.entity.SomeEntityHome
  com.something.ejb.entity.SomeEntity


Klaus 

-Opprinnelig melding-
Fra: Sven van 't Veer [mailto:[EMAIL PROTECTED]]
Sendt: 13. november 2000 12:14
Til: Orion-Interest
Emne: Re: Newbie Q: Can't find bean?




"Sean P. McNamara" wrote:
> 
> 
> In addition to the specification, I have a copy of the
> Monson-Haefel book on Enterprise JavaBeans, but there is virtually no
> mention of JSP-EJB interaction.  I also spent some time earlier today
> browsing JSP-centric books in the local bookstore, and found little
> mention (usually about 1 paragraph) regarding EJB's.

I agree with you, it's hard to find information on that subject. I've
been reading this list and the sun J2EE interest for a couple of months
now and am almost ready doing my first complete EJB / JSP app.

The thing I found is as follows. It seems that by using a tag-lib you
can use your EJB directly in your jsp's, but the general opinion in this
list and others is that the way to do such things is by creating
'common' java beans or classes to use with the  tags in the
jsp. These classes than refrence stateful or stateless session beans,
which in turn reference the entity beans.

sven
-- 

==
Sven E. van 't Veer  
http://www.cachoeiro.net
Java Developer
[EMAIL PROTECTED]

==




Re: Newbie Q: Can't find bean?

2000-11-13 Thread Sven van 't Veer



"Sean P. McNamara" wrote:
> 
> 
> In addition to the specification, I have a copy of the
> Monson-Haefel book on Enterprise JavaBeans, but there is virtually no
> mention of JSP-EJB interaction.  I also spent some time earlier today
> browsing JSP-centric books in the local bookstore, and found little
> mention (usually about 1 paragraph) regarding EJB's.

I agree with you, it's hard to find information on that subject. I've
been reading this list and the sun J2EE interest for a couple of months
now and am almost ready doing my first complete EJB / JSP app.

The thing I found is as follows. It seems that by using a tag-lib you
can use your EJB directly in your jsp's, but the general opinion in this
list and others is that the way to do such things is by creating
'common' java beans or classes to use with the  tags in the
jsp. These classes than refrence stateful or stateless session beans,
which in turn reference the entity beans.

sven
-- 
==
Sven E. van 't Veer  
http://www.cachoeiro.net
Java Developer  [EMAIL PROTECTED]
==




SV: Newbie Q: Can't find bean?

2000-11-13 Thread Klaus . Myrseth

Here is an example of a bean lookup method:
private SomeEntityHome getSomeEntityHome()throws NamingException {
Context context = new InitialContext();
SomeEntityHome home = (SomeEntityHome)PortableRemoteObject.narrow(
context.lookup("java:comp/env/ejb/SomeEntity"),
SomeEntityHome.class);
return home;
}

This one should be usable :)

Then its ready to call findermethods and so on.For instance, to fine a
row in the database based on the pk:
try {
  SomeEntityHome home = getSomeEntityHome();
  SomeEntity remote = home.findByPrimaryKey(new SomeEntityPK(34));
catch (NamingException ne) {}

The JSP page can be coded just the same way as anything, only you dont have
to give any urls or providers and so on
to do it (if youre in the same vm/applicationserver) the ejb tag library i
mentioned earlier use this stuff inside the tag lib so the JSP code gets a
whole lot cleaner...

Klaus

-Opprinnelig melding-
Fra: Sean P. McNamara [mailto:[EMAIL PROTECTED]]
Sendt: 12. november 2000 01:15
Til: Orion-Interest
Emne: Re: Newbie Q: Can't find bean?



Thanks for your reply Robert, however I don't really feel it's fair
for you to have judged me ignorant of both Java and the J2EE in
general.  I've done quite a bit of development with session beans, but 
very little front-end (read JSP) development, and no EntityBean work,
as it wasn't supported by the EJB (1.0) containers we were working
with.

I've been through the JSP specification, and don't see anything in
there pertaining to how EJB are expected to be referenced.  There is
section 2.13 describing the  tag, and unfortunately
thought it would perhaps provide the needed functionality to automate
the bean lookup process.

In addition to the specification, I have a copy of the
Monson-Haefel book on Enterprise JavaBeans, but there is virtually no
mention of JSP-EJB interaction.  I also spent some time earlier today
browsing JSP-centric books in the local bookstore, and found little
mention (usually about 1 paragraph) regarding EJB's.

Obviously, using the same method that is used in a Servlet allows me
to do what I need to do.  I was simply looking for a way to skip that step.
I've seen some code posted to the list using tags in the 
namespace, but haven't located any documentation for that particular
taglib.  Perhaps you could be so good as to provide a link?

I'm in the process of downloading the Romans book, so perhaps that
will have the details I'm looking for.

Thanks for the pointer.

Robert Krueger writes:
 > At 14:25 11.11.00 , you wrote:
 > 
 > >OK... I've gotten something working by removing my use of the
 > >jsp:useBean tag, and instead grabbing the EntityBean home, and
 > >creating manually, which seems to work.
 > 
 > yes, bean != enterprise java bean. you will do yourself a BIG favour if
you 
 > read up on jsp, ejb and java in general as there are some fundamental 
 > basics missing. trial and error will not get you very far in J2EE. look
at 
 > the specs (they are actually rather readable) and maybe check out ed
romans 
 > ejb book (free download at www.theserverside.com).



-- 
Sean P. McNamara<[EMAIL PROTECTED]> 
SOMA Technologies, Inc. <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>




SV: Newbie Q: Can't find bean?

2000-11-13 Thread Klaus . Myrseth

You allso have the ejb tag library. It should be on the orion site
somewhere. then i think you can use ejb:useBean This one is used for
JNDI lookups and so on.

Good luck!

Klaus

-Opprinnelig melding-
Fra: Sean P. McNamara [mailto:[EMAIL PROTECTED]]
Sendt: 11. november 2000 18:00
Til: Orion-Interest
Emne: Newbie Q: Can't find bean?



Hi again-

Baby-steps, baby-steps I've finally gotten my application packaged 
properly, and my 2.0 CMP EntityBean to deploy properly, but am having
problems accessing the bean via JSP.  I've scanned the mailing lists,
but don't find anything related.  Hopefully someone can lend me a
clue.

I'm sure I'm doing something dumb here, but am not quite sure what.

Any pointers appreciated.


The error I receive is:

500 Internal Server Error

java.lang.InstantiationException: 
Could not find the bean named 'employee' in the page scope
at java.lang.Throwable.(Throwable.java:96)
at java.lang.Exception.(Exception.java:44)
at
java.lang.InstantiationException.(InstantiationException.java:46)
at
/EmployeeEntryAction.jsp._jspService(/EmployeeEntryAction.jsp.java:34)
at com.orionserver.http.OrionHttpJspPage.service(JAX)
at com.evermind.server.http.HttpApplication.xi(JAX)
at com.evermind.server.http.JSPServlet.service(JAX)
at com.evermind.server.http.d5.sv(JAX)
at com.evermind.server.http.d5.st(JAX)
at com.evermind.server.http.eh.s0(JAX)
at com.evermind.server.http.eh.do(JAX)
at com.evermind.util.f.run(JAX)


And the useBean segment from my JSP is:
---


-- 
Sean P. McNamara<[EMAIL PROTECTED]> 
SOMA Technologies, Inc. <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>




Re: Newbie Q: Can't find bean?

2000-11-12 Thread Aniket V U

hi sean,

take a look at the EJB tag library available with orion. its exactly what 
you are looking for.

The URL is http://www.orionserver.com/tags/ejbtags/

regards
Aniket


At 05:44 AM 11/12/2000, you wrote:

>Thanks for your reply Robert, however I don't really feel it's fair
>for you to have judged me ignorant of both Java and the J2EE in
>general.  I've done quite a bit of development with session beans, but
>very little front-end (read JSP) development, and no EntityBean work,
>as it wasn't supported by the EJB (1.0) containers we were working
>with.
>
>I've been through the JSP specification, and don't see anything in
>there pertaining to how EJB are expected to be referenced.  There is
>section 2.13 describing the  tag, and unfortunately
>thought it would perhaps provide the needed functionality to automate
>the bean lookup process.
>
>In addition to the specification, I have a copy of the
>Monson-Haefel book on Enterprise JavaBeans, but there is virtually no
>mention of JSP-EJB interaction.  I also spent some time earlier today
>browsing JSP-centric books in the local bookstore, and found little
>mention (usually about 1 paragraph) regarding EJB's.
>
>Obviously, using the same method that is used in a Servlet allows me
>to do what I need to do.  I was simply looking for a way to skip that step.
>I've seen some code posted to the list using tags in the 
>namespace, but haven't located any documentation for that particular
>taglib.  Perhaps you could be so good as to provide a link?
>
>I'm in the process of downloading the Romans book, so perhaps that
>will have the details I'm looking for.
>
>Thanks for the pointer.

--
Aniket Upganlawar
CTO
Office : +91-22-6559920
Mobile : 9820215601
--
Verchaska - Helping your business succeed
--






Re: Newbie Q: Can't find bean?

2000-11-12 Thread Robert Krueger

At 18:14 11.11.00 , you wrote:

>Thanks for your reply Robert, however I don't really feel it's fair
>for you to have judged me ignorant of both Java and the J2EE in

I apologize if I offended you with my statement. that was not my intention 
and I didn't judge you ignorant of anything and didn't mean to. it's just 
that so many questions on this list (which is meant to be a vendor-specific 
forum) are due to a lack of understanding of general J2EE issues of the 
posters (I admit, it's sometimes hard to differentiate and it is a complex 
topic). your misconception about the useBean tag is of rather fundamental 
nature and my comment was really motivated by reading posts of many people 
who have a hard time getting a complex product like orion to work properly 
because they lack the necessary J2EE background and who wouldn't have a 
fraction of the problems with orion-specific issues if they had read up on 
the J2EE basics. if you feel the tone of my mail was inappropriate, I do 
apologize again.

regards,

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





Re: Newbie Q: Can't find bean?

2000-11-11 Thread Sean P. McNamara


Thanks for your reply Robert, however I don't really feel it's fair
for you to have judged me ignorant of both Java and the J2EE in
general.  I've done quite a bit of development with session beans, but 
very little front-end (read JSP) development, and no EntityBean work,
as it wasn't supported by the EJB (1.0) containers we were working
with.

I've been through the JSP specification, and don't see anything in
there pertaining to how EJB are expected to be referenced.  There is
section 2.13 describing the  tag, and unfortunately
thought it would perhaps provide the needed functionality to automate
the bean lookup process.

In addition to the specification, I have a copy of the
Monson-Haefel book on Enterprise JavaBeans, but there is virtually no
mention of JSP-EJB interaction.  I also spent some time earlier today
browsing JSP-centric books in the local bookstore, and found little
mention (usually about 1 paragraph) regarding EJB's.

Obviously, using the same method that is used in a Servlet allows me
to do what I need to do.  I was simply looking for a way to skip that step.
I've seen some code posted to the list using tags in the 
namespace, but haven't located any documentation for that particular
taglib.  Perhaps you could be so good as to provide a link?

I'm in the process of downloading the Romans book, so perhaps that
will have the details I'm looking for.

Thanks for the pointer.

Robert Krueger writes:
 > At 14:25 11.11.00 , you wrote:
 > 
 > >OK... I've gotten something working by removing my use of the
 > >jsp:useBean tag, and instead grabbing the EntityBean home, and
 > >creating manually, which seems to work.
 > 
 > yes, bean != enterprise java bean. you will do yourself a BIG favour if you 
 > read up on jsp, ejb and java in general as there are some fundamental 
 > basics missing. trial and error will not get you very far in J2EE. look at 
 > the specs (they are actually rather readable) and maybe check out ed romans 
 > ejb book (free download at www.theserverside.com).



-- 
Sean P. McNamara<[EMAIL PROTECTED]> 
SOMA Technologies, Inc. <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>




Re: Newbie Q: Can't find bean?

2000-11-11 Thread Robert Krueger

At 14:25 11.11.00 , you wrote:

>OK... I've gotten something working by removing my use of the
>jsp:useBean tag, and instead grabbing the EntityBean home, and
>creating manually, which seems to work.

yes, bean != enterprise java bean. you will do yourself a BIG favour if you 
read up on jsp, ejb and java in general as there are some fundamental 
basics missing. trial and error will not get you very far in J2EE. look at 
the specs (they are actually rather readable) and maybe check out ed romans 
ejb book (free download at www.theserverside.com).

regards,

robert

>Is it improper to use the  tag to work with entityBeans?
>Is this something that I should be using another Taglib for?
>
>I apologize for the basic-nature of this question, but I haven't done
>much work with EntityBeans, and even the O'reilly EJB book doesn't
>seem to provide much detail on the subject.
>
>
>Thanks!
>
>Sean P. McNamara writes:
>  >
>  > Hi again-
>  >
>  > Baby-steps, baby-steps I've finally gotten my application packaged
>  > properly, and my 2.0 CMP EntityBean to deploy properly, but am having
>  > problems accessing the bean via JSP.  I've scanned the mailing lists,
>  > but don't find anything related.  Hopefully someone can lend me a
>  > clue.
>
>
>--
>Sean P. McNamara<[EMAIL PROTECTED]>
>SOMA Technologies, Inc. <[EMAIL PROTECTED]>
> <[EMAIL PROTECTED]>
> <[EMAIL PROTECTED]>

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





Newbie Q: Can't find bean?

2000-11-11 Thread Sean P. McNamara


OK... I've gotten something working by removing my use of the
jsp:useBean tag, and instead grabbing the EntityBean home, and
creating manually, which seems to work.

Is it improper to use the  tag to work with entityBeans?
Is this something that I should be using another Taglib for?

I apologize for the basic-nature of this question, but I haven't done
much work with EntityBeans, and even the O'reilly EJB book doesn't
seem to provide much detail on the subject.


Thanks!

Sean P. McNamara writes:
 > 
 > Hi again-
 > 
 > Baby-steps, baby-steps I've finally gotten my application packaged 
 > properly, and my 2.0 CMP EntityBean to deploy properly, but am having
 > problems accessing the bean via JSP.  I've scanned the mailing lists,
 > but don't find anything related.  Hopefully someone can lend me a
 > clue.


-- 
Sean P. McNamara<[EMAIL PROTECTED]> 
SOMA Technologies, Inc. <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>




Newbie Q: Can't find bean?

2000-11-11 Thread Sean P. McNamara


Hi again-

Baby-steps, baby-steps I've finally gotten my application packaged 
properly, and my 2.0 CMP EntityBean to deploy properly, but am having
problems accessing the bean via JSP.  I've scanned the mailing lists,
but don't find anything related.  Hopefully someone can lend me a
clue.

I'm sure I'm doing something dumb here, but am not quite sure what.

Any pointers appreciated.


The error I receive is:

500 Internal Server Error

java.lang.InstantiationException: 
Could not find the bean named 'employee' in the page scope
at java.lang.Throwable.(Throwable.java:96)
at java.lang.Exception.(Exception.java:44)
at java.lang.InstantiationException.(InstantiationException.java:46)
at /EmployeeEntryAction.jsp._jspService(/EmployeeEntryAction.jsp.java:34)
at com.orionserver.http.OrionHttpJspPage.service(JAX)
at com.evermind.server.http.HttpApplication.xi(JAX)
at com.evermind.server.http.JSPServlet.service(JAX)
at com.evermind.server.http.d5.sv(JAX)
at com.evermind.server.http.d5.st(JAX)
at com.evermind.server.http.eh.s0(JAX)
at com.evermind.server.http.eh.do(JAX)
at com.evermind.util.f.run(JAX)


And the useBean segment from my JSP is:
---


-- 
Sean P. McNamara<[EMAIL PROTECTED]> 
SOMA Technologies, Inc. <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>