-
1. Re: Simple HelloWorld connector/translator
rareddy Feb 19, 2013 8:58 AM (in response to rhopp)Radim,
1) Did you extend "HelloWorldManagedConnectionFactory" with "
BasicManagedConnectionFactory"?2) Are you doing the casting in your code?
Ramesh..
-
2. Re: Simple HelloWorld connector/translator
rhopp Feb 19, 2013 5:55 PM (in response to rareddy)1) Yes, I'm extending BasicManagedConnection Factory.
2) I'm not sure what do you mean with this. Only place, where is (in my code) HelloWorldManagedConnectionFactory used is in getConnection() method in HelloWorldExecutionFactory (http://pastebin.com/ULbgwSeC)
-
3. Re: Simple HelloWorld connector/translator
rareddy Feb 19, 2013 9:45 PM (in response to rhopp)Radim,
The exception is from the resource adapter code, can you post that, including your ra.xml file?
What I was asking was do cast to WrappedConnectionFactory anywhere in your code?
Ramesh..
-
4. Re: Simple HelloWorld connector/translator
rhopp Feb 20, 2013 4:24 AM (in response to rareddy)My resource adapter is empty class (except for hashCode and equals) - http://pastebin.com/YygEGGyz
ra.xml - http://pastebin.com/mZP8pBXg
Whole connector project - http://mosquitoattack.eu/helloworld-conector.zip
I'm not aware of casting to WrappedConnectionFactory anywhere.
Thank you for helping me
Radim
-
5. Re: Simple HelloWorld connector/translator
rareddy Feb 20, 2013 12:02 PM (in response to rhopp)Radim,
I did not pay attention to your ExecutionFactory before, but that is defined wrong. You did
@Translator(name="HelloWorld", description="Helloworld translator") public class HelloWorldExecutionFactory extends ExecutionFactory<HelloWorldManagedConnectionFactory, HelloWorldConnection> { ... }
that is wrong, because you used the "HelloWorldManagedConnectionFactory" and "HelloWorldConnection" directly. In application sever these objects are then wrapped into others to provide services like transactions, pooling, security etc. You always need to access them through abstraction. Take look at FileExecutionFactory, it uses "ConnectionFactory" and "FileConnection", similarly you need to define a interface called "HelloWorld" and have your "HelloWorldConnection" implement that, then on your ExectionFactory use like
@Translator(name="HelloWorld", description="Helloworld translator") public class HelloWorldExecutionFactory extends ExecutionFactory<ConnectionFactory, HelloWorld> { ... }
Then that will work
Ramesh..
-
6. Re: Simple HelloWorld connector/translator
rhopp Feb 21, 2013 11:42 AM (in response to rareddy)Thank you ;-)