Error List

Error List for the ‘Java’ Category

You cannot have two plugin executions with the same (or missing) elements error

UnsupportedEncodingException when invoking getContent() on a bodypart that contains text data

Applies to:
NA

Description:
Occurs when invoking getContent() method on a bodypart that contains text data.

Cause:
Textual bodyparts (i.e., bodyparts whose type is “text/plain”, “text/html”, or “text/xml”) return Unicode String objects when getContent() is used. Typically, such bodyparts internally hold their textual data in some non Unicode charset. JavaMail (through the corresponding DataContentHandler) attempts to convert that data into a Unicode string. The underlying JDK’s charset converters are used to do this. If the JDK does not support a particular charset, then the UnsupportedEncodingException is thrown.

JAVA-Mail , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

java.rmi.NoSuchObjectException

Applies to:
JBoss

Description:
When you export a RemoteObject via RMI, the RMI server keeps a map of “object id” to the server side skeleton that is used to locate and invoke upon the exported object.
These mappings (object ids) only last for the duration of the JVM.

* If you reboot, you don’t get the same object id.
* If you export on a different server you get a different object id.
* If you rebind, you get a different object id.
The remote stub given to the client holds this object id. It also holds the ip address or host name of the server.

Cause:
a. You rebooted the server
If you reboot the server, any remote stub held by clients are now invalid.

b. You contacted the wrong server
You have some bad dns/bind configuration that means the remote stub holds the wrong ip address or host name.

c. The remote object is no longer bound on the server
* You undeployed the remote object (if it was explicitly bound).
* If it was implicitly bound, e.g. passed as a parameter on an RMI request, the distributed GC has decided that nobody is using it – nothing in JBoss uses implicit binding

d. Your DNS’ localhost is set to loopback, 127.0.0.1
Alter /etc/hosts to have the localhost entry match the IP address of your machine. Also some Linux distros (e.g. Ubuntu) add an entry matching the hostname to 127.0.1.1. This entry will need to be changed to the IP address of your machine, too.

JAVA-JBoss , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

NoClassDefFoundError when trying to test JUnit

JNI_CreateJavaVM always returns -1

Applies to:
JNI

Description:
Occurs while using JNI.

Cause:
Usually, the problem is that you moved or copied the jvm.dll file. The location of jvm.dll is important, it has to be in the directory /bin/classic. This jvm.dll finds the location of other DLLs relative to its current location. So if you move it, or Windows uses some other copy of jvm.dll, the JVM will not be able to find java.dll, for instance.

JAVA-JNI , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

java.lang.NoClassDefFoundError while using Ant

Applies to:
Ant 1.6.x

Description:
Occurs while using Apache Ant.

Cause:
You have installed Ant 1.6.x and now get Exception in thread “main” java.lang.NoClassDefFoundError. The cause of this is that there is an old version of ant somewhere in the class path or configuration.

JAVA-Tools , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

AnnotationException: No identifier specified for entity

Applies to:
Hibernate

Description:
Annotation related exception.

Cause:
You have not set @Id annotation.

JAVA-Hibernate , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

MethodNotSupportedException while deleting messages on a POP3 server

Applies to:
NA

Description:
Occurs while deleting messages on a POP3 server

Cause:
You have set the DELETED flag on some messages. Then You have called the expunge() method, but the expunge() method is not supported by the POP3 provider.

JAVA-Mail ,

IOException ping timeout

Applies to:
JBossMQ

Description:
Each connection pings the server once every PingPeriod. This is configured on the ConnectionFactory (e.g. jms/deploy/uil2-service.xml) and defaults to 60 seconds.
Its purpose is for the client to be able detect that the connection with the server has been broken.

The mechanism is as follows:
1. Client sends a ping to the server and rests for the PingPeriod
2. After the PingPeriod has expired it checks that it got a Pong from the server
3. Repeat from 1

Cause:
1. The connection is broken, use Connection.setExceptionListener() to handle broken connections (usually by closing the old connection and reconnecting)
2. Something horrible is going on, e.g. very long garbage collections or massive amounts of paging means the ping/pong doesn’t get enough cpu to process in time i.e. either the client or server is failing big time to keep up with requests
3. You send a large message that takes more than PingPeriod to send over the connection, the ping or pong waits behind the message for its turn to be processed UIL2 has a ChunkSize that simulates a Pong when that many bytes are sent over the network to avoid this problem.
4. Some other problem like a deadlock see READTHISFIRST for how to debug this.

JAVA-JBoss , , , , , , , , , , , , , , , ,

NullPointerException in PortletAction when trying to retrieve a VelocityPortletContext

Applies to:
Jetspeed

Description:
In Your action class extending JspPortletAction, You have tried to use the setTemplate method, but it did not work. It thrown a NullPointerException in PortletAction when trying to retrieve a “VelocityPortletContext” (how surprising when working with a JSPPortlet)

Cause:
Most common mistake with portlets is to use the hidden action variable and set it to the portlet’s action class:

In the above example, Turbine executes the action before the portlet and therefore the context is null.

JAVA-Jetspeed , , , , , , ,