how to validate if there's already a field with the same registered number (Logical problem)

how to validate if there's already a field with the same registered number (Logical problem) Problem Description: (https://i.stack.imgur.com/52C98.png) I can’t let the user enter a code that already exists in the database,so i need to make one more validation for this field "code". obviously I have to use a ‘if statement’ but i just can’t … Read more

How do you configure the spring integration poller after XSD changes have invalidated the fixed-delay and fixed-rate attributes?

How do you configure the spring integration poller after XSD changes have invalidated the fixed-delay and fixed-rate attributes? Problem Description: Original xml: <int:poller default="true" task-executor="stepTaskExecutor" fixed-delay="1000"> The fixed-delay attribute is no longer legal, and fails XML parsing in the (eclipse) IDE. Alternative configuration: An alternative suggested elsewhere (including https://docs.spring.io/spring-integration/docs/2.0.0.M3/spring-integration-reference/html/samples.html): <!– Globally scoped Spring Integration bean … Read more

How can I use my ApiService and Room Dao into WorkManager with Hilt, implementing MVVM pattern?

How can I use my ApiService and Room Dao into WorkManager with Hilt, implementing MVVM pattern? Problem Description: I want to use my ApiService and my Room Dao in the WorkManager class implementing the MVVM pattern and Hilt as dependency injection. This is my code: ViewModel @HiltViewModel public class SyncViewModel extends ViewModel { private final … Read more

Add something to the java classpath

Add something to the java classpath Problem Description: I have a jar-File, which I want to add to the classpath, so I ran java -cp ".;C:Pathtomymagicaljarfile.jar;.someotherdirectory" MyClass The Problem is: I use some import-commands in my class, an Java doesn’t find them anymore, because I replaced the classpath. I want just add two elements to … Read more

Asynctask does not return string, but does not contain a reported error

Asynctask does not return string, but does not contain a reported error Problem Description: I’m passing a URL to an ASYNC class (wsbRedirTest) and I expect to receive the content of the page. However, it does not return any results. public class wsbRedirTest extends AsyncTask<String, Void, String> { private Object[] values; protected void onPreExecute() { … Read more

How to left align JPanel in JTabbedPane?

How to left align JPanel in JTabbedPane? Problem Description: I want to Left align the tab labeled "Unwanted Centered Panel" here is my SSCE: import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTabbedPane; public class Issue { public Issue() { } public JPanel buildIssuePanel() { GridBagLayout layout1 = new GridBagLayout(); GridBagConstraints gbc1 … Read more

Spring Boot Test "Failed to load ApplicationContext"

Spring Boot Test "Failed to load ApplicationContext" Problem Description: I am getting an error while testing my rest application but can’t understand why.My error output: ava.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:98) at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:124) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:118) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83) at org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance(SpringBootDependencyInjectionTestExecutionListener.java:43) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:248) at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:138) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at … Read more

convert or cast output of JpaRepository

convert or cast output of JpaRepository Problem Description: I have three interfaces that extend JpaRepository and a custom interface that has two functions. These two functions have their special output in each of three interfaces. I implement it with List in the custom interface, so I have to use same output in the three interfaces, … Read more

We use cookies in order to give you the best possible experience on our website. By continuing to use this site, you agree to our use of cookies.
Accept
Reject