Win a copy of Microservices in Action this week in the Web Services forum!

Alejandro Barrero

Ranch Hand
+ Follow
since Aug 01, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Alejandro Barrero

Just running an application from the Udemy course RxJS 6 in practice (I downloaded the file for rxjs-course-0perators). I anr running with "ng serve --open" the console in Google Chrome displays

I have not been able to find a file with so many lines.
All of you who know more Swing than I do would know that the solution to the problem is the introduction of a cell editor as in the following code:
3 weeks ago
Thank you for your interest Rob. I really don't need a KeyListener; I am only using it to analyze what is happening. The problem that I have is that when I type a character that is not a digit the JTable stops receiving data in that cell. The constructor in the class that structures everything follows

Method createPlayers gets names of players and sets then in the table headers

At the end I set the number of rows to 16.
Method display results will display data from the table.
That is all I am trying to do; the problem that I have is that when I type a character that is not a digit the JTable stops receiving data in that cell. If you think that I should explain more, please explain.
3 weeks ago
The problem is solved by using a model as in

The problem that I have now is that if the character in not a digit, the stored value becomes an empty string although it keeps displaying.
This code is not working

3 weeks ago

The problem is that the method is called only the first time.
3 weeks ago
In a simple Swing application I have a Jtable table

The problem is that value is null even for cells where I have typed something. I haven't worked with Swing in a long time; I probably have to set something, but I don't know what. I tried "table.setCellEditor(new DefaultCellEditor(new JTextField()));", but it didn't work.
3 weeks ago
I only had to set "Suspend when 'true'" on Conditional on a break point.
2 months ago
I am running an application in STS; the application runs and methods in controllers and rest controllers run (the console is giving me "DEBUG - DispatcherServlet - Successfully completed request"), although I want to see why I am no getting the results; I am setting break points in the methods of the controllers, but the application is not stopping at the break points. I have seen responses to similar questions in this forum that assume that the person asking is very inexperienced and I want to assure all that  I have many years of experience with Eclipse and debugging in Eclipse; please don't tell me to right click on the project, select "Debug as" and then select "Debug on Server". I don't think there is anything in the code or even the pom that is relevant to this problem, but if requested I would be glad to provide anything.
2 months ago
Strange things happening. I changed to <spring.version>4.3.0.RELEASE</spring.version> because I though 5 was too advanced and lo and behold, the application runs! However, the rest controller

doesn't run; I am running "http://localhost:8080/chapter-02/hello" with a post request in Postman, bu I am getting "The origin server did not find a current representation for the target resource or is not willing to disclose that one exists." I still have the same problem even if I change the controller to "RequestMethod.GET".
2 months ago
I just noticed that running the server has the errors
SEVERE: Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in com.packtpub.springdata.jpa.config.ApplicationContext: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]: Factory method 'entityManagerFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/persistence/Converter

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]: Factory method 'entityManagerFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/persistence/Converter
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)

Caused by: java.lang.NoClassDefFoundError: javax/persistence/Converter
at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.<clinit>(DefaultPersistenceUnitManager.java:125)

Caused by: java.lang.ClassNotFoundException: javax.persistence.Converter
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1309)
2 months ago
Thanks for your interest Dave. The problem with the 404 error "The origin server did not find a current representation for the target resource or is not willing to disclose that one exists." occurred inmediatelly after i made the change in the pom; the problem also happened with Pivotal tc Server, or with a new server. Since trying the Rest controller with "http://localhost:8080/chapter-02/hello" gives the same result; it appears that the view resolver has been affected. I haven't build the project; it is build by updating the project with Maven or by changing the code in the rest controller.
2 months ago
I am posting again because I found problems after I closed my post as complete. I was trying to use @RestController in a spring application but I couldn't find the import. The answer was that I should have
<dependency>
   <groupId>org.springframework</groupId>
   <artifactId>spring-web</artifactId>
   <version>5.1.0.RELEASE</version>
</dependency>
I changed <spring.version>3.1.2.RELEASE</spring.version> to <spring.version>5.1.0.RELEASE</spring.version> updated the project in maven and then I could use @RestController in my code.

However something incredible happened; when I ran the application I started getting 404 error "The origin server did not find a current representation for the target resource or is not willing to disclose that one exists." . Strangely, the problem hapened before I update the project with Maven. The problem also happened with Pivota tc Server, or with a new server. I have had this problem before for several days and I haven't been able to find a solution. Of course, if I revert the change in <spring.version> the problem disapears.
On the other hand, if I only change the version for spring-web (which was my original problem) I am now getting the errors
Description Resource Path Location Type
The project was not built since its build path is incomplete. Cannot find the class file for org.springframework.context.annotation.AnnotationConfigRegistry. Fix the build path then try building this project Spring Data Chapter-2 Unknown Java Problem
The type org.springframework.context.annotation.AnnotationConfigRegistry cannot be resolved. It is indirectly referenced from required .class files DataJPAExampleInitializer.java /Spring Data Chapter-2/src/main/java/com/packtpub/springdata/jpa/config line 26 Java Problem

I am totally confused.

2 months ago
The problem with "The origin server did not find a current representation for the target resource or is not willing to disclose that one exists." still continues.
2 months ago
Something incredible is happening. When I run the application I am getting 404 error "The origin server did not find a current representation for the target resource or is not willing to disclose that one exists." . ngly, the problem hapens before I update the project with Maven. The problem happens with Pivota tc Server, or with a new server. I have had this problem before for several days and I haven't been able to find a solution. Of course, if I revert the change in <spring.version> the problem disapears.
On the other hand, if I only change the version for spring-web (which was my original problem) I am getting the errors
Description Resource Path Location Type
The project was not built since its build path is incomplete. Cannot find the class file for org.springframework.context.annotation.AnnotationConfigRegistry. Fix the build path then try building this project Spring Data Chapter-2 Unknown Java Problem
The type org.springframework.context.annotation.AnnotationConfigRegistry cannot be resolved. It is indirectly referenced from required .class files DataJPAExampleInitializer.java /Spring Data Chapter-2/src/main/java/com/packtpub/springdata/jpa/config line 26 Java Problem
2 months ago
Thank you Tushar Goel; I changed <spring.version>3.1.2.RELEASE</spring.version> to <spring.version>5.1.0.RELEASE</spring.version> and it is working fine.
2 months ago