Link to home
Start Free TrialLog in
Avatar of Muhammad Khan
Muhammad KhanFlag for Canada

asked on

How to use JBoss?

I have Jboss installed on ma system.. i have started it using run.bat.. it prints a trillion lines on the Command prompt and then waits for something.. following are the last lines

) DOMSource node as this type not supported.]
14:26:22,289 INFO  [URLDeploymentScanner] Started
14:26:22,289 INFO  [MainDeployer] Deployed package: file:/C:/jboss-3.0.4_tomcat-
4.1.12/server/default/conf/jboss-service.xml
14:26:22,289 INFO  [Server] JBoss (MX MicroKernel) [3.0.4 Date:200211021607] Started in 1m:37s:861ms


nd now... i want to know. what to do next? how to check if JBoss is running or not. n how to deploy my EJB with it.. after deploying how to access those beans.. i have been searching for it for 5 hours.. n all gone in vein.. plz help me..
Avatar of girionis
girionis
Flag of Greece image

If you don't get any error message then JBoss is probably up and running. For all the other info look at the documentation that comes with JBoss.
go to :

http://localhost:8080/jmx-console

the you will see if it is running :-)

Looks like it is, so you need to drop your EJB jar file into server/default/deploy
Avatar of Muhammad Khan

ASKER

I tried the link but it is not working... what does that mean?
How can i see what error JBoss is giving? caz i mentioned earlier that it is printing some trillion lines. then looks like stopped to take breathe...
It probably means that JBoss is not running.
Try restarting it. Also make sur that you access the console by providng the HTTP port (8080).
> that it is printing some trillion lines.

It prints about 600 - 1200 lines, look through them for an error ;-)

It is in

jboss/server/default/logs/server.log
Avatar of valipotor
valipotor

Here is sample code to access a session bean named SessionBean1 which has a method named testMethod().
Before running this code the bean must be deployed in jboss.

1099 is JBoss default port.

 Hashtable environment = new Hashtable();

 environment.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
 environment.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
 environment.put(Context.PROVIDER_URL, "jnp://localhost:1099");
 Context context=new InitialContext(environment);

 //look up jndi name
 Object ref = context.lookup("SessionBean1");
 //look up jndi name and cast to Home interface
  SeesionBean1Home home = (SessionBean1Home) PortableRemoteObject.narrow(ref, SessionBean1Home.class);
  SessionBean1 bean = home.create();
  bean.testMethod();

Of course you have to catch the exceptions, and import some classes.

 valipotor

If the link doesn't work it means that JBoss isn't running. If there is an exception while loading the page, JBoss will generate a error page with the stack trace of the exception.

valipotor
I have mentioned that JBoss window is paused after printing all the lines(seems to load all the ejbs in server/deploy) now the last lines are.

 Depends On Me: javax.xml.transform.TransformerException: XSL-1101: (Fatal Error
) DOMSource node as this type not supported.]
09:19:17,485 INFO  [URLDeploymentScanner] Started
09:19:17,485 INFO  [MainDeployer] Deployed package: file:/C:/jboss-3.0.4_tomcat-
4.1.12/server/default/conf/jboss-service.xml
09:19:17,485 INFO  [Server] JBoss (MX MicroKernel) [3.0.4 Date:200211021607] Sta
rted in 1m:16s:509ms

any1 tell me what do these line suggest? JBoss is running or not?
As far as I can tell they suggest it running. It says JBoss started.
Yes. jboss is running. But some part of it it's not running.
If you want more info post the entire description of the error, not just the last lines

>>> Depends On Me: javax.xml.transform.TransformerException: XSL-1101: (Fatal Error
>>> ) DOMSource node as this type not supported.]

I think some module or maybe your jar containing Ejb's is unable to read an xml file.
u mean i post the whole server.log? :o
not the whole server log, just the part with the exeception

this is how the log should look, each line starting with time stamp

>>09:19:17,485 INFO  [URLDeploymentScanner] Started
>>09:19:17,485 INFO  [MainDeployer] Deployed package: file:/C:/jboss-3.0.4_tomcat-
>>4.1.12/server/default/conf/jboss-service.xml
>>09:19:17,485 INFO  [Server] JBoss (MX MicroKernel) [3.0.4 Date:200211021607] Sta
rted in 1m:16s:509ms

so the exception output should be easy to recognize
Yuppiiiiiiiiii...
i again.. figured out the problem myself.. :)
it was a problemo with default Configuration set .. i started JBoss like

run.bat -c all

and now it doesn't print trillion lines.. just a million or two.. :) and now the above link is working...
Now i m thinking what to do with this Question
that means you are running it under a different configuration...

there are 3 configurations, "all", "default", and "minimal"

It is strange that "default" wasn't working for you...  what had you changed?

Now you are running the "all" configuration, you need to deploy your EJB jar (or EAR) -- and your libraries you use to

    jboss/server/all/deploy
    jboss/server/all/lib

respectivley, instead of

    jboss/server/default/deploy
    jboss/server/default/lib
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial