[JBoss-user] [EJB 3.0] - Re: Accessing an EJB from a Servlet

2006-04-17 Thread jllavina
Well, finally it works (using jboss-4.0.3SP1 and jboss-4.0.4.CR2 too)!!

Here is the code:

@Local
public interface EmployeeSessionLocal {
  ...
}


@Stateless ( name=Employee )
public class EmployeeSessionBean implements EmployeeSessionLocal {
  @Resource ( mappedName=java:/jdbc/OracleERPDS )
  private DataSource ds;
  ...
}


public class Controller extends HttpServlet {
  public void doGet( HttpServletRequest request, HttpServletResponse response ) 
throws ServletException, IOException {
InitialContext context = new InitialContext();
EmployeeSessionLocal session = (EmployeeSessionLocal) context.lookup( 
ysf/Employee/local );
...
  }
}


Thanks to everybody!!
José Luis.


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3937643#3937643

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3937643


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: Accessing an EJB from a Servlet

2006-04-12 Thread jllavina
My application is packaged using an EAR (ysf.ear), with a JAR (ysf.jar) and a 
WAR (ysf.war), and the JAR being deployed first.

The jmx-console doesn't show me the JNDI service, the only place where I found 
references to my application is here:

jboss.j2ee

  * ear=ysf.ear,jar=ysf.jar,name=Employee,service=EJB3
  * module=ysf.jar,service=EJB3
  * service=ClientDeployer
  * service=EARDeployer
  * service=EARDeployment,url='ysf.ear'

This is the log shown in the console window when the application is deployed:

08:55:07,441 INFO  [EARDeployer] Init J2EE application: 
file:/J:/jboss-4.0.3SP1/server/all/deploy/ysf.ear
08:55:07,882 INFO  [Ejb3AnnotationHandler] found EJB3: ejbName=Employee, 
class=es.dbs.ysf.employee.EmployeeSessionBean, type=STATELESS
08:55:07,892 INFO  [Ejb3Deployment] EJB3 deployment time took: 90
08:55:07,932 INFO  [JmxKernelAbstraction] installing MBean: 
jboss.j2ee:service=EJB3,ear=ysf.ear,jar=ysf.jar,name=Employee with dependencies:
08:55:08,533 INFO  [EJB3Deployer] Deployed: 
file:/J:/jboss-4.0.3SP1/server/all/tmp/deploy/tmp33605ysf.ear-contents/ysf.jar
08:55:08,543 INFO  [TomcatDeployer] deploy, ctxPath=/ysf, 
warUrl=.../tmp/deploy/tmp33605ysf.ear-contents/ysf-exp.war/
08:55:09,705 INFO  [EARDeployer] Started J2EE application: 
file:/J:/jboss-4.0.3SP1/server/all/deploy/ysf.ear

And this is part of my source code:

EmployeeSessionLocal.java

  @Local
  public interface EmployeeSessionLocal
 { ... }

EmployeeSessionBean.java

  @Stateless(name=Employee)
  public class EmployeeSessionBean implements EmployeeSessionLocal
  { ... }

Controller.java

  public class Controller extends HttpServlet {
public void doGet( ... ) throws ServletException, IOException
{
InitialContext context = new InitialContext();
EmployeeSessionLocal session = (EmployeeSessionLocal) 
context.lookup( Employee );
 ...
}
  }

Any idea?

Thanks!!
José Luis.



View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3936791#3936791

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3936791


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: Accessing an EJB from a Servlet

2006-04-12 Thread jllavina
Thank you echon for your suggestion, but it doesn't work.
(I have replaced the @Stateless(name=Employee) annotation with only 
@Stateless).

13:24:04,806 INFO  [STDOUT] javax.naming.NameNotFoundException: 
es.dbs.ysf.employee.EmployeeSessionLocal not bound
13:24:04,816 INFO  [STDOUT] at 
org.jnp.server.NamingServer.getBinding(NamingServer.java:514)
13:24:04,816 INFO  [STDOUT] at 
org.jnp.server.NamingServer.getBinding(NamingServer.java:522)
13:24:04,816 INFO  [STDOUT] at 
org.jnp.server.NamingServer.getObject(NamingServer.java:528)
13:24:04,816 INFO  [STDOUT] at 
org.jnp.server.NamingServer.lookup(NamingServer.java:281)
13:24:04,816 INFO  [STDOUT] at 
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
13:24:04,816 INFO  [STDOUT] at 
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
13:24:04,816 INFO  [STDOUT] at 
javax.naming.InitialContext.lookup(InitialContext.java:351)
13:24:04,816 INFO  [STDOUT] at 
es.dbs.ysf.employee.Controller.doGet(Controller.java:28)

Perhaps if I use a remote interface instead of a local one.. no, it doesn't 
work either.

Nobody has an example? Please?

Thanks!
José Luis.



View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3936851#3936851

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3936851


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: Accessing an EJB from a Servlet

2006-04-12 Thread jllavina
I have installed jboss-4.0.4.CR2 but the same problem persists.

I don't know why... it seems that the deployment works fine, but when I trying 
to access to the local EJB3 from my Servlet the JNDI doesn't find it... :(

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3936862#3936862

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3936862


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: Accessing an EJB from a Servlet

2006-04-12 Thread jllavina
Using this code it seems that the JNDI founds the EJB3 (but crash searching a 
resource, but this is another story...):

import org.jboss.annotation.ejb.LocalBinding;

@Stateless
@Local( { EmployeeSessionLocal.class } )
@LocalBinding( jndiBinding=Employee )

How can I define the jndiBinding without using a jboss especific class like 
'org.jboss.annotation.ejb.LocalBinding'?

Thanks!
José Luis.


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3936865#3936865

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3936865


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Accessing an EJB from a Servlet

2006-04-11 Thread jllavina
Hello,

I'm trying to access to an EJB (3.0, defined with annotations) from a Servlet, 
but the InitialContext doesn't contain the appropiate reference and I obtain a 
javax.naming.NameNotFoundException.

Is necessary to define the EJB also into web.xml or jboss-web.xml?
Is there an example of this anywhere?

Thanks!!
José Luis.


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3936576#3936576

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3936576


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user