You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Raffaele Gambelli <Ra...@cegeka.com.INVALID> on 2024/06/17 15:28:45 UTC
The import org.apache.jackrabbit.guava cannot be resolved
Hi all,
I would like to start exploring oak, I've imported full project in Eclipse STS but everywhere there is an import to org.apache.jackrabbit.guava I have errors.
I have this kind of problem even if I create an hello-world project depending on oak-core, when I run the application it says:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/jackrabbit/guava/common/base/Predicate
at org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore.<init>(MemoryNodeStore.java:73)
at it.cegeka.oak.Hello.main(Hello.java:15)
Caused by: java.lang.ClassNotFoundException: org.apache.jackrabbit.guava.common.base.Predicate
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
... 2 more
I cannot find any class named org.apache.jackrabbit.guava.common.base.Predicates, could you help me?
If I run mvn clean install or run my hello world main class from command line it works, but I would like run it in eclipse to debug.
Thanks
Cordiali saluti / Best regards,
Raffaele Gambelli
Senior Java Developer
E Raffaele.Gambelli@cegeka.com<ma...@cegeka.com>
[CEGEKA] Via Ettore Cristoni, 84
IT-40033 Bologna (IT), Italy
T +39 02 2544271
WWW.CEGEKA.COM<https://www.cegeka.com>
[http://signature.cegeka.com/SignatureRO/bannerRO.jpg]
Re: The import org.apache.jackrabbit.guava cannot be resolved
Posted by Raffaele Gambelli <Ra...@cegeka.com.INVALID>.
Ok Julian, it was enough closing the project of oak-shaded-guava, there is no need of exclusion.
Thanks again
Cordiali saluti / Best regards,
Raffaele Gambelli
Senior Java Developer
E Raffaele.Gambelli@cegeka.com<ma...@cegeka.com>
[CEGEKA] Via Ettore Cristoni, 84
IT-40033 Bologna (IT), Italy
T +39 02 2544271
WWW.CEGEKA.COM<https://www.cegeka.com/>
[http://signature.cegeka.com/SignatureRO/bannerRO.jpg]
________________________________
From: Raffaele Gambelli <Ra...@cegeka.com.INVALID>
Sent: Monday, June 17, 2024 6:03 PM
To: oak-dev@jackrabbit.apache.org <oa...@jackrabbit.apache.org>
Subject: Re: The import org.apache.jackrabbit.guava cannot be resolved
Thanks Julian but unfortunately it didn't worked:
I have already built oak-shaded-guava and everything other from command line, anyway I've rebuilt oak-shaded-guava, in its target I have its jar 1.64.0, then I have added the exclusion in the pom of my very very simple hello-world project:
<dependencies>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-core</artifactId>
<version>1.64.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-shaded-guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-jcr</artifactId>
<version>1.64.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-shaded-guava</artifactId>
</exclusion>
</exclusions>
</dependency>
but when I run it from Eclipse I have again same errors:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/jackrabbit/guava/common/base/Predicate
at org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore.<init>(MemoryNodeStore.java:73)
at it.cegeka.oak.Hello.main(Hello.java:24)
Caused by: java.lang.ClassNotFoundException: org.apache.jackrabbit.guava.common.base.Predicate
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
... 2 more
if you have a working code built in eclipse could you share with me?
Cordiali saluti / Best regards,
Raffaele Gambelli
Senior Java Developer
E Raffaele.Gambelli@cegeka.com<ma...@cegeka.com>
[CEGEKA] Via Ettore Cristoni, 84
IT-40033 Bologna (IT), Italy
T +39 02 2544271
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cegeka.com%2F&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7Ca8838661d646425d4bab08dc8ee70601%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638542370134753395%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=h6zLSKLBjPFraH3iul5GusKunKVMBQdcnFvdbS8hZak%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.cegeka.com%2F&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7Ca8838661d646425d4bab08dc8ee70601%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638542370134764369%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=%2FsD1l0HT2cgNnZ6%2Bbb6z0BUM95aLt5B7FdurMreLwNg%3D&reserved=0><http://www.cegeka.com/>
[https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsignature.cegeka.com%2FSignatureRO%2FbannerRO.jpg&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7Ca8838661d646425d4bab08dc8ee70601%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638542370134774399%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=EZL37NOdg0m%2BTeH6y7lKZNqrnAfA9L6bQBjwvXneai4%3D&reserved=0<http://signature.cegeka.com/SignatureRO/bannerRO.jpg>]
________________________________
From: Julian Reschke <ju...@gmx.de.INVALID>
Sent: Monday, June 17, 2024 5:34 PM
To: oak-dev@jackrabbit.apache.org <oa...@jackrabbit.apache.org>
Subject: Re: The import org.apache.jackrabbit.guava cannot be resolved
[You don't often get email from julian.reschke@gmx.de.invalid. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Am 17.06.2024 um 17:28 schrieb Raffaele Gambelli:
> Hi all,
>
> I would like to start exploring oak, I've imported full project in Eclipse STS but everywhere there is an import to org.apache.jackrabbit.guava I have errors.
Eclipse's Maven support doesn't understand the shade plugin, so
1) you need to build oak-shaded-guava with maven from the command line, and
2) *exclude* that module when you import the project (or remove it once
you imported "everything").
> I have this kind of problem even if I create an hello-world project depending on oak-core, when I run the application it says:
>
> Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/jackrabbit/guava/common/base/Predicate
> at org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore.<init>(MemoryNodeStore.java:73)
> at it.cegeka.oak.Hello.main(Hello.java:15)
> Caused by: java.lang.ClassNotFoundException: org.apache.jackrabbit.guava.common.base.Predicate
> at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
> at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
> ... 2 more
>
> I cannot find any class named org.apache.jackrabbit.guava.common.base.Predicates, could you help me?
It's generated using the "shade" plugin within oak-shaded-guava.
> If I run mvn clean install or run my hello world main class from command line it works, but I would like run it in eclipse to debug.
>
> Thanks
>
> Cordiali saluti / Best regards,
>
> Raffaele Gambelli
> Senior Java Developer
> E Raffaele.Gambelli@cegeka.com<ma...@cegeka.com>
>
> [CEGEKA] Via Ettore Cristoni, 84
> IT-40033 Bologna (IT), Italy
> T +39 02 2544271
> https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cegeka.com%2F&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7Ca8838661d646425d4bab08dc8ee70601%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638542370134782958%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=m%2B4vH%2B2ZI2irVzfsAdFDf%2Bbq%2BqdX1QlNPccV8l8FPkE%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.cegeka.com%2F&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7Ca8838661d646425d4bab08dc8ee70601%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638542370134788188%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=ixfJ7H0X57MO4PC4fw2BDjeseMPy%2BUD2RALzxcSNxpw%3D&reserved=0><https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cegeka.com%2F&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7Ca8838661d646425d4bab08dc8ee70601%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638542370134792566%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=j721LXCcNxfUo8smmS1XEAhVcOQVYNP%2FGK35lc9xjV8%3D&reserved=0><http://www.cegeka.com/>
>
> [https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsignature.cegeka.com%2FSignatureRO%2FbannerRO.jpg&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7Ca8838661d646425d4bab08dc8ee70601%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638542370134796628%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=%2BkvqZxXLAI7aXAiRKoZ%2BmAbKGrV76ej20x3l6H8fKvY%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsignature.cegeka.com%2FSignatureRO%2FbannerRO.jpg&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7Ca8838661d646425d4bab08dc8ee70601%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638542370134800587%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=u29%2Bp3n10O%2FB84RhjOJ8lgwDDBNy8yksLzv0UqWSYMY%3D&reserved=0<http://signature.cegeka.com/SignatureRO/bannerRO.jpg>>]
Best regards, Julian
Re: The import org.apache.jackrabbit.guava cannot be resolved
Posted by Raffaele Gambelli <Ra...@cegeka.com.INVALID>.
Thanks Julian but unfortunately it didn't worked:
I have already built oak-shaded-guava and everything other from command line, anyway I've rebuilt oak-shaded-guava, in its target I have its jar 1.64.0, then I have added the exclusion in the pom of my very very simple hello-world project:
<dependencies>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-core</artifactId>
<version>1.64.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-shaded-guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-jcr</artifactId>
<version>1.64.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-shaded-guava</artifactId>
</exclusion>
</exclusions>
</dependency>
but when I run it from Eclipse I have again same errors:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/jackrabbit/guava/common/base/Predicate
at org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore.<init>(MemoryNodeStore.java:73)
at it.cegeka.oak.Hello.main(Hello.java:24)
Caused by: java.lang.ClassNotFoundException: org.apache.jackrabbit.guava.common.base.Predicate
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
... 2 more
if you have a working code built in eclipse could you share with me?
Cordiali saluti / Best regards,
Raffaele Gambelli
Senior Java Developer
E Raffaele.Gambelli@cegeka.com<ma...@cegeka.com>
[CEGEKA] Via Ettore Cristoni, 84
IT-40033 Bologna (IT), Italy
T +39 02 2544271
WWW.CEGEKA.COM<https://www.cegeka.com/>
[http://signature.cegeka.com/SignatureRO/bannerRO.jpg]
________________________________
From: Julian Reschke <ju...@gmx.de.INVALID>
Sent: Monday, June 17, 2024 5:34 PM
To: oak-dev@jackrabbit.apache.org <oa...@jackrabbit.apache.org>
Subject: Re: The import org.apache.jackrabbit.guava cannot be resolved
[You don't often get email from julian.reschke@gmx.de.invalid. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Am 17.06.2024 um 17:28 schrieb Raffaele Gambelli:
> Hi all,
>
> I would like to start exploring oak, I've imported full project in Eclipse STS but everywhere there is an import to org.apache.jackrabbit.guava I have errors.
Eclipse's Maven support doesn't understand the shade plugin, so
1) you need to build oak-shaded-guava with maven from the command line, and
2) *exclude* that module when you import the project (or remove it once
you imported "everything").
> I have this kind of problem even if I create an hello-world project depending on oak-core, when I run the application it says:
>
> Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/jackrabbit/guava/common/base/Predicate
> at org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore.<init>(MemoryNodeStore.java:73)
> at it.cegeka.oak.Hello.main(Hello.java:15)
> Caused by: java.lang.ClassNotFoundException: org.apache.jackrabbit.guava.common.base.Predicate
> at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
> at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
> ... 2 more
>
> I cannot find any class named org.apache.jackrabbit.guava.common.base.Predicates, could you help me?
It's generated using the "shade" plugin within oak-shaded-guava.
> If I run mvn clean install or run my hello world main class from command line it works, but I would like run it in eclipse to debug.
>
> Thanks
>
> Cordiali saluti / Best regards,
>
> Raffaele Gambelli
> Senior Java Developer
> E Raffaele.Gambelli@cegeka.com<ma...@cegeka.com>
>
> [CEGEKA] Via Ettore Cristoni, 84
> IT-40033 Bologna (IT), Italy
> T +39 02 2544271
> https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cegeka.com%2F&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7C5e55ca311af24da0710508dc8ee2f7ff%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638542352673171240%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=3DI9mpiNWerzNmK6yDbLqSaUydWPD%2FajbLEUWB9i3IM%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.cegeka.com%2F&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7C5e55ca311af24da0710508dc8ee2f7ff%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638542352673179621%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=kGrPz8pkKQicmMiYhSfMHN5CVkma913UeUVUa34gOdo%3D&reserved=0><http://www.cegeka.com/>
>
> [https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsignature.cegeka.com%2FSignatureRO%2FbannerRO.jpg&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7C5e55ca311af24da0710508dc8ee2f7ff%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638542352673185490%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=WW8rjYm86wytGOTMKar3At8mH52Xx1%2FiYBV8FqisGGc%3D&reserved=0<http://signature.cegeka.com/SignatureRO/bannerRO.jpg>]
Best regards, Julian
Re: The import org.apache.jackrabbit.guava cannot be resolved
Posted by Julian Reschke <ju...@gmx.de.INVALID>.
Am 17.06.2024 um 17:28 schrieb Raffaele Gambelli:
> Hi all,
>
> I would like to start exploring oak, I've imported full project in Eclipse STS but everywhere there is an import to org.apache.jackrabbit.guava I have errors.
Eclipse's Maven support doesn't understand the shade plugin, so
1) you need to build oak-shaded-guava with maven from the command line, and
2) *exclude* that module when you import the project (or remove it once
you imported "everything").
> I have this kind of problem even if I create an hello-world project depending on oak-core, when I run the application it says:
>
> Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/jackrabbit/guava/common/base/Predicate
> at org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore.<init>(MemoryNodeStore.java:73)
> at it.cegeka.oak.Hello.main(Hello.java:15)
> Caused by: java.lang.ClassNotFoundException: org.apache.jackrabbit.guava.common.base.Predicate
> at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
> at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
> ... 2 more
>
> I cannot find any class named org.apache.jackrabbit.guava.common.base.Predicates, could you help me?
It's generated using the "shade" plugin within oak-shaded-guava.
> If I run mvn clean install or run my hello world main class from command line it works, but I would like run it in eclipse to debug.
>
> Thanks
>
> Cordiali saluti / Best regards,
>
> Raffaele Gambelli
> Senior Java Developer
> E Raffaele.Gambelli@cegeka.com<ma...@cegeka.com>
>
> [CEGEKA] Via Ettore Cristoni, 84
> IT-40033 Bologna (IT), Italy
> T +39 02 2544271
> WWW.CEGEKA.COM<https://www.cegeka.com>
>
> [http://signature.cegeka.com/SignatureRO/bannerRO.jpg]
Best regards, Julian