Archive for the 'Server' Category


Creating a wlfullclient.jar for JDK 1.6 client applications..

Jul 30, 2010 in Java, Weblogic


Use the following steps to create a wlfullclient.jar file for a JDK 1.6 client application:

1.Change directories to the server/lib directory.

cd WL_HOME/server/lib

2. Use the following command to create wlfullclient.jar in the server/lib directory:

java -jar wljarbuilder.jar

3.You can now copy and bundle the wlfullclient.jar with client applications.

4.Add the wlfullclient.jar to the client application’s classpath.

WebLogic 10.3 Workshop notes..

Jun 24, 2010 in Server, Weblogic

>> WebLogic 10.3 is old but I want to follow the workshop and I cannot
find the “workshop” in the Oracle WebLogic 10.3.3 package.

  * For page navigation, it uses Apache Beehive, which is now retired.

>> Add Eclipse components via:

  * /opt/bea/wlserver_10.3/common/bin/ &

  * Fix eclipse java crash: add this line to “workshop.ini”:


  * Create application domains outside the server directory space

>> Fix jre error: “JRE is selected, but the path is invalid”.

  * Set path (JAVA_HOME, WLS_JAVA_HOME, etc..) in

>> Web Application with Beehive (now retired) page navigation control

  >> See wlswswa*.png images.

  >> Main points/tools:

  * Page Flow editor and overview panels

  * Controller methods annotated for “page flow” processing.

>> Web Services

* Simple Web Service

– add src/services folder

– Add “” class to “src/services” folder.

– will be annotated with @WebService class annotation

– Web methods will be annotated with @WebMethod annot.

* To Test, right click on (the ‘services’ trigger ‘Run As’) and do ‘Run As’ with ‘Run On Server’ selection.

– The web service test page is displayed with URL:


– The web service test client page:


>> To enable or disable the domain configuration locking feature in a development domain:

In browser, http://host:7001/console, log in as admin..

1. In the banner toolbar region at the top of the right pane of the Console, click Preferences.
2. Click User Preferences.
3. Select or clear Automatically Acquire Lock and Activate Changes to enable or disable the feature.
4. Click Save.

>> Entity EJBs (VisitBean) – Persistence with CMP (Container Managed Persistence)

– Create EJB project, Create package (under ejbModule), right-click on package, select “New Weblogic Entity Bean”.

– Screen shots are in wlswsejb[0-9]*_*.png

– Examine the generated code. Open the “Properties” view from top Eclipse menu “Window / Show View / Properties”. The “Properties” view should open in a window with a tab (bottom area).

– Click on the “@Entity” annotation. The allowed and the set attribute values for the annotation are shown in the “Properties” view (see wlswsejb3_properties_view.png).

– Setup CMP fields and methods:

@CmpField(column = "visitorName", primkeyField = Constants.Bool.TRUE)
public abstract java.lang.String getVisitorName();

Note: primkeyField indicates whether the field is a primary key.

Helpful WebLogic error messages..

Jun 14, 2010 in Server, Weblogic

In WebLogic 10.3 ..

weblogic-ejb-jar.xml with this entity-descriptor:




Triggers this error (Note the -truly- useful help message):

Unable to deploy EJB: /opt/bea/user_projects/domains/base_domain/servers/AdminServer/stage
/_appsdir_ProductEjb_jar/ProductEjb.jar from ProductEjb.jar:

Persistence type 'WebLogic-CMP' with version '6.0' which is referenced in bean 'Product' is not 
installed. The installed persistence types are:(WebLogic_CMP_RDBMS, 5.1.0), 
(WebLogic_CMP_RDBMS, 7.0), (WebLogic_CMP_RDBMS, 6.0).

Change this:


to this:


and the jar will deploy.

JBoss vs WebLogic – JNDI issues..

Jun 11, 2010 in JBoss, Weblogic

In JBoss, one can get a reference to the Remote bean directly:

    context = new InitialContext(jndiprops);
    BookTestBeanRemote beanRemote = 
        (BookTestBeanRemote) context.lookup("BookTestBean/remote");
} catch (NamingException e) {

In WebLogic 10.3, I was not able to do the same thing.
The exception said that WebLogic JNDI failed to find the bean.
As some searches indicated, I should have used something like this for
the lookup string: “BookTestBean#com.blah.BookTestBeanRemote” ..
I tried all kinds of combinations but I was not able to make it work.

In JBoss, the “Home” interface is not required. In WebLogic, it is required.
This may have something to do with different levels of implementation
of the EJB spec but I would think JBoss 5 and WebLogic 10
should be pretty close in compatibility.. maybe.. what do I know?

Based on this, the only way I was able to make WebLogic work, was via
the “Home” interface:

Context context;
    context = new InitialContext(jndiprops);

    UserTransaction txn = (UserTransaction) context.lookup("javax.transaction.UserTransaction");
    if (txn != null) {
        String jndiLookupStr = "";
	// jndiLookupStr = "BookTestBean#de.laliluna.library.BookTestBeanRemote";
        jndiLookupStr = "BookTestBean";

        Object oref = context.lookup(jndiLookupStr);
        BookTestBeanHome homeRef = (BookTestBeanHome) PortableRemoteObject.narrow(oref,
        BookTestBeanRemote beanRef = homeRef.create();

    } // txn != null
catch (Exception e) {

This page says that remote reference retrieval is possible with WebLogic:

JBoss vs WebLogic notes – persistence..

Jun 11, 2010 in JBoss, Weblogic

In JBoss, this works:

List someBooks = em.createQuery("FROM Book b WHERE")
    .setParameter("name", "Sebastian").getResultList();

In WebLogic, I had to specify SELECTs:

List someBooks = em.createQuery("SELECT b FROM Book b WHERE")
    .setParameter("name", "Sebastian").getResultList();

If I have time, I will dig further and see why they behave differently but I suspect
that JBoss CMP is used automatically while in WebLogic, OpenJPA is used which
requires the “SELECT” syntax.

Good example on client transaction setup:

JBoss vs WebLogic tidbits..

Jun 10, 2010 in JBoss, Weblogic

Porting JBoss EJB3s to WebLogic is not trivial.. Here are some of the compliance exceptions:

  • weblogic.ejb.container.compliance.ComplianceException: Home methods are not allowed on session beans: BookTestBean.test()

  • weblogic.ejb.container.compliance.ComplianceException: In EJB BookTestBean, method test() on the home interface does not throw java.rmi.RemoteException. This is a required exception.

  • weblogic.ejb.container.compliance.ComplianceException: In EJB BookTestBean, the home interface de.laliluna.library.BookTestBeanLocal must extend the javax.ejb.EJBHome interface.

  • weblogic.ejb.container.compliance.ComplianceException: In EJB BookTestBean, the home interface of a stateless session bean must have one create method that takes no arguments.

  • weblogic.ejb.container.compliance.ComplianceException: In EJB BookTestBean, the return type for the home create method create() must be the remote interface type of the bean.

Persistence-related exception:

org.apache.openjpa.util.MetaDataException: “” declares generator name “book_sequence”, but uses the AUTO generation type. The only valid generator names under AUTO are “uuid-hex” and “uuid-string”.

To fix it, change this:

// For JBoss
@GeneratedValue(strategy = GenerationType.AUTO, generator = "book_sequence")

to this:

// For WebLogic
@GeneratedValue(strategy = GenerationType.AUTO)

More on persistence.. the default provider for WebLogic is a package named ‘Kodo’.
To set the OpenJPA (Java Persistence API) provider, add the element
to persistence.xml , like this:

<persistence xmlns=""

        <persistence-unit name="FirstEjb3Tutorial" transaction-type="JTA">
                        <property name="openjpa.ConnectionURL" value="jdbc:pointbase:server://localhost:18888/fe3t"/>
                        <property name="openjpa.ConnectionDriverName" value="com.pointbase.jdbc.jdbcUniversalDriver"/>
                        <property name="openjpa.ConnectionUserName" value="fe3t"/>                   
                        <property name="openjpa.ConnectionPassword" value="fe3t"/>
                        <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"/>

Note the “openjpa.” qualifier .. Persistence will not work without it ..

EJB container interface..

Jun 07, 2010 in EJB, JBoss, Weblogic

  1. ejbCreate, ejbPostCreate
  2. ejbLoad, ejbStore
  3. ejbActivate, ejbPassivate

Weblogic 10 Administration notes..

Apr 14, 2010 in Server, Web, Weblogic


— Using the WL Scripting Tool (WLST)
If you are working on the WL server you can use the WL Scripting Tool to browse the available Runtime beans:
D:\Data\bea\wlserver_10.0\server\bin>java weblogic.WLST

— Administer IIOP, Channels (t3)

Environment->Servers->[myServer]->Protocols [tab]

Basic Weblogic 10.3 installation and configuration notes ..

Mar 26, 2010 in Server, Web, Weblogic

— After installing the server, run the configuration and setup the “base_domain”.

— The “base_domain” directory is parallel to the “wlserver_10.3” directory.
IOW: If the root path to the installation directory is “/Oracle/mw”, the “wlserver_10.3” is here:


and “base_domain” is here:


The “base_domain/bin” (and the other domains) directory contains scripts:

— If you cannot log into the administration console, change this file:


from this (like this..):


to this:


(or whatever user/password you wish)

and restart the server. If you cannot stop the server, do a “kill -1 pid” with the server “pid”.

— I find the weblogic app structure confusing..
I am sure that there is a good reason for this
and I just do not know it but it is still confusing..

There are


and there are


Just be aware ..

Tomcat performance monitoring..

Aug 27, 2009 in Java, Tomcat


  • Tomcat Resource Pools.

    Connector Thread Pool

    Database Connection Pool

  • Use Tomcat Valves for implementing lightweight monitoring w/o JMX.