web stats
Http Listener: MalformedURLException - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
Old 12-19-2012, 02:10 PM
isys2 isys2 is offline
What's HL7?
Join Date: Dec 2012
Posts: 1
isys2 is on a distinguished road
Default Http Listener: MalformedURLException


I'm trying to setup a http listener on port 21335 and getting the error below.
The MalformedURLException mentioned input string 21335http, which is the port 21335 and http. I'm not sure where it is getting that url.

Any help would be...helpful... appreciated.

[2012-12-19 15:04:41,443] ERROR (com.mirth.connect.connectors.http.HttpMessageConv erter:84): Error converting HTTP request.
java.net.MalformedURLException: For input string: "21335HTTP"
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at com.mirth.connect.connectors.http.HttpMessageConve rter.httpRequestToXml(HttpMessageConverter.java:42 )
at com.mirth.connect.connectors.http.HttpMessageAdapt er.setMessage(HttpMessageAdapter.java:38)
at com.mirth.connect.connectors.http.HttpMessageAdapt er.<init>(HttpMessageAdapter.java:19)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.mule.util.ClassHelper.instanciateClass(ClassHe lper.java:271)
at org.mule.util.ClassHelper.instanciateClass(ClassHe lper.java:278)
at org.mule.providers.service.ConnectorServiceDescrip tor.createMessageAdapter(ConnectorServiceDescripto r.java:270)
at org.mule.providers.AbstractServiceEnabledConnector .getMessageAdapter(AbstractServiceEnabledConnector .java:149)
at com.mirth.connect.connectors.http.HttpMessageRecei ver.processData(HttpMessageReceiver.java:182)
at com.mirth.connect.connectors.http.HttpMessageRecei ver.access$400(HttpMessageReceiver.java:49)
at com.mirth.connect.connectors.http.HttpMessageRecei ver$RequestHandler.handle(HttpMessageReceiver.java :67)
at org.eclipse.jetty.server.handler.ContextHandler.do Handle(ContextHandler.java:943)
at org.eclipse.jetty.server.handler.ContextHandler.do Scope(ContextHandler.java:879)
at org.eclipse.jetty.server.handler.ScopedHandler.han dle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.HandlerWrapper.ha ndle(HandlerWrapper.java:110)
at org.eclipse.jetty.server.Server.handle(Server.java :349)
at org.eclipse.jetty.server.HttpConnection.handleRequ est(HttpConnection.java:441)
at org.eclipse.jetty.server.HttpConnection$RequestHan dler.headerComplete(HttpConnection.java:919)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpPa rser.java:421)
at org.eclipse.jetty.http.HttpParser.parseAvailable(H ttpParser.java:218)
at org.eclipse.jetty.server.BlockingHttpConnection.ha ndle(BlockingHttpConnection.java:50)
at org.eclipse.jetty.server.bio.SocketConnector$Conne ctorEndPoint.run(SocketConnector.java:245)
at org.eclipse.jetty.util.thread.QueuedThreadPool.run Job(QueuedThreadPool.java:598)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.r un(QueuedThreadPool.java:533)
at java.lang.Thread.run(Unknown Source)
Attached Files
File Type: xml PDS XDS.xml (4.5 KB, 22 views)
Reply With Quote
Old 12-19-2012, 10:40 PM
StefanScholte StefanScholte is offline
Join Date: May 2009
Location: Netherlands, Harderwijk
Posts: 321
StefanScholte is on a distinguished road

strange I imported your channel and it appears to be working (calling from IE)
Reply With Quote
Old 12-20-2012, 07:13 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road

It works fine for me. One thing I noticed is that you're responding with a custom response variable with this message: "HTTP/1.1 200 OK<CR><LF><CR><LF". First, it's probably worth noting that the string "<CR><LF>" doesn't magically turn into a carriage return and line feed; you'll have to use '\r\n' or '\x0D\x0A' for that.

Second, assuming that the response status is SUCCESS, the HTTP Listener will already return a 200 code for you. As it stands now, here's what your channel will respond with:

HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 30
Server: Jetty(7.5.4.v20111024)

HTTP/1.1 200 OK<CR><LF><CR><LF
If you put this in your postprocessor:

responseMap.put('Custom ACK', ResponseFactory.getSuccessResponse(''));
Your source connector will still return a 200 response code, because the response status you're returning is successful. However, if you do this:

responseMap.put('Custom ACK', ResponseFactory.getFailureResponse(''));
Then your source connector will return a 500 error code. That functionality is most often used in the postprocessor to return a specific response based on the success or failure of a destination:

if ($r('Destination 1').getStatus() == 'SUCCESS')
	responseMap.put('Custom ACK', ResponseFactory.getSuccessResponse(''));
	responseMap.put('Custom ACK', ResponseFactory.getFailureResponse(''));
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.

- How do I foo?
- You just bar.
Reply With Quote
Old 12-21-2012, 02:50 AM
StefanScholte StefanScholte is offline
Join Date: May 2009
Location: Netherlands, Harderwijk
Posts: 321
StefanScholte is on a distinguished road

Thank you I didn't knew it worked like this.
Reply With Quote
Old 02-18-2013, 04:09 PM
mlrichman mlrichman is offline
Mirth Newb
Join Date: Jul 2009
Location: Malvern, PA
Posts: 12
mlrichman is on a distinguished road


Did you ever get this resolved. I'm encountering the same issue:

[2013-02-18 19:50:50,625] ERROR (com.mirth.connect.connectors.http.HttpMessageConv erter:84): Error converting HTTP request.
java.net.MalformedURLException: For input string: "7015HTTP"


Reply With Quote

http listner

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -8. The time now is 01:09 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation