0

I am trying to learn Java EE properly and am stumped at a problem. I am unable to get a client to work with my EE application. I asked this question earlier and looked around and found that if I need to run my main method with EE features then I need an application client container.

The client code that I am trying is

package com.anshbansal;

import org.jboss.weld.environment.se.Weld;
import org.jboss.weld.environment.se.WeldContainer;

public class Main {
    public static void main(String[] args) {
        Weld weld = new Weld();
        WeldContainer container = weld.initialize();
        weld.shutdown();
    }
}

How can I run this client through application client container of weblogic 12c?

Community
  • 1
  • 1
Aseem Bansal
  • 6,722
  • 13
  • 46
  • 84
  • You seem to be *very* confused, there is no such thing as an application client container in weblogic 12c. There is a container, the container is weblogic. You can communicate with services contained in the weblogic container with t3, rmi, http and/or iiop. – Elliott Frisch Sep 19 '14 at 18:43
  • Are you trying to create a web application? What is your end goal? – shinjw Sep 19 '14 at 18:57
  • 1
    @ElliottFrisch As per the book "Beginning Java EE 7" by Antonio Goncalves there are 4 types of Java EE containers - Web Container, EJB container, Applet container and Application client container. As weblogic 12c is Java EE compliant I am assuming that there should be all four types of containers in it. – Aseem Bansal Sep 19 '14 at 19:06
  • @AseemBansal You are 50% correct. It's a web container and an ejb container. – Elliott Frisch Sep 19 '14 at 19:06
  • @shinjw My end goal is to learn and be able to use Java EE 7 stack. First step is to be able to run the examples for CDI (Chapter 2) of the book. The examples are present at https://github.com/agoncal/agoncal-book-javaee7 – Aseem Bansal Sep 19 '14 at 19:07
  • 1
    @shinjw By end goal maybe you meant for this particular example. The current example is the result of my trimming of the original source till it was bare bones to run the client of a Java EE application. My end goal is to get a client to work with Java EE application deployed on a server. – Aseem Bansal Sep 19 '14 at 19:17
  • Do you already have weblogic up and running? – shinjw Sep 19 '14 at 19:29
  • 1
    @shinjw Yes. I already ran an EJB 3 application with Servlet/JSP as client on the server. – Aseem Bansal Sep 19 '14 at 19:31
  • @ElliottFrisch Now I am confused. If my understanding is correct then a server needs to implement these containers to be Java EE compliant. If weblogic does not have the other two then why is it listed as a compliant server on oracle's website at http://www.oracle.com/technetwork/java/javaee/overview/compatibility-jsp-136984.html? Is my understanding incorrect? – Aseem Bansal Sep 19 '14 at 19:34
  • What do your Weld and Weld container class do? Also provide the source for your Servlet – shinjw Sep 19 '14 at 19:34
  • @shinjw The full code is present on author's github profile. https://github.com/agoncal/agoncal-book-javaee7/tree/master/chapter02/chapter02-putting-together/src/main – Aseem Bansal Sep 19 '14 at 19:35
  • @AseemBansal Your understanding is incorrect. For example, an applet container is usually called a web browser. – Elliott Frisch Sep 19 '14 at 19:35
  • 1
    Weblogic does no support an application client container. An application client container is an optional Java EE feature, so weblogic can be Java EE compliant without supporting it. You can use JNDI to look up your resources though. – Catweazle Feb 28 '15 at 09:15

1 Answers1

1

Oracle weblogic 12c doesn't support "application client container" i.e "application-client.xml". I couldn't get a doc link for this. But you could do the following in netbeans to verify this,

  1. Select "New Project"
  2. Select "Java EE" in Categories & "Enterprise Application Client" in Projects then click Next
  3. Give a ProjectName then click Next
  4. You won't see "Oracle Weblogic 12C" in Server drop-down list (eventhough Oracle Weblogic 12C already configured in netbeans). But You'd see "Glass Fish, JBOSS AS,etc" in the Server drop-down list.