problems with EE

Discussion in 'Java' started by paul88, Nov 27, 2010.

  1. paul88

    paul88 New Member

    Joined:
    Nov 27, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    when running a program I get the following error

    Code:
    javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory]
    
    Can anyone help?

    Thanks
     
  2. virxen

    virxen Active Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    28
    is this class in your classpath?
     
  3. paul88

    paul88 New Member

    Joined:
    Nov 27, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Yes

    Code:
    paul@paul-laptop:~/Documents/eprogramming/week5$ echo $CLASSPATH 
    /home/paul/apache-tomcat-6.0.26/lib/servlet-api.jar:/home/paul/apache-tomcat-6.0.26/lib/jsp-api.jar:/home/paul/apache-tomcat-6.0.26/lib/mysql-connector-java-5.1.12-bin.jar:/home/paul/Documents/eprogramming/fscontext.jar:./lib/fscontext.jar:/home/paul/Documents/eprogramming/week5/lib/:/home/paul/Documents/eprogramming/week5/lib/fscontext.jar:/home/paul/Documents/eprogramming/week5/lib/providerutil.jar
    
    
     
  4. virxen

    virxen Active Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    28
    try placing fscontext.jar and providerutil.jar
    into
    JAVA_HOME\jre\lib\ext, where JAVA_HOME is the root directory of your Java 2SDK installation.
     
  5. paul88

    paul88 New Member

    Joined:
    Nov 27, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Problem solved.

    The problem was that when I was running the program I was saying

    Code:
    java -cp . name
    What i didn't know was that was saying ignore the class path any only have class path as . dot for current directory. which was making it pointless adding the jar files to the classpath.

    Before I just run java like this as the class not found error came up.

    I amended the CLASSPATH with the dot. So all I need to type was java name.

    Thank you for your help
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice