Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8946703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:34:57+00:00 2026-06-15T12:34:57+00:00

I am running a (selfmade) middleware Service Connector (SC) basing on netty (3.2.5.Final.jar) which

  • 0

I am running a (selfmade) middleware “Service Connector (SC)” basing on netty (3.2.5.Final.jar) which basically is a proxy for http traffic. Any incoming request is forwarded to a remote node, an apache at the end.

public void messageReceived(ChannelHandlerContext ctx, MessageEvent event) throws Exception {
        ChannelBuffer msg = (ChannelBuffer) event.getMessage();
        outboundChannel.write(msg);
}

I am sending a request over the browser to the SC for example: “http://localhost:9104/testHtml.htm”

it usually works perfect! Occasionally the browser loops forever. Different patterns (different files, sizes, times)

Looking into the netty log:

2012-11-28 17:54:12.326+0100 [New I/O server boss #9 ([id: 0x015bdc50, /10.43.18.160:9104])] DEBUG (org.jboss.netty.handler.logging.LoggingHandler:39) - [id: 0x00f6fd54, /10.43.18.160:52499 => /10.43.18.160:9104] OPEN
2012-11-28 17:54:12.342+0100 [New I/O server boss #9 ([id: 0x015bdc50, /10.43.18.160:9104])] DEBUG (org.jboss.netty.handler.logging.LoggingHandler:39) - [id: 0x00f6fd54, /10.43.18.160:52499 => /10.43.18.160:9104] BOUND: /10.43.18.160:9104
2012-11-28 17:54:12.357+0100 [New I/O server boss #9 ([id: 0x015bdc50, /10.43.18.160:9104])] DEBUG (org.jboss.netty.handler.logging.LoggingHandler:39) - [id: 0x00f6fd54, /10.43.18.160:52499 => /10.43.18.160:9104] CONNECTED: /10.43.18.160:52499
2012-11-28 17:54:12.342+0100 [SC_WORKER thread-13] DEBUG (org.jboss.netty.handler.logging.LoggingHandler:39) - [id: 0x00f6fd54, /10.43.18.160:52499 => /10.43.18.160:9104] CHANGE_INTEREST: 0
2012-11-28 17:54:12.420+0100 [New I/O server worker #9-20] DEBUG (org.jboss.netty.handler.logging.LoggingHandler:39) - [id: 0x00f6fd54, /10.43.18.160:52499 => /10.43.18.160:9104] RECEIVED: BigEndianHeapChannelBuffer(ridx=0, widx=501, cap=501) - (HEXDUMP: ....)
2012-11-28 17:54:12.435+0100 [SC_WORKER thread-13] DEBUG (org.jboss.netty.handler.logging.LoggingHandler:39) - [id: 0x00f6fd54, /10.43.18.160:52499 => /10.43.18.160:9104] INTEREST_CHANGED
2012-11-28 17:54:12.451+0100 [SC_WORKER thread-11] DEBUG (org.jboss.netty.handler.logging.LoggingHandler:43) - [id: 0x00f6fd54, /10.43.18.160:52499 => /10.43.18.160:9104] EXCEPTION: java.lang.NullPointerException
java.lang.NullPointerException
    at org.serviceconnector.net.res.netty.tcp.proxy.NettyTcpProxyResponderRequestHandler.messageReceived(NettyTcpProxyResponderRequestHandler.java:127)
    at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:69)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619) 

In debug mode i can see either msg nor outboundChannel is null :/
if i change to code to the following it works.

just write the message again in case of error

try{
  outboundChannel.write(msg);
} catch(Throwable t) {
  outboundChannel.write(msg);
}

or slow down the thread

Thread.sleep(200);
outboundChannel.write(msg);

guess i am facing a race condition. it only happens on slow machines
of course its hard to reproduce, unfor. i am not able to provide an example.

i tried netty 3.5.10.Final with the same behavior. any one observing similar behaviour?
thx!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:34:57+00:00Added an answer on June 15, 2026 at 12:34 pm

    outboundChannel can only be null if messageReceived is invoked before channelOpen. Usually, it never happens, but it can happen if your pipeline has an ExecutionHandler before your handler and you are using an unordered executor service. If so, please use an ExecutorService such as OrderedMemoryAwareThreadPoolExecutor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Running an iOS simulator, is there any way to get information related to memory
Running under local development, I'm trying to make a WebRequest to http://127.0.0.1:8000 under Windows
Running the Ubuntu cloud page http://www.ubuntu.com/business/cloud/overview through http://validator.w3.org/ gives several errors, the majority of
Running an MVC web site that calls a WCF service. Site and service on
Running any of the Crystal Reports 10.5 redistributables ( CRRedist2008_x86.msi , CRRedist2008_x64.msi or CRRedist2008_ia64.ms
Running a wordcount example provided by http://developer.yahoo.com/hadoop/tutorial/module3.html#running I am running hadoop on a VM
Running Solr on Tomcat 7 on Win 2008 Server. I am looping through a
Running my script through Devel::NYTProf showed that the following portion of code took up
Running Puppet v2.7.14 on CEntOs 6 and also using Apache/Passenger instead of WEBrick. I
Running the following line in my script gives me a Permission denied error: $config_out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.