Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ljava.lang.String class cannot be resolved in persistence.xml

I am using JBoss Developer Studio. I have a project with a persistence.xml file. The file is perfect to me, but I keep getting this error on the tab that lists all the Problems of my project.

Class "[Ljava.lang.String;@22ec7158" cannot be resolved

I include the picture for a better context.

enter image description here

When I click on the error, so that it takes me to the place where the error is happening, it takes me to the end of the file.

Persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="Persistence">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>java:jboss/datasources/MemberOfferDS</jta-data-source>
    <class>com.bbb.memberoffer.model.SycsCoordinator</class>
    <class>com.bbb.aicweb.memberoffer.model.SycsCoordinatorPhoneNumber</class>
    <class>com.bbb.memberoffer.model.SycsCoordinatorClub</class>
    <class>com.bbb.memberoffer.model.SycsCoordinatorSecurityGroup</class>
    <class>com.bbb.memberoffer.model.SycsCoordinatorClubPk</class>
    <class>com.bbb.memberoffer.model.PhoneNumberType</class>
    <class>com.bbb.memberoffer.model.Club</class>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties>
        <!-- Not sure if this is the right one to use or not? -->
        <property name='hibernate.show_sql' value='true' />
        <property name='hibernate.format_sql' value='true' />
        <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
    </properties>
</persistence-unit>
</persistence>
like image 501
Jadiel de Armas Avatar asked Mar 17 '15 12:03

Jadiel de Armas


1 Answers

You may have solved this already, however, in my case the problem was caused by referencing a class in a element that no longer existed.

EDIT: The exact reason for this type of error message is that the error generator is trying to run a toString() on a String array when it generates the error message.

like image 167
Dan Smith Avatar answered Oct 12 '22 23:10

Dan Smith