Customized channel with more infos in channel config file.

73 views
Skip to first unread message

Nguyen Tien Luong

unread,
Jul 21, 2017, 2:15:35 PM7/21/17
to jPOS Users
   Hi all, 

I want to extend NACChannel by adding 2 properties (nii and f25) in it. So my channel config will look like:

<channel class="mobi.xxx.jpos.channel.XXXNACChannel" logger="Q2"

realm="channel" timeout="600000" packager="org.jpos.iso.packager.GenericPackager"

header="6000036549">

<property name="packager-config" value="jar:packager/iso87binary.xml" />

<property name="host" value="xx.53.yy.zzz" />

<property name="port" value="mmnn" />

<property name="nii" value="003" />

<property name="f25" value="00" />

<property name="timeout" value="500000" />

</channel>


My class look like:


public class XXXNACChannel extends NACChannel {

String nii;

String field25;

public XXXNACChannel(String nii, String field25) {

super();

this.nii = nii;

this.field25 = field25;

}

public String getNii() {

return nii;

}

public void setNii(String nii) {

this.nii = nii;

}

public String getField25() {

return field25;

}

public void setField25(String field25) {

this.field25 = field25;

}


}


Then when I start jpos, exception raised:


 <log realm="org.jpos.q2.iso.ChannelAdaptor" at="Fri Jul 21 09:06:40 ICT 2017.168">

   <warn>

     error starting service

     <iso-exception>

       mobi.softpay.jpos.channel.XXXNACChannel

       <nested-exception>

       javax.management.ReflectionException

  at com.sun.jmx.mbeanserver.MBeanInstantiator.instantiate(MBeanInstantiator.java:289)

  at com.sun.jmx.mbeanserver.MBeanInstantiator.instantiate(MBeanInstantiator.java:605)

  at com.sun.jmx.mbeanserver.MBeanInstantiator.instantiate(MBeanInstantiator.java:512)

  at com.sun.jmx.mbeanserver.JmxMBeanServer.instantiate(JmxMBeanServer.java:980)

  at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.instantiate(PluggableMBeanServerImpl.java:1453)

  at org.jboss.as.jmx.PluggableMBeanServerImpl.instantiate(PluggableMBeanServerImpl.java:689)

  at org.jpos.q2.QFactory.newInstance(QFactory.java:314)

  at org.jpos.q2.iso.ChannelAdaptor.newChannel(ChannelAdaptor.java:194)

  at org.jpos.q2.iso.ChannelAdaptor.initChannel(ChannelAdaptor.java:242)

  at org.jpos.q2.iso.ChannelAdaptor.startService(ChannelAdaptor.java:71)

  at org.jpos.q2.QBeanSupport.start(QBeanSupport.java:115)

  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

  at java.lang.reflect.Method.invoke(Method.java:601)

  at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:111)

  at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:45)

  at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:235)

  at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)

  at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:250)

  at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)

  at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791)

  at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.invoke(PluggableMBeanServerImpl.java:1468)

  at org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:740)

  at org.jpos.q2.QFactory.startQBean(QFactory.java:181)

  at org.jpos.q2.Q2.start(Q2.java:490)

  at org.jpos.q2.Q2.deploy(Q2.java:280)

  at org.jpos.q2.Q2.run(Q2.java:168)

  at java.lang.Thread.run(Thread.java:722)

 Caused by: java.lang.NoSuchMethodException: No such constructor

  ... 29 more

       </nested-exception>

       org.jpos.core.ConfigurationException: mobi.softpay.jpos.channel.SoftPayNACChannel (javax.management.ReflectionException)

  at org.jpos.q2.QFactory.newInstance(QFactory.java:316)

  at org.jpos.q2.iso.ChannelAdaptor.newChannel(ChannelAdaptor.java:194)

  at org.jpos.q2.iso.ChannelAdaptor.initChannel(ChannelAdaptor.java:242)

  at org.jpos.q2.iso.ChannelAdaptor.startService(ChannelAdaptor.java:71)

  at org.jpos.q2.QBeanSupport.start(QBeanSupport.java:115)

  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

  at java.lang.reflect.Method.invoke(Method.java:601)

  at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:111)

  at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:45)

  at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:235)

  at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)

  at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:250)

  at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)

  at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791)

  at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.invoke(PluggableMBeanServerImpl.java:1468)

  at org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:740)

  at org.jpos.q2.QFactory.startQBean(QFactory.java:181)

  at org.jpos.q2.Q2.start(Q2.java:490)

  at org.jpos.q2.Q2.deploy(Q2.java:280)

  at org.jpos.q2.Q2.run(Q2.java:168)

  at java.lang.Thread.run(Thread.java:722)

 Nested:javax.management.ReflectionException

  at com.sun.jmx.mbeanserver.MBeanInstantiator.instantiate(MBeanInstantiator.java:289)

  at com.sun.jmx.mbeanserver.MBeanInstantiator.instantiate(MBeanInstantiator.java:605)

  at com.sun.jmx.mbeanserver.MBeanInstantiator.instantiate(MBeanInstantiator.java:512)

  at com.sun.jmx.mbeanserver.JmxMBeanServer.instantiate(JmxMBeanServer.java:980)

  at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.instantiate(PluggableMBeanServerImpl.java:1453)

  at org.jboss.as.jmx.PluggableMBeanServerImpl.instantiate(PluggableMBeanServerImpl.java:689)

  at org.jpos.q2.QFactory.newInstance(QFactory.java:314)

  at org.jpos.q2.iso.ChannelAdaptor.newChannel(ChannelAdaptor.java:194)

  at org.jpos.q2.iso.ChannelAdaptor.initChannel(ChannelAdaptor.java:242)

  at org.jpos.q2.iso.ChannelAdaptor.startService(ChannelAdaptor.java:71)

  at org.jpos.q2.QBeanSupport.start(QBeanSupport.java:115)

  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

  at java.lang.reflect.Method.invoke(Method.java:601)

  at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:111)

  at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:45)

  at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:235)

  at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)

  at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:250)

  at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)

  at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791)

  at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.invoke(PluggableMBeanServerImpl.java:1468)

  at org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:740)

  at org.jpos.q2.QFactory.startQBean(QFactory.java:181)

  at org.jpos.q2.Q2.start(Q2.java:490)

  at org.jpos.q2.Q2.deploy(Q2.java:280)

  at org.jpos.q2.Q2.run(Q2.java:168)

  at java.lang.Thread.run(Thread.java:722)

 Caused by: java.lang.NoSuchMethodException: No such constructor

  ... 29 more

     </iso-exception>

   </warn>

 </log>



Anyone can correct/show me how to do it properly?

Thanks a lot 


Luong NGUYEN

Alejandro Revilla

unread,
Jul 21, 2017, 2:17:26 PM7/21/17
to jPOS Users
You're missing a default no-args constructor required by Q2.

Why do you want to extend NACChannel? We don't you just set NII and field 25 from your application or an ISOFilter?



--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+unsubscribe@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/5fbf393a-39aa-4c22-b072-f204d4520eb2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages