writing ISOServer for Q2 in JPOS1.4.8

42 views
Skip to first unread message

vamshi

unread,
Sep 21, 2006, 3:40:22 AM9/21/06
to jPOS Users
hi

we are using JPOS1.3.8 in our project and we wrote server program by
implementing ISORequestListener. problem is that now we are upgrading
to JPOS1.4.8 and i dont know how to write server program which runs in
Q2 and writing configuration file, any suggestions would be highly
appreciated.

Alejandro Revilla

unread,
Sep 21, 2006, 6:32:20 AM9/21/06
to jpos-...@googlegroups.com
The good news is that you will be able to reuse your ISORequestListener
implementation. You just need to write a configuration file like this:

<server class="org.jpos.q2.iso.QServer" logger="Q2" name="server">
<attr name="port" type="java.lang.Integer">10000</attr>
<channel class="org.jpos.iso.channel.XMLChannel"
logger="Q2" packager="org.jpos.iso.packager.XMLPackager">
</channel>
<request-listener class="your.iso.request.Listener" logger="Q2">
...
... place your requestlistener configuration here
...
</request-listener>
</server>

vamshi

unread,
Sep 22, 2006, 2:16:55 AM9/22/06
to jpos-...@googlegroups.com

Thanks Alejandro Revilla for your quick response. infact i tried the same way
as you suggested, but i'm getting exception .I have added all the jar files
in classpath which comes with jpos1.4.8 . i have generated a jar file for
server class and placed in q2/deploy/lib directory and xml file in
q2/deploy directory.
Below is the stack trace

<log realm="Q2.system" at="Fri Sep 22 07:20:03 BST 2006.448">
<warn>
deploy
<exception name="null nested exception is
java.lang.ClassNotFoundException: org.jpos.q2.iso.QServer">
javax.management.ReflectionException: null nested exception is
java.lang.ClassNotFoundException: org.jpos.
q2.iso.QServer
java.lang.ClassNotFoundException: org.jpos.q2.iso.QServer
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at
mx4j.server.interceptor.InvokerMBeanServerInterceptor.instantiate(InvokerMBeanServerInterceptor.jav
a:100)
at
mx4j.server.interceptor.DefaultMBeanServerInterceptor.instantiate(DefaultMBeanServerInterceptor.jav
a:106)
at
mx4j.server.interceptor.SecurityMBeanServerInterceptor.instantiate(SecurityMBeanServerInterceptor.j
ava:74)
at
mx4j.server.interceptor.DefaultMBeanServerInterceptor.instantiate(DefaultMBeanServerInterceptor.jav
a:106)
at
mx4j.server.interceptor.DefaultMBeanServerInterceptor.instantiate(DefaultMBeanServerInterceptor.jav
a:106)
at
mx4j.server.interceptor.ContextClassLoaderMBeanServerInterceptor.instantiate(ContextClassLoaderMBea
nServerInterceptor.java:138)
at
mx4j.server.MX4JMBeanServer.instantiateImpl(MX4JMBeanServer.java:677)
at mx4j.server.MX4JMBeanServer.instantiate(MX4JMBeanServer.java:664)
at mx4j.server.MX4JMBeanServer.instantiate(MX4JMBeanServer.java:644)
at org.jpos.q2.QFactory.instantiate(QFactory.java:107)
at org.jpos.q2.Q2.deploy(Q2.java:348)
at org.jpos.q2.Q2.deploy(Q2.java:212)


below is the server program i'm using

public class TestISOServer implements ISORequestListener {

public TestISOServer() {
super();
}
public boolean process (ISOSource source, ISOMsg m) {

try {

m.setResponseMTI ();
m.set (39, "00");
source.send (m);

} catch (ISOException e) {

e.printStackTrace();

} catch (IOException e) {

e.printStackTrace();
}

return true;
}
public static void main (String[] args) throws Exception {

Logger logger = new Logger ();

logger.addListener (new SimpleLogListener (System.out));

ServerChannel channel = new XMLChannel (new XMLPackager());

((LogSource)channel).setLogger (logger, "channel");

ISOServer server = new ISOServer (8050, channel, null);

server.setLogger (logger, "server");

server.addISORequestListener (new TestISOServer());

new Thread (server).start ();
}
}

--
View this message in context: http://www.nabble.com/writing-ISOServer-for-Q2-in-JPOS1.4.8-tf2310258.html#a6441657
Sent from the jPOS - Users mailing list archive at Nabble.com.

Reply all
Reply to author
Forward
0 new messages