View RSS Feed

JBoss

JBoss Application Server

  1. JBossWS

    by , 11-06-2011 at 05:47 PM (My Java Tips)
    JBoss used to have JBoss.NET package for web services. Now, there exists JBossWS module which is responsible for providing web services in JBoss 4.0.


    It is based on Apache Axis like JBoss.NET but the difference is that JBossWS provides the complete set of J2EE 1.4 web services technologies like SOAP, SAAJ, JAX-RPC and JAXR. The J2EE web services support exposing EJBs as web services, but only stateless session beans can be used.

    JBossWS is a JAX-WS compliant web service ...
    Categories
    JBoss
  2. JBoss directory structure

    by , 11-06-2011 at 05:45 PM (My Java Tips)
    You should be knowing the directory structure of JBoss server, in order to work efficiently with JBoss. I will target the directory structure in this post.


    The jboss-4.0.2 directory contains following sub-directories:

    Bin
    Contains startup and shutdown scripts.

    Client
    Client folder contains configuration and JAR files that are required by Java client application or an external web container.

    Docs
    The XML DTDs used in ...
    Categories
    JBoss
  3. JBoss Web Container

    by , 11-06-2011 at 05:27 PM (My Java Tips)
    I assume you are familiar with Tomcat. Normally developers start learning J2EE with Servlet and JSP and deploy them on Tomcat. JBoss now comes with Tomcat 5.5 and is used as default web container.


    The embedded Tomcat service is the expanded SAR jbossweb-tomcat55.sar in the deploy directory. All the required JARs also exist there. The file web.xml provides default configuration set for web applications. server.xml, which contains standard Tomcat format configuration information. This ...
    Categories
    JBoss
  4. Preparing development environment for J2EE dev/JBoss

    by , 11-06-2011 at 05:25 PM (My Java Tips)
    I will show how to prepare development environment for J2EE development using JBoss. Download and install the JBoss. I will be using jboss-4.2.2.GA. Now download the latest Java EE Eclipse from eclipse.org. I have version 3.3.2.


    You should have all the required plugins for J2EE development with JBoss in your Eclipse. Navigate to:

    Help > Software updates > Find and Install > Search for new features to install > New remote site

    You can name ...
    Categories
    Java EE , JBoss , JSF , Eclipse , EJB
  5. Jboss-4.0.2 hibernate bug

    by , 11-06-2011 at 05:21 PM (My Java Tips)
    Hibernate is a popular persistence engine that runs in almost any application server and provides alternative of standard entity beans. With JBoss, you can choose to deploy your application as a Hibernate archive, called a HAR file. This makes using hibernate simpler. JBoss is responsible for managing hibernate session and other configuration details.


    Jboss-4.0.2 does not include Hibernate3 integration module. This requires Apache commons collections JAR. To fix this, use fix-hibernate ...
    Categories
    Hibernate , Java EE , JBoss
  6. jboss-service.xml

    by , 11-06-2011 at 05:16 PM (My Java Tips)
    JBoss core services are listed in conf/jboss-service.xml file. These services are started first when the server starts up. You may open the file in any test editor or in some XML editor. You will see MBeans for various services including logging, security, JNDI. You may comment any service for example:



    Now if you restart JBoss, you wont see the JNDIView service in the management console listing. In normal practice, you very seldom needs to alter this file. Remember that the ...
    Categories
    Java EE , JBoss
  7. JBoss - Logging Service

    by , 11-06-2011 at 05:13 PM (My Java Tips)
    Jboss uses Apache logging application called log4j for logging. You can find log4j.jar under lib director. The logging service is enabled from jboss.service.xml.


    The file will read like this:

    <!-- ================================================== ================== -->
    <!-- Log4j Initialization -->
    <!-- ================================================== ================== --> ...
    Categories
    JBoss , XML
  8. Debugging Remote Java Application

    by , 11-05-2011 at 06:38 PM (My Java Tips)
    Debugging is very helpful is following the flow of an application and knowing what happens when. You get list of variables with their values and you can flow what exactly is happening. It really helps is identifying the problem areas. Debugging in Eclipse is really simple and easy. I assume that you have done debugging in Eclipse.




    Debugging a J2EE application is a bit tricky since the application is deployed in web/application container. JBoss provides support for ...
    Categories
    Java EE , JBoss , Eclipse
  9. Jboss port numbers

    by , 11-05-2011 at 06:32 PM (My Java Tips)
    While working with JBoss, you must have experienced port-number collision. JBoss is does not tell ports are in use, which services are using those and how you can change them. I will try to provide some useful information in this post.



    In this post, I will talk particularly about JBoss version 4.03. All file references are relative to $JBOSS_HOME/server/default. Do assume that we are working with default configuration.

    File: $JBOSS_HOME/server/default/deploy/jbossweb-tomcat50.sar/server.xml ...
    Categories
    JBoss
  10. Deploying WAR on JBOSS

    by , 11-04-2011 at 06:52 PM (My Java Tips)
    I will present simple steps to create a web application (WAR) and will show how to deploy a WAR on JBOSS.


    Let me start from installing Java.
    http://java.sun.com/javase/downloads/

    Run the installer and install Java at: "C:\Program Files\Java\jdk1.6.0_06\". An important thing to note is that JBoss, requires the full JDK which contains the JRE along with some additional stuff like javac compiler.

    Next step is to install JBoss. Go to the ...
    Categories
    Java EE , JBoss
  11. Java Naming and Directory Interface

    by , 11-01-2011 at 06:14 PM (My Java Tips)
    I will introduce Java Naming and Directory Interface (JNDI) in this post. Its an API for accessing different kinds of naming and directory services.


    Many people believe that JNDI is specific to a particular naming or directory service, which is not correct. JNDI can be used to access many different kinds of systems including file systems; distributed objects systems (CORBA, Java RMI, and EJB) and directory services like LDAP, Novell NetWare, and NIS+.

    JNDI is similar ...
    Categories
    JBoss
  12. JNDI lookup with a corbaname URL

    by , 11-01-2011 at 06:09 PM (My Java Tips)
    A corbaname can be useful at times as a lookup name. If, for example, the target object is not a member of the federated name space and cannot be located with a qualifiied name, a corbaname can be a convenient way to look up the object.


    A lookup with a corbaname URL follows.

    Java Code:
    // Get the initial context as shown in a previous example.
    ...
    // Look up the home interface using a corbaname URL.
    try {
       java.lang.Object ejbHome = initialContext.lookup(
    ...
    Categories
    JBoss
  13. JNDI - Fixed qualified names

    by , 11-01-2011 at 06:08 PM (My Java Tips)
    If the target object has a cell-scoped fixed name defined for it, you can use its qualified form instead of the topology-based qualified name. Even though the topology-based name works, the fixed name does not change with the specific cell topology or with the movement of the target object to a different server.




    An example lookup with a qualified fixed name follows.


    Java Code:
    // Get the initial context as shown in a previous example.
    // Using the
    ...
    Categories
    JBoss
  14. JNDI - Fixed qualified names

    by , 11-01-2011 at 06:07 PM (My Java Tips)
    If the target object has a cell-scoped fixed name defined for it, you can use its qualified form instead of the topology-based qualified name. Even though the topology-based name works, the fixed name does not change with the specific cell topology or with the movement of the target object to a different server.




    An example lookup with a qualified fixed name follows.


    Java Code:
    // Get the initial context as shown in a previous example.
    // Using the
    ...
    Categories
    JBoss
  15. Adding MIME types to JBOSS

    by , 11-01-2011 at 05:51 PM (My Java Tips)
    Consider that you have an application deployed on JBOSS application server. You offer different files in your application that can be opened or downloaded. But someone complains that the web application shows code of the file imbedded in the web page instead of opening or downloading it. What problem can there be?


    Actually you have to tell your JBOSS application server of the supported files. For this, you need to add an entry in web.xml. For instance:


    <mime-mapping> ...

    Updated 11-01-2011 at 05:54 PM by Java Tip

    Categories
    JBoss , XML
  16. Writing deployment descriptor

    by , 05-25-2011 at 09:57 AM (My Java Tips)
    If you writing J2EE applications, you need to deploy your application to J2EE container like JBOSS. I will shed some light on how to write simple deployment descriptors for your web applications.

    I am deploying my JSP application on JBOSS. For JBOSS, we need to put our application in WAR format in deploy folder. So deployment descriptor will have following 2 tasks:

    1. Archieve the application into WAR
    2. Copy that WAR to deploy folder of JBOSS


    Assuming ...
    Tags: j2ee, war Add / Edit Tags
    Categories
    JBoss , Java EE
  17. Remote Debugging

    by , 05-21-2011 at 10:31 PM (My Java Tips)
    Ever wanted to launch a Java program from a network computer and debug it from the workstation running the Java platform? Example scenario is that you have an a J2EE application deployed on a dedicated server and you need to do debugging on you machine. This can be done if Java VM that supports this feature.

    To do this, launch the program in debug mode on the remote machine. It means that the program on server will wait for a connection from your debugger. Now start the debugger ...
    Categories
    Java EE , JBoss
  18. JNDI - Introduction

    by , 05-21-2011 at 10:20 PM (My Java Tips)
    JNDI is a standard Java API that comes with JDK 1.3 and higher. It provides a common interface to a variety of existing naming services for example DNS, LDAP, Active Directory, RMI registry, COS registry, NIS, and file systems.

    The JNDI API is divided logically into a client API and service provider interface. Client API is used to access naming services and a SPI allows the user to create JNDI implementations for naming services.
    The naming service providers must implement ...
    Tags: jndi Add / Edit Tags
    Categories
    Java EE , JBoss
  19. The JNDI API

    by , 05-21-2011 at 10:18 PM (My Java Tips)
    JNDI API package is called javax.naming package. It is composed of 5 interfaces, 10 classes along with few exceptions. InitialContext is the key class.

    This is what Sun Java Docs say about InitialContext:
    Java 2 Platform SE v1.3.1: Package javax.naming

    In JNDI, all naming and directory operations are performed relative to a context. There are no absolute roots. Therefore JNDI defines an initial context, InitialContext, which provides a starting point for naming ...
    Tags: jndi Add / Edit Tags
    Categories
    Java EE , JBoss
  20. META-INF and WEB-INF directories

    by , 05-21-2011 at 10:16 PM (My Java Tips)
    If you're looking at a web application deployed on a tomcat server, then you might notice META-INF and WEB-INF directories.

    The META-INF directory is related to .jar files, It contains the manifest file which has list of jars. The WEB-INF directory is a vital component of your web application. Web application won't run without it. It contains a hierarchy in which you'll find the necessary configuration information for your web application, and all the class files for your servlets ...
    Categories
    JBoss