cancel
Showing results for 
Search instead for 
Did you mean: 

JPA: Persist binary data (byte array)

patrik_spiess
Participant
0 Kudos

Hi,

when trying to add a field to an entity to hold binary data as a Byte[] (array of objects) NWDS "finds" the following error:

Class with name '[Ljava.lang.Byte;' not found

If the field is of type byte[] (array of primitives):

Class with name '[B' not found

However, according to the JEE Tutorial (page 686), byte array and Byte array are valid types. Is the JPA implementation lacking this feature or am I missing something? Here the field declaration, including the annotations:

	@Column(name="IMPL_BINARY")
	@Lob
	private byte[] implBinary;

Thank you for your help in advance.

Cheers,

Patrik

Accepted Solutions (1)

Accepted Solutions (1)

Vlado
Advisor
Advisor
0 Kudos

Looks like you're using JDK 6 and Eclipse/WTP has the issue described [here|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6500212]. JDK 6 is not supported as runtime yet anyway, so even if you had been able to build your project, it would not run on the server. Therefore, I'd suggest that you switch to JDK 1.5.

HTH!

\-- Vladimir

patrik_spiess
Participant
0 Kudos

Thanks Vladimir,

this tip really helped. However, it was not working only by setting the standard VM to JDK 5.0 in NWDS, but I also had to change the shortcut that had the used VM hardwired as a command line parameter.

Cheers,

Patrik

Answers (0)