java.rmi.RemoteException: Cannot instantiate class: com.sun.jndi.fsContext.RefFSContextFactory

hello I get this error when I deploy my ear file in weblogic 8.1.My ear file has this com.sun.jndi.fsContext.RefFSContextFactory.class in the war file under WEB-INF/class folder.
and also in the ejb.jar file in the root.It is also in the weblogic classpath.I am trying to send message to MQ queue on the JMS provider.
My JMSConfig.xml file uses the following info
<?xml version = "1.0" encoding = "ISO-8859-1" ?>
      <contextFactory value="com.sun.jndi.fsContext.RefFSContextFactory"/>
      <providerURL value="file:directoty where .bindings file is"/>
      <timeout value="500000"/>
            <sendQueue value="queue1"/>
      <replyQueue value="queue2"/>
      <connectionFactory value="nmbbb"/>      
MQ is installed in another machine and we use the .bindings to connect.

Caused by: java.rmi.RemoteException: Cannot instantiate class: com.sun.jndi.fsContext.RefFSContextFactory
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

No put the com.sun.jndi.fsContext.RefFSContextFactory.class into a jar file and place it on:


remove the class from ur ear

and restart web logic


This is in relation to a known bug. The location of your MQ Java classes is referenced using the variable $MQ_JAVA_HOME which is the name of the product integration home in the Cape Clear Manager. The adapter uses a different variable ($WEBSPHERE_MQ_JAVA_HOME) and so the classpath will contain the unresolved variable name rather than its value.

To fix this problem edit the adapter called WebSphereMQ@localhost and in the text area called Libraries change each instance of $WEBSPHERE_MQ_JAVA_HOME to $MQ_JAVA_HOME and the required FSContextFactory and other libraries will be loaded fine.

Actually, there's one more buglet in the adaptor defaults - the IBM JMSAdmin.config defaults to c:\JNDI-Directory where you guys use c:\ibm\JNDI-Directory - so you get lookup errors on the queue name.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java App Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.