Starting JRockit Mission Control 
Monday, June 9, 2008, 11:55 AM - Java
Issue:

Bea JRockit Mission Control does not want to connect to the Bea instance. It reports connection refused.

Solution:

A possible cause is that the -Xmanagement parameter is not in the correct location in the startup string. The startup string should look like:
${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} ${JAVA_OPTIONS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${PROXY_SETTINGS} -Xmanagement ${SERVER_CLASS} >"${WLS_REDIRECT_LOG}" 2>&1
With the -Xmanagement parameter just before the starting class.

  |  permalink  |  
Bea gives error that weblogicWLStore is owned by other thread 
Tuesday, June 3, 2008, 03:29 PM - Java
Issue:

While using a JMS configuration with multiple persistent stores in Bea WLS 9.2, there is an error stating the following:

<Warning> <Store> <managed server name 1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <> <BEA-280076> <Database table "weblogicWLStore" for store "PersistentStore-01" is currently owned by "[name={server=managed_03!host=x.y.x.a!domain=abc!store=PersistentStore-03!table=weblogicWLStore}]". Trying to wait for ownership.>
<Error> <Store> <managed server name 2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <> <BEA-280077> <JDBC store "PersistentStore-01" in this server is not the owner of database table "weblogicWLStore". Unexpected current owner is "[name={server=managed_03!host=x.y.z.a!domain=abc!store=PersistentStore-03!table=weblogicWLStore}]", expected current owner is "[name={server=managed_01!host=x.y.z.a!domain=abc!store=PersistentStore-01!table=weblogicWLStore}]".>
<Error> <Store> <managed server name 2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1212496576272> <BEA-280072> <JDBC store "PersistentStore-01" failed to open table "weblogicWLStore".
weblogic.store.io.jdbc.JDBCStoreException: [Store:280064]280077 (server="managed_01" store="PersistentStore-01" table="weblogicWLStore")
at weblogic.store.io.jdbc.JDBCStoreIO.checkTableOwnership(JDBCStoreIO.java:1991)
at weblogic.store.io.jdbc.JDBCStoreIO.getTableOwnershipLogical(JDBCStoreIO.java:2104)
at weblogic.store.io.jdbc.JDBCStoreIO.open(JDBCStoreIO.java:382)
at weblogic.store.internal.PersistentStoreImpl.open(PersistentStoreImpl.java:353)
at weblogic.store.admin.AdminHandler.activate(AdminHandler.java:135)
at weblogic.store.admin.JDBCAdminHandler.activate(JDBCAdminHandler.java:64)
at weblogic.management.utils.GenericManagedService.activateDeployment(GenericManagedService.java:237)


Solution:

The persistent store prefix (use the admin interface, edit persistent store) can be altered to have a table per persistent store. This way no table lock conflicts rise and all managed servers can start.
  |  permalink  |  
Bea Weblogic 9.2 does not start after upgrade 
Tuesday, June 3, 2008, 11:58 AM - Java
Issue:

After an upgrade of the Bea Weblogic server, the environment does not want to start. The error from Bea is BEA-149610.

Solution:

Remove from servers your admin server and managed servers. They have something cached, which requires a rebuild from Bea, which fails because it is trying to start the admin server at the same time. After removal of the servers, the environment starts.
  |  permalink  |  
Weblogic jar installer in console mode reports to little disk space 
Tuesday, June 3, 2008, 10:03 AM - Java
Issue:

During the installation of Bea weblogic 10, the console mode installer reports to little disk space available:

Choose Product Installation Directories:
----------------------------------------

BEA Home Directory: [/opt/weblogic]

Product Installation Directories:


"Default Product Home" = [Enter new value or use default "/opt/weblogic/wlserver_10.0"]


** Insufficient disk space! The installer requires:
** 91MB for the BEA Home at /opt/weblogic,
** 362MB for the product at /opt/weblogic/wlserver_10.0 and
** 367MB temporary work space at /tmp/bea50538.tmp.
** There is only 375MB available at /tmp.


Note however that there is actually a larger number available on tmp in this case.

Solution:

Ignore the error, it is bogus.
  |  permalink  |  
Bea weblogic installation are jar files instead of binary 
Monday, June 2, 2008, 10:06 AM - Java
Issue:

The installation files as downloadable from Bea Weblogic are jar files instead of the executable files as mentioned in the installation manual.

Solution:

Use a different manual.
The important command is:
java -jar <jarfile> -mode=console
  |  permalink  |  
Bea Weblogic JMS fails to show in JNDI tree in cluster setup 
Friday, May 23, 2008, 09:17 AM - Java
Issue:

Bea Weblogic JMS information is not showing on any other machine in a cluster except the physical machine where the JMS is running.

Solution:

Bea implemented the JMS service standard as a high performance solution. To use this:
A JMS server has to be created per managed server (non-migratable);
The queues have to be created as (uniform) distributed queues with as target the cluster;
The connection factory also has to target the cluster.


  |  permalink  |  
EditFailedException in Bea Weblogic 9.1 
Saturday, March 29, 2008, 06:10 PM - Java
Issue:

Bea Weblogic 9.1 fails during the change of configuration using the admin console (apply changes) with the exception: weblogic.management.provider.EditFailedException

Solution:

There is 2 possible solutions: First try the solution posted by Bea.

If this does not work, try the following:
Stop Bea (with most likely a kill -4). Assign more memory to Bea. Start Bea again. This might solve your issue.
Maybe a complete reboot of your environment will work too.

  |  permalink  |  related link  |  
java.lang.NoClassDefFoundError: javax/mail/Authenticator 
Monday, December 10, 2007, 10:34 PM - Java
Issue:

java.lang.NoClassDefFoundError: javax/mail/Authenticator in Tomcat while using javamail.

Solution:

Javamail contains a slight issue with locating the activation jar file from JAF.
Place the mail jars and activation.jar in tomcat/common/lib. This will solve the problem.

  |  permalink  |  
Bea weblogic logrotate fails 
Saturday, December 1, 2007, 04:27 PM - Java
Issue:

The logrotate of Bea Weblogic does not seem to work, while in the rotated files directory created by the admin, files are created. The logfiles just keep growing untill the disk is full.

Solution:
The issue is that Bea weblogic wants an absolute path in the configuration for the logrotate, but appearently can live with a relative path when writing to the logfiles itself. Replace all the paths to the logfiles and also to the rotation location with absolute paths, and the problem should be solved. Restart admin server to verify it works.


  |  permalink  |  
javamail 501 HELO hostname 
Tuesday, January 17, 2006, 10:55 AM - Java
Symptom

The javamail implementation you are using, is giving the following exception:
javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.MessagingException: 501 Syntax: HELO hostname

This error is slightly vague in origin, since java api descriptions fail to list most common exception causes. In this case it is the mail server responding on a single HELO command without a hostname. Since it wants to have a hostname, however fake it can be, it responds with 501 Syntax: HELO hostname. JavaMail just echos that response in the exception.

Solution

Send the hostname in the HELO command. Usually when you set up a common javamail, the InitialContext & session contain the necessary properties. Apperently the property mail.smtp.localhost is not set. To see the current properties, get the properties of the session: java.util.Properties props=session.getProperties(); and print them: System.out.println("my properties: "+props.toString());
You will see that the key mail.smtp.localhost is missing.
The correct solution to solve this, is to update the resource parameters of your mail/Session, for example in tomcat's server.xml:

<Resource name="mail/Session" auth="Container" type="javax.mail.Session"/>
<ResourceParams name="mail/Session">
<parameter>
<name>mail.hipersonik.com</name>
<value>localhost</value>
</parameter>
<parameter>
<name>mail.smtp.localhost</name>
<value>localhost</value>
</parameter>
</ResourceParams>

An alternative solution for when the previous solution is not available to you:
Add the key with the following code:
Properties props=session.getProperties();
String key= "mail.smtp.localhost";
String prop= props.getProperty(key);
if (prop== null) props.put(key, "localhost");
This way sending by using the localhost is possible. It also works for other hosts, so you can select any mailserver you want (as long as you are allowed to use it).


  |  permalink  |  related link  |  
if statement fails to compare two Integer objects 
Wednesday, January 11, 2006, 04:12 PM - Java
Symptom

While using java 1.5, the following is allowed:
Integer number1=1;
Integer number2=1;

if(number1==number2) System.out.println("number1 is number2");
else System.out.println("number1 is not number2");

This fails.

Solution

It is not allowed in the java standard to compare two objects. You are actually comparing the object identifiers instead of the object values. Use the intValue or the compareTo methods to do the correct comparisson.
  |  permalink  |  
MessageResource problems with struts 
Saturday, December 31, 2005, 09:37 PM - Java
Symptom

There are several exceptions in the style of "key not found exception" while there are references to the message resource file in the struts-config.xml or web.xml from tomcat.

Solution

The advice is to use the struts-config file only setup and not to include the message resource as an init parameter in the web.xml file.
To include the message resource files put the following in the struts-config.xml:
<message-resources
null="false"
parameter="your.preferred.package.ApplicationResources" />
The file in this should be named: ApplicationResources.properties, or with the language extention to it: ApplicationResources_es.properties.
The resource file has to be included in your build by adjusting ant or any other tool you are using.

  |  permalink  |  
log4j and Digester exception 
Thursday, December 29, 2005, 04:30 PM - Java
Symptom

In the catalina.out logfile from tomcat there is an exception:
ERROR org.apache.commons.digester.Digester[main] - End event threw exception
java.lang.reflect.InvocationTargetException
etc....

For the rest everything works fine.

Solution

Copy the log4j jar file to the /WEB-INF/lib location and reboot tomcat. The error is gone.

  |  permalink  |  
Nested iterator 
Tuesday, December 27, 2005, 08:39 PM - Java
Struts with nested iterators

There are lots of examples on the internet concerning struts with the nested tag library. The following examples concenr less used ways of displaying nested data by using 100% struts compatible methods.

The data

The data to be displayed consists out of sets of data from which the main data is a single list of names, and the second set is a list of telephone numbers per name:

Jan: 123456789 122345678 122233344
John: 155522234 123354556 132311244

This data is to be displayed in such a way that it is readable to a user, in html. In this case: The name, with underneath the telephonenumbers:
jan
123456789
122345678
122233344

To be able to do this, the data will be organized in its own data storage class per name, after which this is data storage class is stored in a Collection.

The data storage class

Bean code

JSP code

Extra: multiple lists to be accessed

Suppose the data with the telephone numbers also has an address associated to it:
jan
123456789 home
122345678 office
122233344 mobile
And you want to display this data.
To do this, the data is all stored in the storage class, and the jsp is altered in the following way:


The changes to the storage class:

Conclusion
  |  permalink  |  
cannot create iterator for this collection 
Tuesday, December 27, 2005, 12:31 PM - Java
Symptom

In jsp with struts you are trying to iterate over a Collection, but the servlet does not recognize it as such.

Solution

Use a collection instead of the type you are using now. logic:iterate works over:
- Hashtable or other maps without accessing the nested elements.
- Collections: AbstractCollection, AbstractList, AbstractSet, ArrayList, HashSet, LinkedHashSet, LinkedList, TreeSet, Vector with access to the nested elements, so a Vector with Vectors stored within etc.

Sample code:

JAVA:

public ActionForward execute(..)
{
Vector test=new Vector();
Vector test2=new Vector();
test.add("test1");
test.add("test2");
test.add("test3");
test.add("test4");
test2.add(test);
test2.add(test);
request.setAttribute("test",test2);
return mapping.findForward("success");
}

JSP:
<logic:present name="test".
<logic:iterate id="myTest" name="test">
Element value: <bean:write name="myTest" /><br/>
<nested:root name="myTest">
<nested:iterate id="myTestInner" name="myTest">
Inner element value: <bean:write name="myTestInner" /><br/>
</nested:iterate>
</nested:root>
</logic:iterate>
</logic:present>
  |  permalink  |  related link  |  
Eclipse editor acting weird after key combination 
Monday, December 19, 2005, 04:00 PM - Java
Symptom

You pressed a key combination concerning <SHIFT>,<CTRL> and <-, and now the eclipse v3.2 editor acts weird. No inserts of characters possible, however deletes of characters are possible. Also using the arrows controls the scrollbar for the up/down arrow and jumps words for the left/right arrow.

What is wrong

You hit a key combination which put you in a different editing mode, or you are straight in a bug. I have not been able to reproduce it yet.

Solution

The correct solution is to reset the editing mode with the menu:
windows->Navigation->Activate Editor <F12>
  |  permalink  |  
java.sql.SQLException: Can not issue data manipulation statements with executeQuery(). 
Thursday, December 8, 2005, 03:46 PM - Java, MySQL
Symptom

While using JDBC, you get the following exception:
java.sql.SQLException: Can not issue data manipulation statements with executeQuery()
The query you wrote has INSERT, UPDATE or DELETE in it.

Solution

The JDBC standard does not allow this. So alter your way of executing the PreparedStatement.
Execute this with execute() or executeUpdate() instead of the very general executeQuery.
ExecuteQuery is only for real queries returning only values, not doing any data manipulation at all.
  |  permalink  |  
Tomcat parse exception in web.xml 
Tuesday, December 6, 2005, 05:15 PM - Java
Symptom

In the logfiles of your tomcat you find the following error:
Parse error in application web.xml
java.lang.ClassNotFoundException: org.apache.catalina.Container

Solution

Apparently one of the jars you copied or linked to the tomcat/common/lib has caused a strange conflict. Remove the last added jar(s) and start tomcat again. Now tomcat starts again, except that your application still does not run.
The class/jar you copied should have been in tomcat/shared/lib. Copy or link the jar to that location, and the error will disappear, while the added jar should work.
  |  permalink  |  
Exception opening database connection java.sql.SQLException: com.mysql.jdbc.Driver 
Tuesday, December 6, 2005, 03:55 PM - Java, MySQL
Symptom

Trying to start tomcat, but it will not load because of the following exception:
Exception opening database connection
java.sql.SQLException: com.mysql.jdbc.Driver
etc.

Solution

Download the mysql jdbc connector from www.mysql.com and put it in the tomcat/common/lib directory. The driver will now load.
  |  permalink  |  
Tomcat java.lang.NoClassDefFoundError 
Tuesday, December 6, 2005, 03:14 PM - Java
Symptom

java.lang.NoClassDefFoundError: some class exception in the logfile of Tomcat.

Solution

Add the jar class to the tomcat/common/lib directory.
Restart Tomcat and the exception will be gone.
  |  permalink  |  

Next