This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!

Nivesh Chandola

Greenhorn
+ Follow
since Jul 02, 2013
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
5
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nivesh Chandola

Hello,

I am working on JSF project where I am using Netbeans IDE, Apache Tomcat Server. The output of my program should be displayed in the following format:

First NameLast NameEmail
firstName_1lastName_1email_1
firstName_2lastName_2email_2


I have got 3 files:
               
  • student_table_demo.xhtml

  •                
  • Student.java

  •                
  • StudentDataUtil.java


  • When I run the file student_table_demo.xhtml I receive the error in attached file: image 1.

    In the file student_table_demo.xhtml- after writing the following codes I receive the error HTTP Status 500 - Internal Server Error attached as image 1


    The complete code in file student_table_demo.xhtml is:


    However, if I remove the following part, the program runs just fine.


    Could anyone please advise me what I did wrong here.

    Kind regards,
    Nivesh
    1 week ago
    JSF
    Thank you Paul, it worked. Can't believe I didn't realise that.

    Thanks everyone for helping me out as well.
    4 months ago
    Please find the attached source code.

    The code in method getEmailDetails is similar to the method getSMSDetails().




    ---------------------------------------------------------------------------------------Main--------------------------------------------------------------------------------------------

    4 months ago
    Hello again,

    Now I really need help to understand certain concepts.

    Basically, I have 4 classes and have saved each of them in a separate file as .java (I use notepad++ for programming):
    1. SMSMessage
    2. MessageProcessor -----------> this is a Generic Class that shows the output
    3. EmailMessage
    4. MainClass

    Have also done error handling, using printStackTrace() in class MessageProcessor

    Imported: import java.lang.reflect.Field; ----> This is being used by class MessageProcessor

    Objective of Program:
    Ask the user to choose from
                                              1. SMS
                                              2. Email
                                              3. Exit
    SMS
          User enters 1. phone number, 2. message

    Output to be displayed: message sent to phone_number was submitted for processing at current_time

    Error that I received:
           java.lang.IllegalArgumentException: Can not set java.lang.String field SMSMessage.receiver to java.lang.String
           at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
           at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
           at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:58)
           at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:36)
           at java.lang.reflect.Field.get(Field.java:393)
           at MessageProcessor.printResult(MessageProcessor.java:26)   --------------------------> Object receiverValue = receiverField.get("message");  // this is what I wrote in class MessageProcessor inside method printResult()
           at MainClass.getSMSDetails(MainClass.java:25 )-----------------------------------------> message1.printResult(); //in the MainClass, method printResult() of MessagePocessor is called from method getSMSDetails()
           at MainClass.showMenu(MainClass.java:69) ---------------------------------------------> getSMSDetails(); // this method prompts the user to enter contact number and message
           at MainClass.main(MainClass.java:94)----------------------------------------------------> calls the method showMenu() which calls the the method getSMSDetails()

    Similar errors are observed when user selects Email.


    However, the same piece of code worked on my friend's system in Netbeans.
    4 months ago
    Sorry Tim,

                                                                                              I won't shout.


    There are certain rules that I don't understand, which are defined in Java programming language. Also, my core field is not programming so sometimes it gets difficult to comprehend what the error means.

    I understand the concept of Java Exceptions, however, I don't always understand when and where to use them (like in this case).

    @Carey

    Data type of EmailMessage.receiver is String.

    But it is ok, I now got the idea of using printStackTrace(), so let me try it first, if I can't solve it then I will post it here.

    Thank you Carey and Tim

    4 months ago
    Hello,

    Is there a book that can be referred to find the meaning of errors such as:

                                          java.lang.IllegalArgumentException: Can not set java.lang.String field EmailMessage.receiver to java.lang.String

    Also can anyone please suggest how can one improve on programming?

    Many thanks.
    4 months ago
    Thank you everyone, it was my mistake I created the CLASSPATH which of no use.
    It is working now.
    6 years ago
    Yes "javac.exe" is there in the bin and yes I made the new PATH in Advanced System Setting under "environment variables" but I named it as CLASSPATH because in PATH I have given the address of my MATLAB program to run MATLAB files.

    No I didn't close any open cmd window.
    6 years ago
    My jdk is installed in Program files(x86) and Path is set to
    C:\Program Files (x86)\Java\jdk1.7.0_25\bin
    6 years ago
    Hi again,

    I have downloaded jdk and have updated the Path environment variable but still I am getting the same message.
    6 years ago
    Hi there,
    I am new to new to Java and after making the program in the text editor I saved it as .java type. After running the program in command prompt I got the following error:

    'javac' is not recognized as an internal or external command, operable program or batch file.
    6 years ago