There are quite a lot of Java EE implementations, among which open source and closed source implementations.

The closed source implementations are traditionally not only known for their “closed sourceness”, but also for their “enterprise aspects”. Developers themselves typically associated them with the term heavy weight. Where TomEE needs just 25MB for the entire Java EE 6 WebProfile and GlassFish 3.1.2 81MB for the full profile, the closed source implementations are assumed to be many gigabytes in size (including all kinds of “middleware” and “value added business solutions”), unobtainable via a public download (a salesperson will contact you if interested), take up to half an hour just to bootup and will use gigabytes of memory.

But is all of this still true? To test this I tried to obtain, install and run a very simple CRUD application on WebLogic 12c.

The results of this exercise were rather good, although there are some points open for improvement.

First of all, WebLogic can simply be downloaded just like all open source implementations. The download size is 183MB, which happens to be the exact same size that JBoss AS 6.10 was (AS 7.1 has since been slightly trimmed to 127MB). Yes, there are the ye olde 1GB+ downloads as well, but the 183MB one is the default. The text on the page is initially slightly confusing. At first glance it looks like you need a 997MB download for 64-bits VMs, but apparently this is only if you want the installer version.

So far so good, but then a slightly disappointing experience: you don’t just need to accept the license, no, you need to register first despite the promise that you can “download the software now”. I can only imagine many developers drop off here and download JBoss instead. (The company I work for among others investigates these kinds of flows and the drop off rate for each such hurdle is indeed dramatic)

The ones who do proceed to register, hoping for a quick “username + password” form are disappointed again. Here WebLogic/Oracle shows its enterprise face, as you have to fill out a huge form asking among others for your company and business phone. “Business phone”? Really!? Whoever made this form might not have had developers trying out things as their prime audience in mind. I filled out the form though and at least the download starts immediately after.

Hereafter I tried the usual steps to start the AS:

Unzip downloaded archive Point Eclipse WTP server runtime to unzip directory Start AS via said server runtime

Unfortunately the server runtime didn’t recognize the directory where I unzipped WebLogic or any of its sub-directories. I quickly found a getting started by Arun Gupta and it appeared some scripts had to be run first. This getting started was a big help (thanks Arun!).

Running these scripts is not difficult really, but as I just blindly copy/pasted the commands I wonder why this can’t be automated or if it wouldn’t be possible to create a slightly smarter setup archive so this wouldn’t be needed at all. As said, it’s not difficult, but it’s a tedious chore, especially if you want to experiment with different installations. Things like this sadly contribute to the feeling of something being heavy-weight.

After this the dialog in Eclipse for creating the WTP server runtime recognized the WebLogic install immediately. A few remarks here though: for some reason I have to manually enter an external JDK home here. This feels sloppy, as the norm for Eclipse plug-ins is to offer the user a choice between the JDKs that are registered with Eclipse. On the same dialog there was also a text that “Server extensions Java Persistence 2.0” were enabled. I guess this is a left-over from an older WebLogic version where JPA 2.0 wasn’t yet the standard. I’m not sure this text still makes any sense for a Java EE 6 AS, but if anyone knows why this text is there please let me know.

I then finally started up WebLogic 12c and it surely didn’t take the many minutes people claim that this kind of software takes. Deploying the actual CRUD app didn’t take any significant amount of time either and my system certainly didn’t instantly started to swap. Strong points for WebLogic 12c here.

The default logging when starting up is also reasonably sane. The LoggingService is a bit noisy after the first startup, repeating the message about the log being rotated 3 times, but it’s certainly not page after page of unintelligible mumble jumble. To compare, the startup logs of JBoss AS 6.x and TomEE are much noisier. Here’s what the startup log looked like at my system:

<Apr 29, 2012 3:15:30 PM CEST> <Info> <Security> <BEA-090905> <Disabling CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true> <Apr 29, 2012 3:15:30 PM CEST> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG to FIPS186PRNG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true> <Apr 29, 2012 3:15:30 PM CEST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 20.6-b01-415 from Apple Inc..> <Apr 29, 2012 3:15:31 PM CEST> <Info> <Management> <BEA-141107> <Version: WebLogic Server Temporary Patch for 13340309 Thu Feb 16 18:30:21 IST 2012 WebLogic Server Temporary Patch for 13019800 Mon Jan 16 16:53:54 IST 2012 WebLogic Server Temporary Patch for BUG13391585 Thu Feb 02 10:18:36 IST 2012 WebLogic Server Temporary Patch for 13516712 Mon Jan 30 15:09:33 IST 2012 WebLogic Server Temporary Patch for BUG13641115 Tue Jan 31 11:19:13 IST 2012 WebLogic Server Temporary Patch for BUG13603813 Wed Feb 15 19:34:13 IST 2012 WebLogic Server Temporary Patch for 13424251 Mon Jan 30 14:32:34 IST 2012 WebLogic Server Temporary Patch for 13361720 Mon Jan 30 15:24:05 IST 2012 WebLogic Server Temporary Patch for BUG13421471 Wed Feb 01 11:24:18 IST 2012 WebLogic Server Temporary Patch for BUG13657792 Thu Feb 23 12:57:33 IST 2012 WebLogic Server 12.1.1.0 Wed Dec 7 08:40:57 PST 2011 1445491 > <Apr 29, 2012 3:15:32 PM CEST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.> <Apr 29, 2012 3:15:32 PM CEST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool.> <Apr 29, 2012 3:15:32 PM CEST> <Notice> <LoggingService> <BEA-320400> <The log file /Users/henk/eclipse37ee/wls1211_dev/mydomain/servers/myserver/logs/myserver.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms, such as Windows.> <Apr 29, 2012 3:15:32 PM CEST> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to /Users/henk/eclipse37ee/wls1211_dev/mydomain/servers/myserver/logs/myserver.log00018. Log messages will continue to be logged in /Users/henk/eclipse37ee/wls1211_dev/mydomain/servers/myserver/logs/myserver.log.> <Apr 29, 2012 3:15:32 PM CEST> <Notice> <Log Management> <BEA-170019> <The server log file /Users/henk/eclipse37ee/wls1211_dev/mydomain/servers/myserver/logs/myserver.log is opened. All server side log events will be written to this file.> <Apr 29, 2012 3:15:34 PM CEST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.> <Apr 29, 2012 3:15:34 PM CEST> <Warning> <Store> <BEA-280109> <Unable to load the native wlfileio library for the persistent file store "_WLS_myserver". The store will use buffered I/O. The store is still operating in a transactionally safe synchronous mode. See store open log messages for the requested and final write policies.> <Apr 29, 2012 3:15:34 PM CEST> <Notice> <LoggingService> <BEA-320400> <The log file /Users/henk/eclipse37ee/wls1211_dev/mydomain/servers/myserver/logs/access.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms, such as Windows.> <Apr 29, 2012 3:15:34 PM CEST> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to /Users/henk/eclipse37ee/wls1211_dev/mydomain/servers/myserver/logs/access.log00018. Log messages will continue to be logged in /Users/henk/eclipse37ee/wls1211_dev/mydomain/servers/myserver/logs/access.log.> <Apr 29, 2012 3:15:35 PM CEST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY.> <Apr 29, 2012 3:15:35 PM CEST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.> <Apr 29, 2012 3:15:35 PM CEST> <Notice> <LoggingService> <BEA-320400> <The log file /Users/henk/eclipse37ee/wls1211_dev/mydomain/servers/myserver/logs/mydomain.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms, such as Windows.> <Apr 29, 2012 3:15:35 PM CEST> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to /Users/henk/eclipse37ee/wls1211_dev/mydomain/servers/myserver/logs/mydomain.log00018. Log messages will continue to be logged in /Users/henk/eclipse37ee/wls1211_dev/mydomain/servers/myserver/logs/mydomain.log.> <Apr 29, 2012 3:15:35 PM CEST> <Notice> <Log Management> <BEA-170027> <The server has successfully established a connection with the Domain level Diagnostic Service.> <Apr 29, 2012 3:15:35 PM CEST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN.> <Apr 29, 2012 3:15:36 PM CEST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING.> <Apr 29, 2012 3:15:36 PM CEST> <Error> <Server> <BEA-002606> <The server is unable to create a server socket for listening on channel "Default[2]". The address xxxx:0:0:0:0:0:0:1%0 might be incorrect or another process is using port 7001: java.net.BindException: Can't assign requested address> <Apr 29, 2012 3:15:36 PM CEST> <Error> <Server> <BEA-002606> <The server is unable to create a server socket for listening on channel "Default[3]". The address xxxx:0:0:0:xxxx:off:xxxx:d7%0 might be incorrect or another process is using port 7001: java.net.BindException: Can't assign requested address> <Apr 29, 2012 3:15:36 PM CEST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on xxx.xx.xx.x:7001 for protocols iiop, t3, ldap, snmp, http.> <Apr 29, 2012 3:15:36 PM CEST> <Warning> <Server> <BEA-002611> <The hostname "localhost", maps to multiple IP addresses: 127.0.0.1, 0:0:0:0:0:0:0:1, fe80:0:0:0:0:0:0:1%1.> <Apr 29, 2012 3:15:36 PM CEST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on xxx.xxx.x.xxx:7001 for protocols iiop, t3, ldap, snmp, http.> <Apr 29, 2012 3:15:36 PM CEST> <Notice> <Server> <BEA-002613> <Channel "Default[4]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.> <Apr 29, 2012 3:15:36 PM CEST> <Notice> <Server> <BEA-002613> <Channel "Default[5]" is now listening on 0:0:0:0:0:0:0:1:7001 for protocols iiop, t3, ldap, snmp, http.> <Apr 29, 2012 3:15:36 PM CEST> <Notice> <WebLogicServer> <BEA-000331> <Started the WebLogic Server Administration Server "myserver" for domain "mydomain" running in development mode.> <Apr 29, 2012 3:15:36 PM CEST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING.> <Apr 29, 2012 3:15:36 PM CEST> <Notice> <WebLogicServer> <BEA-000360> <The server started in RUNNING mode.>

Then I tried to request a page on localhost:8080, but no response. After a cursory look at the log shown above, it appears that WebLogic listens to HTTP at port 7001 instead of the usual 8080. I’m not sure why WebLogic has chosen 7001 here. Is it a port that WebLogic started using before the convention of using port 8080 was established, or is it a deliberate choice, “Think Different”?

Using port 7001 I could now request the CRUD form of the sample app, but unfortunately, I couldn’t post back this form as a ViewExpiredException was thrown. It appeared that my browser (Safari) didn’t accept the JSESSIONID cookie being send:

Set-Cookie:JSESSIONID=k2yPPcdFtLyyQL2vBmjt1G2PkV3YJGhyPvnYZhDZmn0TGC5GjLsN!-180841883; path=/; HttpOnly

I posted about this on the Oracle forum (hey, one advantage of the registration, I could post right away) and continued using Chrome, which did accept the cookie.

Right after the post back of the form I immediately got another exception:

java.lang.IllegalArgumentException: No persistence unit named 'entityManager' is available in scope jsf_ejb_jpa. Available persistence units: []

Suspecting the datasource in web.xml wasn’t supported I tried to find out how to define a WebLogic-specific datasource in a war. When this didn’t seem to be possible after reading articles and Googling for the better of an hour, I created an EAR with such datasource. Unfortunately still the same exception.

By this time I was also frequently getting the following exception:

Caused By: weblogic.common.ResourceException: Database may be already in use: "Locked by another process". Possible solutions: close all other connection(s); use the server mode [90020-161] at weblogic.jdbc.common.internal.XAConnectionEnvFactory.makeConnection(XAConnectionEnvFactory.java:498) at weblogic.jdbc.common.internal.XAConnectionEnvFactory.createResource(XAConnectionEnvFactory.java:175) at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1310) at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1227) at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:250)

I’m using the embedded H2 database here in disk mode, which uses a lock. For some reason WebLogic seems to initialize the datasource twice. Once when starting up, and once when deploying the application containing this (app scoped) datasource, which causes a lock conflict. After some twiddling, the right sequence to get rid of this is:

Undeploy app while WebLogic is running. Shut down. Delete locks on filesystem. Start up. Hot deploy app.

This kind of problem doesn’t occur when using H2 in memory or server mode, or using other ‘regular’ databases, but it’s peculiar that of the servers I tested the CRUD app on (JBoss AS, GlassFish and TomEE), only WebLogic has this problem with the on disk locks.

After some more experimenting, it appeared the entityManager problem isn’t related to WebLogic 12c itself, but appears to be a known issue with the WebLogic 12c WTP Server runtime and exploded deployments. After deploying the packaged war, everything worked.

Better yet, of all the Java EE 6 implementations I tested, WebLogic 12c scores best here. It’s able to process the datasource in web.xml AND is able to load the JDBC driver jar from the war. In contrast, GlassFish required this driver to be internally installed. JBoss AS can load the driver from a war as well, but currently has some major problems with transactional datasources. TomEE’s beta 2 also didn’t work correctly (but this will most likely be fixed in their 1.0 release).

So to conclude, despite the problems I ran into, I’m fairly positive about WebLogic 12c from the perspective of a developer trying out Java EE 6 code. The supposed real power of WebLogic is in quite another area (scalability, fail-over, etc), but for developers to even consider WebLogic and not have it merely forced upon them by management, it should have the basics right too and I think it has.

To summarize, WebLogic with respect to a casual developer trying out Java EE 6:

Strong points

Downloadable

Reasonable download size (183MB)

Good startup time

Startup log is not overly verbose

Can load JDBC driver from war

Processes data-source element in web.xml correctly

Points that could possible be improved upon

Elaborate required registration before downloading

Simple, but required installation scripts after download

Port 7001 for HTTP is uncommon

Eclipse plug-in asks for external JDK

The one thing that is and remains an issue for developers in WebLogic is that it’s closed source. It does pack an amount of open source code, like Mojarra (JSF) and EclipseLink (JPA), but the general inability to step into source in order to find the root of an issue would personally hinder me in my day to day development. I’m aware though that not all developers frequently step into the internals of their AS 😉

To conclude; WebLogic 12c is by no means the heavy-weight beast that common knowledge claims it is.