4

I have a java class with a member:

@Entity
public class TypeA {
    ...
    @Reference(lazy = true) private TypeB anObj;
    ...
}

Now when I do a datastore.find(TypeA.class).asList().get(0), the reference also gets loaded and I get the message "WARNING: Lazy loading impossible due to missing dependencies." logged to the console.

What are the dependencies I'm missing and how do I include them?

1 Answer 1

5

You'll need to add this to your pom.xml (if you're using maven):

<dependency>
    <groupId>cglib</groupId>
    <artifactId>cglib-nodep</artifactId>
    <version>[2.1_3,3.0)</version>
    <type>jar</type>
    <optional>true</optional>
</dependency>
<dependency>
    <groupId>com.thoughtworks.proxytoys</groupId>
    <artifactId>proxytoys</artifactId>
    <version>1.0</version>
    <type>jar</type>
    <optional>true</optional>
</dependency>
Sign up to request clarification or add additional context in comments.

3 Comments

Hey, I'm actually pretty new to java and am not using Maven. Either ways, what does this code do?
OK. If you were using maven, this would add those jars to your classpath and then java could find the classes it needs. Since you're not using maven you'll have to download them and add them your classpath manually. You find those jars here: search.maven.org/remotecontent?filepath=cglib/cglib-nodep/3.0/… search.maven.org/remotecontent?filepath=com/thoughtworks/…
could you please help how can I add these dependencies to a wildlfly server as a module? We are using morphia 1.3.0-SNAPSHOT but we have the same issue like Gautham.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.