Code:
javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory]
Thanks
|
Newbie Member
|
|
| 27Nov2010,10:16 | #1 |
|
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] Thanks |
|
Pro contributor
|
![]() |
| 27Nov2010,19:50 | #2 |
|
is this class in your classpath?
|
|
Newbie Member
|
|
| 27Nov2010,22:31 | #3 |
|
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 |
|
Pro contributor
|
![]() |
| 28Nov2010,00:13 | #4 |
|
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. |
|
Newbie Member
|
|
| 28Nov2010,20:29 | #5 |
|
Problem solved.
The problem was that when I was running the program I was saying Code:
java -cp . name 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 |