• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Problem deploying hello world JBOSS app

 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am very new to EE and I am having problems deploying a hello world type app on a JBOSS server.

Do I use a jboss.xml file or an ejb-jar.xml file and/or do I need to modify the web.xml file?

I have tried all three but whenver I add a jboss.xml file or ejb-jar.xml and I deploy whe I go to the page I get the following:

HTTP Status 404 - /T1Web/

type Status report

message /T1Web/

description The requested resource (/T1Web/) is not available.


--------------------------------------------------------------------------------

JBossWeb/2.0.1.GA
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Billy,

Welcome to JavaRanch

Do I use a jboss.xml file or an ejb-jar.xml file



The ejb-jar.xml is a standard EJB deployment descriptor file, which is mandatory for EJB2.x. This file contains information about EJBs contained in the application. The jboss.xml is an optional server specific file. This usually has server specific configurations - for example the jndi names for your beans.

do I need to modify the web.xml file?



The web.xml is a standard file for web application (.WAR files). This file is independent of the EJB jar file and the EJB descriptor files. This web.xml has information about the servlets and other web application related artifacts.

and I deploy whe I go to the page I get the following:



How did you package and deploy the application? Is it an EAR file (consisting of the EJB jar file and WAR file)? Or is it a WAR file?
 
Bobby Anderson
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure if I deployed in an EAR or a WAR. I am running in eclipse, how do I tell.

I have an EAR which has my two modules in it, my EJB, and my WAR. My EJB has oine remote bean which is EJB 3.0. And my WAR has on servlet derived form HTTPServlet.

My main problem has been that I have not been able to inject my EJB into my servlet. SO when I run I get a null pointer exception in the servlet for the EJB. So I thought maybe that was becuase I needed to modify one of the deployment files.

Sorry again I am very new and very confused, thanks so much for your help.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Billy Newman:
I am not sure if I deployed in an EAR or a WAR. I am running in eclipse, how do I tell.



Honestly, i don't use any IDE for deploying applications. I do use them for coding. One of the reason i avoid additional tools/IDE for such tasks is that when you run into errors, you are not sure whether its because of the tool or because some problem in your application. Also, leaving these tools out, helps you understand how actually an application needs to be deployed.

Originally posted by Billy Newman:
I have an EAR which has my two modules in it, my EJB, and my WAR. My EJB has oine remote bean which is EJB 3.0. And my WAR has on servlet derived form HTTPServlet.



That gives us an good idea about what your application is composed of

Originally posted by Billy Newman:
My main problem has been that I have not been able to inject my EJB into my servlet. SO when I run I get a null pointer exception in the servlet for the EJB. So I thought maybe that was becuase I needed to modify one of the deployment files.



Which version of JBoss are you using? JBoss-4.x does not support EJB injection in servlets. If you are using JBoss-4.x, you need to do a lookup of the beans in the servlets.

Originally posted by Billy Newman:
Sorry again I am very new and very confused



Don't worry, ranchers here will be glad to help you get started
 
Bobby Anderson
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So what are the steps to access my EJB within my servlet in JBOSS 4.x? I tried things like the deployement descriptors above but had little success. I am having a very hard time trying to find a working tutorial online for JBOSS 4.x.

Thanks again!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic