how to use poller in int-ftp:outbound-gateway? - spring

first,thanks for your attention
i defined a outbound-gateway ftp adapter with polling as bellow code :
<int-ftp:outbound-gateway id="gatewayLS"
session-factory="ftpClientFactory"
request-channel="inboundFileChannel"
command="ls"
command-options="-1"
expression="'books/*'"
reply-channel="outboundJobRequestChannel">
<int:poller fixed-rate="5000"/>
</int-ftp:outbound-gateway>
but I got the following exception:
org.xml.sax.SAXParseException; lineNumber: 57; columnNumber: 40; cvc-complex-type.2.4.a: Invalid content was found starting with element 'int:poller'. One of '{"http://www.springframework.org/schema/integration/ftp":request-handler-advice-chain}' is expected.
what is correct action for above problem?
thanks

This was fixed in version 4.1. The current version is 4.1.3.
If you can't move to 4.1.x (recommended), you can add a <bridge/> to bridge the pollable channel to a direct channel.

Related

Jboss 7.3 Special characters in URL

my application is sending below request to print a document which has special characters
*<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<udp tag="crypto"><luid url="https://w3.servername.com/ocp/<FnQ+xwAAAYXgbc3dgA4=>.kuid" uid="Rm5RK3h3QUFBWVhnYmMzZGdBND0="/></udp>*
From my application, request goes to OCP client for document printing. OCP client is running on a remote machine and we see below error on OCP client side
2023-01-25 08:42:43,013 ERROR [upd-Dispatcher] - Problem with JAXB
javax.xml.bind.UnmarshalException: Premature end of file.
- with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file.]
Same setup/flow works fine with Jboss 6.4 server. I added below properties in standalone file in jboss 7.3 but nothing works out. Any idea how this can be addressed in Jboss 7.3?
<property name="org.wildfly.undertow.ALLOW_UNESCAPED_CHARACTERS_IN_URL" value="true"/>
<property name="tomcat.util.http.parser.HttpParser.requestTargetAllow" value="!"#$%&'()*+,-./:;<=>?#[]^_`{|}~"/>
I tried adding below properties to escape the special characters and I was expecting it to work like it works in jboss 6.4 and print the document.
?#[]^_`{|}~"/>

shibboleth idp with OpenLDAP integration / Uncaught runtime exception java.lang.NullPointerException: null

I got install shibboleth idp with OpenLDAP integration
, it authenticate successfully but
it return exception error
Uncaught runtime exception java.lang.NullPointerException: null
the log file contains
Attribute Resolver 'ShibbolethAttributeResolver': Removing result of attribute definition 'uid', contains no values
Attribute Resolver 'ShibbolethAttributeResolver': Removing result of attribute definition 'mail', contains no values
and
the attribute-resolver.xml file contains
<AttributeDefinition xsi:type="Simple" id="uid">
<InputDataConnector ref="myLDAP" attributeNames="uid" />
<AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:uid" encodeType="false" />
<AttributeEncoder xsi:type="SAML2String" name="urn:oid:0.9.2342.19200300.100.1.3" friendlyName="uid" encodeType="false" />
</AttributeDefinition>
Thanks,
I found that it's a bug in shibboleth idp 4.0 ,
it should be fixed in the next version

LDAP invalid login credentials

I installed sldap on my ubuntu 12.04 system.https://help.ubuntu.com/community/OpenLDAPServer
I can add /search records to lsdap from terminal.e.g. I can add ldif file.
ldapadd -x -D cn=admin,dc=test,dc=com -W -f ldap-add.ldif
and it ask me password .I entered pass000 and it added new entry.its working fine .i can add search records from terminal. Now I tried It from my spring application .i added dependency ldap-core to my pom .i set up bean etc. every thing is fine except it gives me error in valid credetials thouh I entered same as I entered while ading ldif file from terminal. My bean configuration is
<!-- ldap template -->
<ldap:context-source id="contextSource" url="ldap://localhost:389"
base="dc=test,dc=com" username="cn=admin" password="pass000" />
<ldap:ldap-template id="ldapTemplate"
context-source-ref="contextSource" />
<bean id="personDao" class="com.cheasyy.cofinding.dao.PersonDaoImpl">
<property name="ldapTemplate" ref="ldapTemplate" />
</bean>
It gives error
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.ldap.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]; nested exception is javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:205)
com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:266)
root cause
org.springframework.ldap.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]; nested exception is javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]
org.springframework.ldap.support.LdapUtils.convertLdapException(LdapUtils.java:191)
org.springframework.ldap.core.support.AbstractContextSource.createContext(AbstractContextSource.java:356)
org.springframework.ldap.core.support.AbstractContextSource.doGetContext(AbstractContextSource.java:140)
If with same credentials I can add ldif file from terminal then why not with my spring application?is their anything missing in configuration?
The 'username' DN needs to be the full DN of the admin user, including the base; in your case:
<ldap:context-source id="contextSource" url="ldap://localhost:389"
base="dc=test,dc=com" username="cn=admin,dc=test,dc=com" password="pass000" />
It's not uncommon for the admin user to be located in a different part of the LDAP tree than the base DN from which you want your operations to originate.

event:inbound-channel-adapter with payload-expression not able to resolve bean

I'm attempting to use the event:inbound-channel-adapter as an ApplicationEventListener to capture the ContextRefreshedEvent so I can dynamically start a file:inbound-channel-adapter like:
<file:inbound-channel-adapter id="filesIn" auto-startup="false"
directory="${input.location}" channel="fileInChannel">
<integration:poller ref="filesInPoller" />
</file:inbound-channel-adapter>
<event:inbound-channel-adapter id='appStarter' channel="nullChannel"
error-channel="errorChannel"
event-types="org.springframework.context.event.ContextRefreshedEvent"
payload-expression="#filesIn.start()"/>
But I get the following error indicating the sPel payload-expression cannot find the filesIn bean:
Exception in thread "main" org.springframework.expression.spel.SpelEvaluationException: EL1057E:(pos 1): No bean resolver registered in the context to resolve access to bean 'filesIn'
at org.springframework.expression.spel.ast.BeanReference.getValueInternal(BeanReference.java:45)
at org.springframework.expression.spel.ast.CompoundExpression.getValueRef(CompoundExpression.java:49)
at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:82)
at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:93)
at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:72)
at org.springframework.integration.event.inbound.ApplicationEventListeningMessageProducer.sendEventAsMessage(ApplicationEventListeningMessageProducer.java:113)
at org.springframework.integration.event.inbound.ApplicationEventListeningMessageProducer.onApplicationEvent(ApplicationEventListeningMessageProducer.java:91)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
Am I correct in believing that the file:inbound-channel-adapter is able to be started in this way?
Thanks
What version of Spring Integration are you using? The ability to reference a bean #filesIn was added to this adapter in 3.0.
If you are using 2.2 or below, upgrade to the current release (or at least 3.0.4).
In any case, you can't just send that command to nullChannel, it will evaluate to null and you can't have a null payload; you'll have to send '#filesIn.start()' to a <control-bus/>.
EDIT:
Or, "#filesIn.start() == null ? 'foo' : 'bar'" will send foo to the nullChannel.

XmlRpcException during TeamCity build agent registration

I have installed the TeamCity build agent on my machine a few different ways- using Java Web Start and the manual .zip distribution. Both result in viable installations, as I have once or twice been able to connect and register properly with the TeamCity server. However, upon restarting (<install_location>/bin/agent.sh stop...<install_location>/bin/agent.sh start) I get the following error in teamcity-agent.log (with extra debugging turned on in the log4j config file).
[2013-04-03 09:05:09,870] DEBUG - jetbrains.buildServer.XMLRPC - faultStringjava.lang.RuntimeException: org.jdom.input.JDOMParseException: Error on line 28: XML document structures must start and end within the same entity.faultCode0
[2013-04-03 09:05:09,878] DEBUG - buildServer.AGENT.registration - jetbrains.buildServer.xmlrpc.RemoteCallException: Call http://teamcityserver:8080/RPC2 buildServer.registerAgent3: org.apache.xmlrpc.XmlRpcException: java.lang.RuntimeException: org.jdom.input.JDOMParseException: Error on line 28: XML document structures must start and end within the same entity.
jetbrains.buildServer.xmlrpc.RemoteCallException: Call http://teamcityserver:8080/RPC2 buildServer.registerAgent3: org.apache.xmlrpc.XmlRpcException: java.lang.RuntimeException: org.jdom.input.JDOMParseException: Error on line 28: XML document structures must start and end within the same entity.
at jetbrains.buildServer.xmlrpc.AbstractXmlRpcTarget.call(AbstractXmlRpcTarget.java:94)
at jetbrains.buildServer.agent.impl.ServerXmlRpcProxy.registerAgent3(ServerXmlRpcProxy.java:62)
at jetbrains.buildServer.agent.impl.BuildAgentImpl.doRegisterOnBuildServer(BuildAgentImpl.java:776)
at jetbrains.buildServer.agent.impl.BuildAgentImpl.registerOnBuildServer(BuildAgentImpl.java:748)
at jetbrains.buildServer.agent.impl.ServerMonitor.run(ServerMonitor.java:71)
Caused by: org.apache.xmlrpc.XmlRpcException: java.lang.RuntimeException: org.jdom.input.JDOMParseException: Error on line 28: XML document structures must start and end within the same entity.
at org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeException(XmlRpcClientResponseProcessor.java:104)
at org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeResponse(XmlRpcClientResponseProcessor.java:71)
at org.apache.xmlrpc.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:73)
at org.apache.xmlrpc.TCXmlRpcClient$1.execute(TCXmlRpcClient.java:89)
at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:194)
at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:185)
at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:178)
at jetbrains.buildServer.xmlrpc.impl.CommonsXmlRpcTargetImpl$1.execute(CommonsXmlRpcTargetImpl.java:72)
at jetbrains.buildServer.xmlrpc.AbstractXmlRpcTarget.call(AbstractXmlRpcTarget.java:84)
... 4 more
[2013-04-03 09:05:09,878] WARN - buildServer.AGENT.registration - Call http://teamcityserver:8080/RPC2 buildServer.registerAgent3: org.apache.xmlrpc.XmlRpcException: java.lang.RuntimeException: org.jdom.input.JDOMParseException: Error on line 28: XML document structures must start and end within the same entity.
[2013-04-03 09:05:09,878] WARN - buildServer.AGENT.registration - Connection to TeamCity server is probably lost. Will be trying to restore it. Take a look at logs/teamcity-agent.log for details (unless you're using custom logging).
This is the xml in question according to the logs with extra xmlrpc debugging:
<?xml version="1.0"?><methodCall><methodName>buildServer.registerAgent3</methodName><params><param><value><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<agentDetails agentName="aaronhbox_0" agentPort="9090" authToken="" osName="Linux, version 3.5.0-17-generic">
<alternativeAddresses>
<address>10.2.1.232</address>
<address>192.168.225.1</address>
<address>192.168.80.1</address>
</alternativeAddresses>
<availableRunners>
<runner runType="Ant" />
<runner runType="Duplicator" />
<runner runType="gradle-runner" />
<runner runType="Inspection" />
<runner runType="Ipr" />
<runner runType="JPS" />
<runner runType="Maven2" />
<runner runType="rake-runner" />
<runner runType="simpleRunner" />
</availableRunners>
<availableVcs>
<vcs name="perforce" />
<vcs name="mercurial" />
<vcs name="jetbrains.git" />
<vcs name="svn" />
<vcs name="cvs" />
</availableVcs>
<buildParameters>
<param name="env.COLORTERM" value="gnome-terminal" />
<param name="env.COMP_WORDBREAKS"><![CDATA["'><;|]]></value></param></params></methodCall>
Only once have I been able to restart the agent and have it connect again properly. Generally, I can install it, have it run once, then restarting it gives this error. Any ideas?
It looks like the formatting of the COMP_WORDBREAKS environment variable was messing with the xml structure and not allowing the complete generation of the xml request message.
The COMP_WORDBREAKS value on my machine is "'><;|&(:.
Placing the following line in the buildAgent.properties file fixed this problem and allows the agent to properly register.
env.COMP_WORDBREAKS=
I don't see any side-effects yet of making this change; the agent now seems to behave properly.

Resources