Philippe Ponceblanc

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

Recent posts by Philippe Ponceblanc

Ron McLeod wrote:

Philippe Ponceblanc wrote:if the main method is "static" I have two new error that appears when compiling the source code.


The problem is that you are trying to assign instance variables as if they were class variables.

Without restucturing your code, you could either make them class variables by making them static:

Or assign the values to the instance after creating it:


I am advised to write with static variables if no I have errors on my variable, it seems to me that you are not all agree on this subject.
I do not understand why you are not in corelation.

1 month ago
Hello,
apparently my static variables:
 static int Epreuve_Ecrite;
 static int  Epreuve_Orale;
are not taken into account in my code.




If I try to display the value of one of them, the notes are empty.



Epreuve_Ecrite is empty !
Certainly a static variable problem?
1 month ago
Ron McLeod Thank you for your lesson on the static method and its member variables. my program works.

Liutauras Vilda, I understand that my code is not very clear, it comes from the code of methods is imposed by the certification that I am doing,
there is an automatic corrector, I too there are things that I escape, I think I'll understand later ....

However, the worst is that my toString method is very poorly written, I lack imagination to write the latter properly.




how can I see the writing of the code in another aspect ?
1 month ago

Ron McLeod wrote:It looks like the exception is being thrown from some kind of container (edu.rice.cs.drjava.model.compiler.JavacCompiler) which is used to compile-and-launch the application.  Most likely the main method should probably be static



if the main method is "static" I have two new error that appears when compiling the source code.


2 errors found:
File: /home/phipo/fun-mooc-java-obj/mooc_2ieme_session/DossierCandidatureGER.java  [line: 131]
Error: non-static variable Epreuve_Ecrite cannot be referenced from a static context
File: /home/phipo/fun-mooc-java-obj/mooc_2ieme_session/DossierCandidatureGER.java  [line: 134]
Error: non-static variable Epreuve_Orale cannot be referenced from a static context

1 month ago

Ron McLeod wrote:

Philippe Ponceblanc wrote:... I have an error of "java.lang.NullPointerException" and moreover no exeception is raised from where does it come from?


Can you share the stack trace for the exception, and the associated code that it points-to?



my code will seem cabalistic because it is written in French, I'm sorry




> run DossierCandidatureGER
java.lang.NullPointerException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at edu.rice.cs.drjava.model.compiler.JavacCompiler.runCommand(JavacCompiler.java:267)
>  

1 month ago
I made a program of one class with 6 methods and a program hand in my class with keyboard, it is a candidate management program at a large French school ...

I added to each of the methods the corresponding "try catch" to trace my coding error.

My program compiles and executes but I have an error of "java.lang.NullPointerException" and moreover no exeception is raised from where does it come from?
1 month ago

just 2 errors in one, my range of my instantiated methods returns two errors!




2 errors found:
File: /home/phipo/fun-mooc-java-obj/DossierCandidatureGER.java  [line: 80]
Error: '.class' expected
File: /home/phipo/fun-mooc-java-obj/DossierCandidatureGER.java  [line: 80]
Error: ';' expected

2 months ago

Junilu Lacar wrote:The first error says: you are trying to call the constructor without parameters (line 78) but there are no constructors that do not have parameters. The only constructor defined on line 18 takes two parameters.



I do not understand your post, can you explain by an example in my code
2 months ago
Hello,
I write a program of management of file in big french school,
I develop under DRJAVA.
I have an error on the constructor of the class.

here is my code:




here is the error displayed by the compiler :



3 errors found:
File: /home/phipo/fun-mooc-java-obj/DossierCandidatureGER.java  [line: 78]
Error: constructor DossierCandidatureGER in class DossierCandidatureGER cannot be applied to given types;
 required: java.lang.String,java.lang.String
 found: no arguments
 reason: actual and formal argument lists differ in length
File: /home/phipo/fun-mooc-java-obj/DossierCandidatureGER.java  [line: 80]
Error: non-static variable note_ecrit cannot be referenced from a static context
File: /home/phipo/fun-mooc-java-obj/DossierCandidatureGER.java  [line: 84]
Error: non-static variable note_orale cannot be referenced from a static context

2 months ago
thanks you,

i have a new 500 error




Why tomcat output writed no output folder ?
3 months ago
Hello,
I work on Fedora 28 x86_64 server, I develop an example of Spring web MVC encoding in a maven project with a pom.xml file.
after implementing my classes with Spring MVC annotations I set up my controllers!
This example is quite simple, I compiled my project with the command: mvn clean compile war: exploded
Tomcat 8.5 is run with the catalina run command, but the docBase is well informed and noted as reloadable = "true".
however I have a 500 error on invoking my URL.
here is the error:



I create the WEB-INF / dispatcher-servlet.xml :




I do not know how to fill the web.xml file,
do I have to fill the mapping of my sample.jsp page ?


3 months ago

Tim Holloway wrote:Please don't start class names with a lower case letter. JPA may not handle them properly. Class names should ALWAYS start with an upper-case letter. Member names should always start with a lower-case letter. The Java tools assume that that's what you will be doing and some of them malfunction when you do not.



yes i anderstand ! a class always start with an upper-case letter !

Tim Holloway wrote:
You put your entity relationship on the field definitions. When using property method access, that would be on the "get" method. Like so:



I'm using Spring MVC, as I understand it, I need to put the data-level relationships of Spring web-mvc in order to display them in * .JSP (views).

Tim Holloway wrote:



for my sample : Authors(0,n)<--------------------->(1,1) Books (0,n) <----------------------> (1,1) loan



I admit that I have trouble understanding where you put your code, I understood that it is in the GET method ?


for my sample : Authors(0,n)<--------------------->(1,1) Books (0,n) <----------------------> (1,1) loan

table authors                                                        table book                                                  table loan
-id_authors                                                           - id_book                                                     - id_loan
- firstname                                                            - isbn                                                           - date_begin
- lastname                                                            - title                                                            - date_end
-...                                                                         - ...                                                              -....

I do not understand your second example, I know you bring attention to the latter because I live in Burgundy and there are good wines ....
can you tell me how to do with my example of managing borrowing books in a library?


Tim Holloway wrote:
For best results, you should always annotate both source and target relationships, but you can annotate only the property whose relationship you actually intent to use.


Sorry, but I do not understand at all, because what you say is abstract!

Tim Holloway wrote:
Note that the second example here is using a compound foreign key.


I know what is a  compound foreign key, but in your example, there are baths that I do not understand or I do not assimilate!


if you have the time, give me an example from my model of 3 tables described above
Hello everyone,
I make a loan application of books, it's relatively classic.
I have 7 tables: author, book, loan, damage, examplaire, borrower, user.

I chose to proceed in the following way: a class = a table.
I work with ORM: JPA and hibernate.
I annotated all my classes with: @Entity, @Id, @GeneratedValue.
I'm having problems with cardinalities: @OneToMany, @ManyToOne, @OneToOne and @ManyToMany.

my source code is in french but I annotated the translation of my classes / tables

here is some source code:








it is three tables / classes are in relation to each other by strong cardinalities.

author (0, n) ---------------------- (1,1) book (0, n) ----------- ---- (1,1) loan

auteur (0,n)----------------------(1,1) livre (0,n)---------------(1,1) emprunt

where can I put my cardinalities in my object model?
I do not continue this project in multi modules, I prefer working with a single pom.xml

Thank you for your help
3 months ago