Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jakarta data support not working in wildfly 34 beta. I am getting error while adding @Repository in repo class #666

Open
naveena2208 opened this issue Oct 5, 2024 · 1 comment

Comments

@naveena2208
Copy link

12:14:28,821 WARN [org.jboss.modules.define] (Weld Thread Pool -- 3) Failed to define class com.nokia.mywfm.mavenproject1.resources.TestRepo in Module "deployment.mavenproject1-1.0-SNAPSHOT.war" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link com/nokia/mywfm/mavenproject1/resources/TestRepo (Module "deployment.mavenproject1-1.0-SNAPSHOT.war" from Service Module Loader): jakarta/data/repository/BasicRepository
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1090)
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:351)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:482)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:276)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:79)
at org.jboss.modules.Module.loadModuleClass(Module.java:798)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:192)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:408)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:396)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:115)
at org.jboss.as.weld@34.0.0.Beta1//org.jboss.as.weld.WeldModuleResourceLoader.classForName(WeldModuleResourceLoader.java:51)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.bootstrap.AnnotatedTypeLoader.loadClass(AnnotatedTypeLoader.java:86)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.bootstrap.AnnotatedTypeLoader.loadAnnotatedType(AnnotatedTypeLoader.java:65)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.bootstrap.FastAnnotatedTypeLoader.loadAnnotatedType(FastAnnotatedTypeLoader.java:112)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:87)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:55)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:52)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)
Caused by: java.lang.ClassNotFoundException: jakarta.data.repository.BasicRepository from [Module "deployment.mavenproject1-1.0-SNAPSHOT.war" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:200)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:408)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:396)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:115)
... 26 more

12:14:28,822 WARN [org.jboss.modules.define] (Weld Thread Pool -- 4) Failed to define class com.nokia.mywfm.mavenproject1.resources.TestRepo in Module "deployment.mavenproject1-1.0-SNAPSHOT.war" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link com/nokia/mywfm/mavenproject1/resources/TestRepo (Module "deployment.mavenproject1-1.0-SNAPSHOT.war" from Service Module Loader): jakarta/data/repository/BasicRepository
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1090)
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:351)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:482)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:276)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:79)
at org.jboss.modules.Module.loadModuleClass(Module.java:798)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:192)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:408)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:396)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:115)
at java.base/java.lang.Class.getDeclaredFields0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3297)
at java.base/java.lang.Class.getDeclaredFields(Class.java:2371)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.annotated.slim.backed.SecurityActions.getDeclaredFields(SecurityActions.java:49)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedFields.computeValue(BackedAnnotatedType.java:188)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedFields.computeValue(BackedAnnotatedType.java:182)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.util.LazyValueHolder.get(LazyValueHolder.java:46)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$EagerlyInitializedLazyValueHolder.(BackedAnnotatedType.java:165)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedFields.(BackedAnnotatedType.java:182)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedFields.(BackedAnnotatedType.java:182)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.(BackedAnnotatedType.java:71)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.of(BackedAnnotatedType.java:52)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.apply(ClassTransformer.java:84)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.apply(ClassTransformer.java:79)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.lambda$new$0(ReentrantMapBackedComputingCache.java:57)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.util.WeakLazyValueHolder$1.computeValue(WeakLazyValueHolder.java:35)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.util.WeakLazyValueHolder.get(WeakLazyValueHolder.java:53)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.getValue(ReentrantMapBackedComputingCache.java:74)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.getCastValue(ReentrantMapBackedComputingCache.java:80)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:184)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:201)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.bootstrap.FastAnnotatedTypeLoader.loadSlimAnnotatedType(FastAnnotatedTypeLoader.java:128)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.bootstrap.FastAnnotatedTypeLoader.createContext(FastAnnotatedTypeLoader.java:118)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.bootstrap.FastAnnotatedTypeLoader.loadAnnotatedType(FastAnnotatedTypeLoader.java:97)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:87)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:55)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:52)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
at org.jboss.weld.core@5.1.3.Final//org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)
Caused by: java.lang.ClassNotFoundException: jakarta.data.repository.BasicRepository from [Module "deployment.mavenproject1-1.0-SNAPSHOT.war" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:200)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:408)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:396)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:115)
... 46 more

repo class:

package com.nokia.mywfm.mavenproject1.resources;

import jakarta.data.repository.BasicRepository;
import jakarta.data.repository.Repository;
import entity.Test;

/**
*

  • @author naveenap
    */
    @repository
    public interface TestRepo extends BasicRepository<Test, Integer> {

}

pom.xml


4.0.0
com.nokia.mywfm
mavenproject1
1.0-SNAPSHOT
war
mavenproject1-1.0-SNAPSHOT

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.release>17</maven.compiler.release>
</properties>

<dependencies>
    <dependency>
       <groupId>jakarta.platform</groupId>
        <artifactId>jakarta.jakartaee-api</artifactId>
        <version>11.0.0-M2</version>
        <scope>provided</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
com.microsoft.sqlserver mssql-jdbc 12.4.1.jre11
 <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.11.0</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>3.3.2</version>
        </plugin>
        
    </plugins>
</build>
@bstansberry
Copy link
Contributor

Sorry, @naveena2208 -- this integration happened late and we didn't have time to add much in the way of docs. I plan to blog about it -- see #670.

I think your problem is you are missing the things discussed in the 'Build-time Generation of Repository Implementations' section of that post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants