[EJB 3.0] - Re: Deploying a simple HelloWorld EJB3 under JBoss
by balde
I re-installed JBoss 4.0.5 with the installer and option EJB3. I'm getting the error:
javax.naming.NameNotFoundException: org.os.ejb3.Hello not bound
Seams like the reflection lookup doesn't work like it should be for EJB3.
- my Interface:
package org.os.ejb3;
| public interface Hello {
| public String hello();
| }
|
- My Bean:
package org.os.ejb3;
|
| import javax.ejb.Remote;
| import javax.ejb.Stateless;
|
|
| @Stateless
| @Remote(Hello.class)
| public class HelloBean implements Hello {
|
| public String hello() {
| return "Hi there this is JBoss server side";
| }
|
| }
|
-my deployment descriptor:
<?xml version="1.0" encoding="UTF-8"?>
| <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/ejb-jar_3_0.xsd"
| version="3.0">
|
| <enterprise-beans>
| </enterprise-beans>
|
| </ejb-jar>
- my client:
package org.os.ejb3;
|
| import javax.naming.Context;
| import javax.naming.InitialContext;
| import javax.naming.NamingException;
|
| public class HelloClient {
|
| /**
| * @param args
| */
| public static void main(String[] args) {
| System.out.println("STARTING HelloClient ... ");
|
| try {
| Context ctx = new InitialContext();
|
| Hello h = (Hello)ctx.lookup("org.os.ejb3.Hello");
| String s = h.hello();
|
| System.out.println("HelloClient -- received from server > " + s);
|
| } catch (NamingException e) {
| e.printStackTrace();
| }
|
| }
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033243#4033243
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033243
17Â years, 9Â months
[Remoting] - MasterServerSocket with VirtualServerSocket
by lukaszm
Hi,
I have a problem with use of multiplexing sockets API. I have an application which consists of many clients connected server to a server by TCP. The application uses a third-party library which creates far too many TCP connections. I can't change the library, but I can change socket factories which are used by the library.
My idea is to have one physical Socket and many VirtualSockets on the client side, and VirtualServerSocket somehow bound to MasterServerSocket on the server side. I don't need any VirtualSockets from server connecting to VirtualServerSockets on the client side. I tried to adapt Symmetric Scenario for my needs but I don't understand two things.
- Do I have to create VirtualServerSocket on the client side although I don't need any "callbacks", i.e. VirtualSockets on the server connecting explicitly to clients?
- How to allow multiple physical clients to connect to one MasterServerSocket?
MasterServerSocket has the acceptServerSocketConnection() method. But it returns only server port, so how could I create newly created VirtualServerSocket with the concrete client bound. Or is it possible to have one VirtualServerSocket accepting connections from many physical connections?
Thanks in advance
Lukasz
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033240#4033240
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033240
17Â years, 9Â months