Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started



kallmekunal_131749 avatar image
kallmekunal_131749 asked Cedrick Lunven edited

CassandraMapperBuilder classes not getting generated while running individual jUnit

I have somewhat below code for my mapper interface:

public interface CassandraMapper {

    AccountAccessors accountDao();

    ServerAccessor ServerDao();

    RuleAccessor ruleDao();

    RegistrationAccessor registrationDao();

    DeletionAccessor deletionDao();

    EventForwardingAccessor eventForwardingDao();

    Serverchallenge serverChallengeDao();

    MetricDetialAccessor metricDetailDao();

    static MapperBuilder<CassandraMapper> builder(CqlSession session) {
        return new CassandraMapperBuilder(session);

there are few junits written on top of this and all the junits are working fine.

But when i individually run the junit it gives me compilation error like :

java: cannot find symbol
symbol: class CassandraMapperBuilder
location: interface packagepath.CassandraMapper

Please help.

Seems when junits are run individually CassandraMapperBuilder class is not getting generated in intellij

java driver
1 comment
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

When i am saying i am individually running junit..maven compiles the sources and during that it looks into the above class and could not fine the mapperbuilder in builder method and hence comes the compilation error.while on mvn clean install seems it gets the class is probably related to settings in intellij but what i do not know.Please help.

[Converted answer to a comment]

0 Likes 0 ·
Erick Ramirez avatar image
Erick Ramirez answered

I haven't encountered this problem before so I'm not sure what is going on. But as you stated, I also suspect that this is environmental and specific to your configuration.

I'm going to ask around to see if anyone can provide some clues. Cheers!

10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Cedrick Lunven avatar image
Cedrick Lunven answered Cedrick Lunven edited


The classes like `@Mapper` are generated by something call an annotation processor that will run at compilation/packaging.

Build will not fail. Now, maybe, when you execute a single Junit IntelliJ will not rebuild the project.

Here are some insights. You can setup IntelliJ to build automatically when you execute a test. You can also try to enforce the mapper to run at compile time try to add


Also this project might some use for you

Have a great day

10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.