将GlassFish用于我的应用服务器。
javax.xml.bind.JAXBException:ClassCastException:尝试强制转换 bundle://2.0:1 / javax / xml / bind / JAXBContext.class to 罐子:文件:/用户/.../ glassfish3 / GlassFish中/模块/核准/ JAXB-API osgi.jar /javax/xml/bind/JAXBContext.class。 请确保您指定了正确的ClassLoader。
以下是我的hibernate.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="hibernate.connection.url">
jdbc:mysql://localhost:8889/gestione_autotrasporti
</property>
<property name="hibernate.connection.username">
admin
</property>
<property name="hibernate.connection.password">
admin
</property>
</session-factory>
</hibernate-configuration>