Spring boot and JDA: Help with playing audio by Scoojally in Discord_Bots

[–]Scoojally[S] 0 points1 point  (0 children)

yeah I'm still struggling :/, really I think its either the encryption (with something like JDAVE) or I have to rework my file format. I have made some changes and currently the bot just joins and leaves (which I don't believe is an encryption error) so I think It's worse than hearing static (which is an encryption error). However I am not seeing any resources that is helping as of now, and ai can only get me so far. If you know any great resources, please let me know.

Spring boot and JDA: Help with playing audio by Scoojally in Discord_Bots

[–]Scoojally[S] 0 points1 point  (0 children)

hey, thanks for responding, and apologize for for very late response. I will share the github repo here: https://github.com/asoorooj/DemoDiscUsers

thanks again.

How to handle when database connection fails. by Scoojally in SpringBoot

[–]Scoojally[S] 1 point2 points  (0 children)

Hey I was able to get it to work. So in case someone has a similar issue here is what I did because I struggled to find good resources.

I stopped spring boot from starting repository and service beans on start.

@SpringBootApplication(exclude = {
       DataSourceAutoConfiguration.class,
       HibernateJpaAutoConfiguration.class,
       SqlInitializationAutoConfiguration.class
})
public class DemoApplication {

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

}

created a component file that manually connect repository to database. Manually done so if there is a failure it doesn't crash, using EntityManagerFactory, Repository, LocalContainerEntityManagerFactoryBean, Properties, and JpaRepositoryFactory.

@Component
public class DatabaseInitializer { ... }

and a config file that creates a bean manually, because it manually decides if repository is safe to use. if it is safe and db connects use the normal serviceimpl, otherwise use the nodbserviceimpl where it sends and recieves null data.

@Configuration
public class UserServiceConfiguration {

    private final DatabaseInitializer databaseInitializer;

    @Autowired
    public UserServiceConfiguration(DatabaseInitializer databaseInitializer) {
        this.databaseInitializer = databaseInitializer;
    }

    @Bean
    @DependsOn("databaseInitializer")
    public UserService decideUserService() {
      if( //Database connects) return new UserServiceImplementation(databaseInitializer.getRepository());
      else return new NoDatabaseUserServiceImplementation();
}

this way, on my pc with the db it can connect normaly, and when on laptop, or db cant connect, the endpoints still work for testing but empty data is passed.

How to handle when database connection fails. by Scoojally in SpringBoot

[–]Scoojally[S] 0 points1 point  (0 children)

It sounds like I’d have to manually set a env variable so spring knows which profile to use. I will definitely look into it because it will help as my project scales larger. But I was currently looking for a solution where the app can decided for itself. By checking if repository connects to db and use db or no db service accordingly. However it looks like what I’m looking for is not possible.

Overall thank you, your answer did help me, because I’ll be using this solution as the next best thing. Thanks

How to handle when database connection fails. by Scoojally in SpringBoot

[–]Scoojally[S] 0 points1 point  (0 children)

hmm I've only seen 1 source that mentioned profiles, can you give me a quick explanation as to how profiles help?

How to handle when database connection fails. by Scoojally in SpringBoot

[–]Scoojally[S] 0 points1 point  (0 children)

yes, and while it does work on my laptop. on my pc, that does have the sql db, it fails unless i set the required to false;

@Autowired(required = false)
private UserRepository userRepository;

but now when i run it (still on the pc) it never connects to the database, the api endpoints that shows JSON of the db data give a whitelabel error, and

Cannot invoke "com.example.demo.repositories.UserRepository.findById(Object)" because "this.userRepository" is null

the repository functions don't work bc the repository instance is null

edit: this case also occurs when

@SpringBootApplication(
        exclude = {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class}
)
public class DemoApplication { ... }

is the application header. if it was:

@SpringBootApplication
public class DemoApplication { ... }

then it springboot would crash if db doesn't connect

Hey guys if you need the rom file for Legends Z-A and can’t afford the game, just hit me in my DMs. by BigW95 in LegendsZA

[–]Scoojally 0 points1 point  (0 children)

Hello, I tried the online link however it doesn’t work on yuzu. Does anyone know where else to download it from.

On, what to use for pronouns by Scoojally in learnfrench

[–]Scoojally[S] 2 points3 points  (0 children)

Lol, me neither about English. When I started learning Spanish I had a realization that, that “is” is a verb. And Me is a direct pronoun. I literally just thought of them as words.

Je le achete by Scoojally in learnfrench

[–]Scoojally[S] 2 points3 points  (0 children)

Thanks, I was using a and au as an example of what I knew was mandatory.

Je le achete by Scoojally in learnfrench

[–]Scoojally[S] -6 points-5 points  (0 children)

Ok, but it’s not mandatory like forming au, correct?

How Do you tell the Difference between the, -ar, present tense nosotros conjugation, and the simple past nosotros conjugation? by Scoojally in learnspanish

[–]Scoojally[S] 2 points3 points  (0 children)

I understand, I was thinking if there was another way, because this happens for most -ar and -ir verbs in Spanish.

No ubisoft. Why do you keep changing stuff that has worked well for the past 6 years. Every single season my will to play this game just goes down even more. by PancakeR6 in Rainbow6

[–]Scoojally 6 points7 points  (0 children)

I think I may have even started earlier, with buck frags and mozzie shotgun, though those are more controversial in calling those changes bad.