This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes Helloworld using Jboss7 and ejb3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Helloworld using Jboss7 and ejb3" Watch "Helloworld using Jboss7 and ejb3" New topic
Author

Helloworld using Jboss7 and ejb3

Vinit Parakh
Greenhorn

Joined: Oct 20, 2011
Posts: 21
Hi,

I am trying to implement a basic hello world code using jboss 7.0.2 and ejb. I have implemented the same code in Jboss 4.2 and it worked perfectly fine.But now here in jboss 7,the directory structure completely being changed..i am confused. I have written a basic code for printing hello world...but i am getting an error saying that : "java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory "...i tried googling it..and found that jnpclient.jar and jnpserver.jar file should be included in the classpath from the jboss directory....but however i didnt find those jars in the jboss 7.0.2 folder. I dont know what is to be done...I tried one thing...I downloaded the two jar files from the net and copied them to my classpath..but now I am getting a new error :

javax.naming.CommunicationException: Could not obtain connection to any of these urls: 127.0.0.1:1099 and
discovery failed with error: javax.naming.CommunicationException: IP_ADD_MEMBERSHIP failed (out of hardware filters?) [Root exception is java.net.SocketException: IP_ADD_MEMBERSHIP failed (out of hardware filters?)] [Root exception is javax.naming.CommunicationException: Failed to connect to server 127.0.0.1:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]


I am newbie to this but i want to implement things in jboss 7. Any help appreciated...

Thankyou in Advance,
Vectors.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9924
    
158

Remote invocation for EJBs isn't available in AS 7.0.2. It will be there in the upcoming version.

However, you can invoke the EJBs in the same server VM as where they are deployed. The getting started documentation has some quick start guides to get you started https://docs.jboss.org/author/display/AS7/Documentation


[My Blog] [JavaRanch Journal]
Vinit Parakh
Greenhorn

Joined: Oct 20, 2011
Posts: 21
Thanks Jaikiran for your reply,

But i just want to ask that even if i use local interface i will need to connect to localhost:1099....but that is what is not happening....What exactly is missing???...Can you tell me from the error i had posted earlier....I mean do i have to make certain changes to the system files of jboss 7.0.2 get access to that port??

Thanks in advance,
Vectors
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9924
    
158

Vinit Parakh wrote:Thanks Jaikiran for your reply,

But i just want to ask that even if i use local interface i will need to connect to localhost:1099....but that is what is not happening....What exactly is missing???...


No, for local interfaces you won't be using that because, local by definition are in the same VM as the server. So there's no need to use the IP/port. If you do want to use JNDI lookup (instead of injection) of local interface within the same JVM as the server, then see this http://community.jboss.org/message/615486#615486

I mean do i have to make certain changes to the system files of jboss 7.0.2 get access to that port??


That port is not available in AS7, so there's no configuration to enable it.
Vinit Parakh
Greenhorn

Joined: Oct 20, 2011
Posts: 21
Thanks a lot jaikiran for your help....

Now i have been successfully able to implement a basic hello world servlet using ejb injection in jboss 7....cheers...
Pablo Srabstein
Greenhorn

Joined: Jul 11, 2012
Posts: 2
Vinit Parakh wrote:Thanks a lot jaikiran for your help....

Now i have been successfully able to implement a basic hello world servlet using ejb injection in jboss 7....cheers...


Can you please share the "working" tutorial you have used?

Thanks,
Pablo.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9924
    
158

There are a lot of quickstarts available officially for AS7 here http://www.jboss.org/jdf/quickstarts/get-started/
Pablo Srabstein
Greenhorn

Joined: Jul 11, 2012
Posts: 2
Pablo Srabstein wrote:
Vinit Parakh wrote:Thanks a lot jaikiran for your help....

Now i have been successfully able to implement a basic hello world servlet using ejb injection in jboss 7....cheers...


Can you please share the "working" tutorial you have used?

Thanks,
Pablo.


Actually i should have mention i am looking for an HellowWorld Jboss7 working tutorial in eclipse (either Juno or Indigo) i found several but none of them working smoothly.

Thanks,
Pablo.
 
wood burning stoves
 
subject: Helloworld using Jboss7 and ejb3
 
Similar Threads
JBOSS SocketException PermissionDenied
Problem with using Jboss
Locating Remote Session Bean Using JNDI--JNDI-Root Error Socket Timeout Jboss.5.1.GA
SocketTimeoutException when doing JNDI lookup
javax.naming.CommunicationException