> 
> Daniel
> Fantastic! Great Thanks, that was it (war MANIFEST.MF + client.jar)! Jboss
> is cool!
> My jboss_jetty servlet now talks with EJB. After three days of my strugle,
> your latest instructions made it a breeze.
> I am puzzled with just couple of more points:
> - Bean class(es) does not have to be included in client.jar, which is great,
> as logic can be changed without its redeployment at servlet container.
> However, I am curious why BOTH remote _and_ HOME interface(s) are required
> in client.jar, not only remote one?! If only remote interface(s) is
> included, servlet
> cannot be initiated (404 http error).

Dont you get your bean reference (the represented by the Remote
interface) through a find or create call on the Home interface?! ;-)

> - interestInstance.getInterestInfo() returns exact custom string, as
> specified in bean.
> However, why servlet EJB call: interestInstance.getClass().getName() returns
> (always)
> "$Proxy3" as an EJB class name, not "Interest" ?!

This is part of the sophisticated architecture of jBoss. :-)
The Interest object lives in the container (thats what the container is
made for) so on the client side you only have a proxy which represents
the real object in the container. jBoss creates this proxies transparent
for the user.

So you get a proxy class which implements the Remote interface of your
Interest bean. If you need this method on the client side, add it to the
Remote interface.

> 
> Thanks again and best regards. Miomir
> 
> -----Original Message-----
> From: Daniel Schulze [mailto:[EMAIL PROTECTED]]
> Sent: Monday, November 27, 2000 10:08 AM
> To: jBoss
> Subject: Re: [jBoss-User] HELP: EJB resolve by servlet
> 
> Hi,
> 
> > Could you please clarify a little bit your text:
> > <in the web archives manifest/Classpath section.>
> > from your mail answer
> > >In case of .ear file you must reference the package with the remote
> > >interfaces (wether the ejb package itself -> ugly; or a separate package
> > >containing the Remote stuff, which you use for yor app client too ->
> > >clean, good) in the web archives manifest/Classpath section.
> 
> The key is the MANIFEST.MF file of the .war file.
> Your .war file needs classes from an other package (the one with your
> beans or better the one with only the remote stuff for your beans). So
> you create a MANIFEST.MF file for your war file (if you dont have
> already) and you add a line like this:
> Class-Path: ./myBeanRemoteStuff.jar
> 
> where myBeanRemoteStuff.jar is the name of the jar file containing the
> needed classes _and_ is contained in the root directory of your .ear
> file.
> (unjar the tomcat-test.ear/tomcat-test.war and have a look at the
> MANIFEST.MF file there!)
> 
> Then recreate your .ear file and deploy.
> You should get a log line like this:
> 
> ...
> [J2EE Deployer] Added ./myBeanRemoteStuff.jar to common
> classpath
> 
> ...
> 
> HTH
> 
> \Daniel
> 
> >
> > Do I need to change anything in conf directory, or to add something to
> > Manifest.mf which is the part of ear file? I didn't change any jboss or
> > jetty settings, and using all default.
> >
> > I just created application files (based on downloaded jboss example for
> > tomcat and
> > your explainations in mentioned link) outside of jboss_jetty directory and
> > copied
> > ear file into deploy dir.
> > Changing system CLASSPATH (before starting server), to include, ejb jar
> did
> > not help
> > (servlet itself could not be resolved then).
> >
> > Servlet call which fails (same work fine in standalone java) is:
> > boundObject = context.lookup("InterestApp");
> >
> > Below are my config files.
> > Could you please give me a clue to what is wrong here. Thanks heaps.
> Miomir
> >
> > application.xml
> > <?xml version="1.0"?>
> > <application>
> >    <display-name>Hello (Sample Application)</display-name>
> >    <module>
> >       <ejb>Interest-ejb.jar</ejb>
> >    </module>
> >    <module>
> >       <web>
> >          <web-uri>Interest-web.war</web-uri>
> >          <context-root>/servlets</context-root>
> >       </web>
> >    </module>
> > </application>
> >
> > web.xml
> > <?xml version="1.0"?>
> > <web-app>
> >    <display-name>Interest Application</display-name>
> >    <servlet>
> >       <servlet-name>com.web_tomorrow.InterestServlet</servlet-name>
> >       <description>Servlet that calls the Hello bean</description>
> >       <servlet-class>com.web_tomorrow.InterestServlet</servlet-class>
> >    </servlet>
> >    <servlet-mapping>
> >       <servlet-name>com.web_tomorrow.InterestServlet</servlet-name>
> >       <url-pattern>/</url-pattern>
> >    </servlet-mapping>
> > </web-app>
> >
> > <?xml version="1.0"?>
> > <ejb-jar>
> >    <description>Interest Application</description>
> >    <display-name>Interest Application</display-name>
> >    <enterprise-beans>
> >       <session>
> >          <ejb-name>InterestApp</ejb-name>
> >          <home>com.web_tomorrow.InterestHome</home>
> >          <remote>com.web_tomorrow.Interest</remote>
> >          <ejb-class>com.web_tomorrow.InterestoBean</ejb-class>
> >          <session-type>Stateless</session-type>
> >          <transaction-type>Container</transaction-type>
> >       </session>
> >    </enterprise-beans>
> > </ejb-jar>
> >
> > -----Original Message-----
> > From: Daniel Schulze [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, November 27, 2000 9:04 AM
> > To: jBoss
> > Subject: Re: [jBoss-User] HELP: EJB resolve by servlet
> >
> > Hi,
> >
> > Seems the ServletContainer doesnt have the Home/Remote interfaces of
> > your beans in its classpath.
> >
> > Do you use an ear file for your app or do you deploy your ejb package
> > separate from the web package?
> >
> > In case of .ear file you must reference the package with the remote
> > interfaces (wether the ejb package itself -> ugly; or a separate package
> > containing the Remote stuff, which you use for yor app client too ->
> > clean, good) in the web archives manifest/Classpath section.
> >
> > Did you read the Deployment howto at:
> > http://www.jboss.org/documentation/J2eeDeployment_howto.html
> >
> > In case of separate deployed packages you need the remote classes in
> > your web archive (WEB-INF/lib or WEB-INF/classes) but in this case you
> > can not make use of the optimized inVM method invocation.
> >
> > HTH
> >
> > \Daniel
> >
> > [EMAIL PROTECTED] wrote:
> > >
> > > Hello
> > > New jboss_jetty server is really great (servlets, JSP work perfectly and
> > > FAST), but I have
> > > problems with servlet-ejb communication.
> > >
> > > I am using Interest EJB (downloaded with manual and slightly modified
> for
> > > jboss_jetty), and it
> > > works  fine with standalone java app, when accessed via servlet (same
> > code),
> > > always gives me
> > > a following exception:
> > > [Jetty] Unable to get reference to Interest Interface:
> > > javax.naming.CommunicationException
> > > [Root exception is java.lang.ClassNotFoundException:
> > > com.web_tomorrow.interest.InterestHome]
> > >
> > > Please, is there any downloadable example or pointer how to make the
> > > jboss_jetty
> > > servlet resolve the EJB components, specified via its JAR in the EAR
> > (which
> > > also contains WAR) file in a standard way (without  having unpacked
> > classes,
> > > as in jboss
> > > manual)
> > > I found jboss_tomcat example but it is very tomcat specific as it
> require
> > > editing of
> > > classpath for tomcat.bat. Also, specifying ejb jar file in classpath,
> > before
> > > starting server,
> > > does not work for me (jboss-jetty servlet itself could not be resolved
> > > then).
> > >
> > > I tried lot of things without success. Please help! Thanks. Miomir
> > >
> > > --
> > > --------------------------------------------------------------
> > > To subscribe:        [EMAIL PROTECTED]
> > > To unsubscribe:      [EMAIL PROTECTED]
> > > Problems?:           [EMAIL PROTECTED]
> >
> > --
> > --------------------------------------------------------------
> > To subscribe:        [EMAIL PROTECTED]
> > To unsubscribe:      [EMAIL PROTECTED]
> > Problems?:           [EMAIL PROTECTED]
> >
> > --
> > --------------------------------------------------------------
> > To subscribe:        [EMAIL PROTECTED]
> > To unsubscribe:      [EMAIL PROTECTED]
> > Problems?:           [EMAIL PROTECTED]
> 
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Problems?:           [EMAIL PROTECTED]
> 
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Problems?:           [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to