on 04-09-2009 12:23 PM
Hi,
We developed an SFTP Adapter on a clustered Advanced Adapter Engine.
When we try to lookup the LogicalLockingFramework, we get a ClassCastException and the proxy Class is missing the Interface LogicalLockingFactory.
We use the following code for the lookup:
LogicalLockingFactory lockingFactory = null;
lockingFactory = (LogicalLockingFactory) new InitialContext().lookup(
LogicalLockingFactory.JNDI_NAME);
Does anybody have an idea, wht the problems could be?
Thanks in advance,
Gernot
Hi Gernot,
i think you are right in this forum.
You receive this ClassCastException probably because the class loader which tries to load the class is not application classloader. I suggest change the class where you change the classloader.
So you should change the source like this
ClassLoader oldClassLoader =
Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoa
der());
try {
//Perform the lookup here
} finally { // this step is very important!
Thread.currentThread().setContextClassLoader(oldClassLoader);
}
It is very important to return back the original contextClassLoader when the lookup finishes.
Best regards,
Martin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gernot,
You are asking the wrong question at the wrong place. SFTP comes under the purview of Microsoft Biztalk and this is a SAP PI forum.
Regards
joel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.