Error: Could not find or load main class

i am facing this problem i dont know what to do now ! Can anyone help me upon this ?
package com.demo.journalApp;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.MongoDatabaseFactory;
import org.springframework.data.mongodb.MongoTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@EnableTransactionManagement
@Configuration
@EnableAutoConfiguration
public class JournalApplication {

public static void main(String[] args) {
SpringApplication.run(JournalApplication.class, args);
}

@Bean
PlatformTransactionManager add(MongoDatabaseFactory db) {
return new MongoTransactionManager(db);
}

}
package com.demo.journalApp;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.MongoDatabaseFactory;
import org.springframework.data.mongodb.MongoTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@EnableTransactionManagement
@Configuration
@EnableAutoConfiguration
public class JournalApplication {

public static void main(String[] args) {
SpringApplication.run(JournalApplication.class, args);
}

@Bean
PlatformTransactionManager add(MongoDatabaseFactory db) {
return new MongoTransactionManager(db);
}

}
7 Replies
JavaBot
JavaBot2mo ago
This post has been reserved for your question.
Hey @Danix! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Danix
DanixOP2mo ago
@dan1st can u help ?
ayylmao123xdd
ayylmao123xdd2mo ago
show the whole error logs maybe
dan1st
dan1st2mo ago
How do you run the program?
_trunk_
_trunk_2mo ago
clean and rebuild your project
dan1st
dan1st2mo ago
I guess you might be running the wrong class
JavaBot
JavaBot2mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?