• Register
0 votes
177 views

I wrote a java code that gives some error:

  Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
 at org.hibernate.boot.spi.XmlMappingBinderAccess.<init>(XmlMappingBinderAccess.java:43)
 at org.hibernate.boot.MetadataSources.<init>(MetadataSources.java:87)
 at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:208)
 at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:163)
 at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:51)
 at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:358)
 at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:384)
 at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:373)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1763)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1700)
 ... 25 common frames omitted

Can anyone help me out with this?

10 7 2
6,060 points

Please log in or register to answer this question.

1 Answer

0 votes
As Java not yet removed from module from java 9. Java has only deprecated and does not add javax.xml.bind module on classpath by default.So if we want to add javax.xml.bind on classpath we can add using following command:
 --add-modules java.xml.bind
We can use Maven and Gradle to include javax.xml.bind in our project.
Maven :
                 <dependency>
                 <groupId>javax.xml.bind</groupId>
                 <artifactId>jaxb-api</artifactId>
                 <version>2.3.0</version>
                 </dependency> 
Gradle:
compile 'javax.xml.bind:jaxb-api:2.3.0'

 

11 6 4
34,950 points

Related questions

0 votes
1 answer 8 views
0 votes
1 answer 41 views
0 votes
1 answer 19 views
19 views
why can Java 9 no longer find these classes?
asked Dec 24, 2020 TeamScript 10.3k points
0 votes
1 answer 16 views
16 views
Can you please tell me the root cause?
asked Dec 26, 2020 TeamScript 10.3k points
0 votes
1 answer 1.1K views
1.1K views
Problem : I have come across a below run-time error from the JPA 2.0 program I think it is related to the Firefox Profile for some reason: Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Maps at org.openqa.selenium.firefox. ... it is supported by my Selenium Webdriver but I suspect that above issue is to do with not able to read the profile directory.
asked Feb 3, 2020 jwilliam 3.9k points
0 votes
1 answer 689 views
689 views
Problem : I am trying to invoke the testng programmatically. And not the eclipse plug-in. I have associated the "testng-6.8.21.jar" and I am running it through eclipse and I tried to run below code: import org.testng.TestNG; public ... .ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 1 more
asked Jan 31, 2020 jwilliam 3.9k points
0 votes
1 answer 6 views
0 votes
1 answer 4 views
4 views
Please help me.
asked 3 days ago TeamScript 10.3k points
0 votes
1 answer 6 views
6 views
Thank you in advance for any help?
asked Jan 5 TeamScript 10.3k points
0 votes
1 answer 8 views
8 views
Help me by solving this problem.
asked Jan 2 TeamScript 10.3k points