Odd SocketException

So, every once in awhile while running our software, we get the following exception:
java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketException: No buffer space available (maximum connections reached?): recv failedThe real question here is what does this mean? Has the number of open sockets been reached so another one cannot be opened? If so, is there a way I can change that number?

So, every once in awhile while running our software, we get the following exception:
java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketException: No buffer space available (maximum connections reached?): recv failedThe real question here is what does this mean? Has the number of open sockets been reached so another one cannot be opened? If so, is there a way I can change that number?

Similar Messages

  • Exceptions, odd behavior of streaming data to outputstream

    I have a servlet which writes mp3 data to the dataoutputstream of a servlet response object. For some reason, the servlet method writes the data out and gets an exception. Then the method/servlet is called again automatically and begins to write the data out again. The exception is below. In the end the mp3 is delivered to the client fine, however with server side exceptions and odd behavior.
    try {
              int len = 0;
              resp.setContentType("audio/mpeg");
              String filename = req.getParameter("file");
              File mp3 = new File(mediaDir + filename);
              byte[] buf = new byte[1024];
              FileInputStream fis = new FileInputStream(mp3);
              DataOutputStream o = new DataOutputStream(resp.getOutputStream());
              while( (len = fis.read(buf)) != -1) {            
                 o.write(buf, 0, len);            
              o.flush();
              resp.flushBuffer();
              o.close();
              fis.close();
           catch(Exception e) {
              System.out.println(e.getMessage());
              e.printStackTrace();
    null
    ClientAbortException:  java.net.SocketException: Connection reset by peer: socket write error
         at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:366)
         at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:403)
         at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:323)
         at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:392)
         at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:381)
         at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:76)
         at java.io.DataOutputStream.write(DataOutputStream.java:90)
         at TrafficControl.streamAudio(TrafficControl.java:639)
         at TrafficControl.processRequest(TrafficControl.java:136)
         at TrafficControl.doGet(TrafficControl.java:61)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)thanks
    Edited by: black_lotus on 19-Feb-2009 3:08 PM

    There are some versions of some browsers (MS IE) that can call a servlet twice; they only look at the headers at the first request, in order to decide whether to display a "save or open" dialog, or some such reason. Try different browsers; also log the User-Agent header to see if it is "contype", which is present when the multiple request thing happens.
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;q293792
    "Connection reset" can also happen if the client closes the connection without reading the entire response. Occasional resets will happen as users cancel download.
    Not a source of exceptions but something you may still want to consider when sending large responses: by default, the servlet container will have to buffer the entire file in memory to find out its length. To save memory, either set content length before writing the data, or use chunked encoding (google should find details.) That way your write() actually streams data to the user.

  • SocketException (code = 10055)

    Hi all,
    Here i go again. We are doing some data sending from a java socket to a C socket. Now the java side is receiving data from a serial port. The data is in the order of 7920 bytes per min. Great everything works fine, till 139 thousand odd messages are send (each message i mean a byte array of 11 bytes). But after those number of messages the java side receives a socketexception and code was indicated 10055. I looked up for this code, and in MSDN could get this code to indicate a TCP buffer full
    (WSAENOBUFS (10055)
    No buffer space available.
    An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full).
    and the c side hangs. The best part is till we kill (ctrl-c) the C side i cannot even browse. I found out that if we increase the sendbuffer size on java side and c side increases the recv buffer size it would work just fine. I did that and the buffer size now is at 128K on both ends and decreased the number of bytes to 3300. But now the same error occurs after 170 thousand messages. Can anyone tell me
    1. Is sending small chunks of data a problem.
    2. What is the mbuff concept. I read someplace that the buff size is nothing but the number of mbuff the receiver tcp stack maintains.
    To worsen my problems i am suppossed to do this whole thing on WINDOWS 2000 machine.
    By the way the socket connection is to send data from a Java process to a C Process running in the same system. Does this complicate the problem??
    Any help would be great. and all the ppl who reply will be given heartfelt good wishes:). HELPPPP MEEE B4 i go mad
    arvind

    Actually its 7920 bytes period in a minite. and i have
    been able to find out that on the c side we have
    threads that read data from sockets. each thread after
    reading has to wait for few mutex and max time for
    these is 200 millisecs. SO at max there can be only 5
    messages(5*11 bytes = 55 bytes)that can be read every
    second and i was sending 12 messages(12*11 = 132
    bytes) per second before. So i did the flow control on
    the jave side and i have been able to avoid the tcp
    buffer full problem. But i still do not like this as
    the messages will come slow and the data that has to
    be received 10 secs earlier is received 10 secs
    later..... is there any other method for this.
    So each packet contains 11 bytes?
    You can definitely read more than 5 per second. Even if all else fails one way is to buffer more than one message at a time. So instead of pushing every message to the queue. Push it every 5th packet.
    Given that I have written socket handlers in java that pulled slightly more than 2000 TCP packets every second I am certain that you can increase the speed. Since java doesn't have 'mutexes' I am guessing that you are referring to synchronization and I would expect a faster time than that. How did you time the lock acquisition and release?

  • New Airport Extreme802.11n &Very Odd Network&Computer Issues

    Hi,
    We Replaced a D-Link DGL4300 802.11G and a Airport Express M9470LL/A with the most current Airport Extreme Base Station 802.11N 2.4Ghz and 5.0Ghz Dual Band and a Airport Express 802.11N (to use with a Shared USB HP1022 Laser Jet Printer. I have contacted Apple Tech Support once regarding setup and mentioned this other ? strange issue(s)
    We have broadband cable that goes to a Motorola SB5101(meets ISP specs) then Ethernet cable
    from Cable Modem to Wan Port on Airport Extreme. We have multiple computers all with wireless capability 1) Imac 800mhz 874 mb ram 802.11bAirport Card 2) eMac 1.0 Ghz 1gb ram Airport Extreme 802.11bWireless Card
    3) eMac 1.25 Ghz 1.0gb ram and a Airport Extreme 802.11bWireless Card* all running OSX Panther 10.3.9 *and each with 802.11B wireless cards 4) Macbook Pro bought Dec 2009 running Snow Leopard 4gb ram and 250gb HDand 802.11n wireless card 5) HP Tower xw4550 running Win XP Pro SP3 4gb ram 500GB HD and a 802.11G wireless card 6) Dell Mini Net Book running Win XP Home SP3 1ghz 1gb ram 150 GB HD and a
    802.11n wireless card.
    At first tried setting up the Airport Extreme with the Dell Mini as it met specs and (as of Yesterday) the Mac Book Pro is with one of our children at college but was able to set up setting up the Airport Utility and Hardware for both Peripheral Devices with the Mac Book Pro.
    Then things got odd. All the computers were online (as well as two wireless "Live" capable gaming systems XBox360 and Sony PS3 , I did not check my eMac until the next day
    and when I woke it from sleep (or started it) I got "You need to restart your computer"
    ? Kernel Panic , I ran Disk Utility, Tech Tool Deluxe, Apple Hardware Test and even Applejack. no change and while permissions were repaired Tech Tool Deluxe and The Apple Hardware Test showed no faults with anything, Tried PRAM. restart etc, then we had the other eMac 1.0ghz which has been unused since the Mac Book Pro arrived as a gift, Plugged it in , started it up, and got online, no black screen, even checked and responded to email, then restarted the (2nd eMac 1.0ghz) and the "You need to restart your computer screen came up!) once seems oh maybe, possibly its crashed, or dying out
    but two side by side, No Way! , so we then isolated electrical outlets, to the extent with a 100 foot extension cord outside on our back breezeway, same thing. We even went and bought a new battery and tried it in both , no change, * Was able to shut off the airport card in safe mode, restarted and it functioned as a normal computer with airport extreme card off
    *same with the 1.0ghz emac airport card off and restart and functions as a computer but no online access. We then moved one close to the Airport Extreme and hooked up by ethernet and changed the settings and Bingo no Kernel Panic Like screen and can get online, tried the other same thing! So currently the two eMacs sit side by side and we bought a long ethernet cord and it works on the table where it originally was,
    I did mention this to the Apple Technician that called from Apple regarding a setup issue (as have 90 days telephone support) and he said *That there have been reports of where there are with a Guest Network (we had one set up and He had us remove it as He asked if we really needed it and I said no AND also with networks with computers with wireless cards 802.11b
    and 802.11g computers on a network with the802.11n computers and a 802.11n Airport Extreme, he could not explain it any further, he suggested a possible 3rd party software incompatibilty : recent download (but have not done any on the 1.25ghz eMac and the 1.0ghz has been shut
    off since Dec 2009. I am baffled , my Wife and I were seriously considering buying a new Imac to replace the 1.25ghz after the Black screen showed up, but when the other one did the same, and did the trouble shooting and then the ethernet connect we saved ourselves a lot of money (t would be nice to have a new Imac but $$ is not there)
    and in the past week now (could be our ISP) our Internet connection has dropped off 4 times usually for 30-45 minutes but Friday 8-20-10 it was over 3 hours (yet our Cable TV came in) I will contact our ISP who handles both the broadband about the outages
    and our cable TV has been fuzzy -grainy at times, I called Them Friday and their were no outages in our area (system wide) Now though (except with Win XP) that is our access to the Airport Extreme and Utility (it blinks orange off and on when the internet is down) the Airport Express has stayed green each time. I will contact Apple also as ?
    is it the Airport Extreme (but its intermittent) channels are set to automatically if thats helpful data rather than set to a specific channel, its fairly rural where we live
    I thought of buying Tiger but saw the extreme prices and I called Apple per a recent Apple Thread they did not have Tiger Retail(nor did I expect then to) but after discussing
    the Emacs they said why pay so much for Tiger (and a lot are used) they said and went over both eMacs specs and I checked in detail online and called them back as it was in a "card hold" and bought Leopard 10.5.6 (as min of 512 ram, DVD drive (have a combo -drive) and a Power PCG4 which both are and I am now getting unused (non System) data off the eMac and backing it up as well and its job will be to be able to access the Airport Utility (Apple OSX Leopard 10.5.6 was $129.00 plus tax free shipping and it arrived yesterday so if settings need changed can do that (with Win XP the Airport Utility
    was so different and after about 4 hours and no progress I stopped and switched to he Laptop the next day!
    Has anyone experienced anything like this, I read up on both peripherals before buying and called as well to the Apple Online Store to make sure we could 1) set it up and 2) all computers specs were met to be able to a)use the network for online use and b)as well as shared printing from any and all computers and they do meet the specifications
    * one last item , my Wife's Imac is also on via Ethernet, It asked for a WEP password and that was not a option in the Airport Utility set up ,only WPA-WPA2 Personal password-Security configuration
    so She is not on wirelessly (though I know She has been as in the past, Her Imac was on a desk in the foyer ) That may have been with the 802.11b Apple Airport white dome and not the D-Link 802.11G router of which we had a lot of configuration issues
    *I could be wrong and will read up on her specs via the Mac Tracker application or online
    Many Thanks, Its so odd I did not want to leave out data etc but its a *long post and I apologize for that, I hope some one can send some light on this. On a positive avoided buying a new computer!
    but makes no sense (at least to us)!
    ambienttales
    Imac 800mhz 874mb ram 17"LCD screen OSX 10.3.9 Airport Card
    eMac1.0ghz 1.0gb ram OSX 10.3.9 802.11b Airport Extreme Card
    eMac 1.25ghz 1.0 gb ram OSX 10.3.9 802.11b Airport Extreme Care
    Mac Book Pro Bought new Dec 2009 4gb ram 250GB HD OSX 10.6.x Snow Leopard 802.11n Wireless Card
    HP xw4550 Tower 4gb ram 500gb HD Win XP Pro SP3 802.11g wireless card
    Dell Mini Net book 1ghz 1GB ram 150GB HD Win XP Home SP3 802.11N wireless care
    HP 1022 Laser Jet Printer for shared network printing
    Airport Extreme 802.11n Dual Band 2.4ghz and 5.0 ghz
    Airport Express 802.11 (to use with HP Laser Jet Printer for shared network printing
    Motorola docsis 2 Surfboard Cable Modem SB5101

    I too have a MacBook Pro (running OS X 10.6.6) and a PowerBook G4 (1.67 GHz, OS X 10.4.11) and an AirPort Extreme 802.11n. I configured the new AirPort Extreme Base Station N last week using the MacBook Pro and the PowerBook can no longer operate with AirPort on (Restart Computer message). A rep at the Genius Bar indicated that WPA2 encryption might interfere with the G4?? He recommended setting up WEP encryption, this is no longer an option using the AirPort setup assistant.
    It would be very helpful to know how this original post was resolved. The G4 SHOULD be able to work with the AirPort Extreme 802.11n in theory, right??

  • Ipod not recognized, getting odd error message

    I've seen this posted a few times, but without any hints as to how to fix the problem.
    I have a 4G 20GB iPod, just over a year old (meaning, no warranty), that has worked fine until this morning. I turned it on, and all of a sudden, it kept skipping through all of my songs, and wouldn't respond to the pause, play, etc. buttons.
    I attached it to my computer via FireWire, and I keep getting this odd error message: "You have inserted a device that has no volumes that OSX can recognize" It asks me if I want to ignore, initialize, or eject the disc. I've been having it ignore it, or eject it (staying far away from initialization). After I ejected it, I noticed that all the songs on my iPod are now missing.
    I reset the iPod, which didn't do much, and now I can't restore it, because neither the computer or iTunes recognizes my iPod. It shows up in Disk Utility, but I'm not entirely sure how to proceed.
    What happened to my iPod? I can't seem to find anything in the Apple support pages that seems similar to my situation. Any suggestions on how to get the thing to work again?
    Edit: I am using iTunes version 4.9; I have not updated to 5.0

    This is the most frustrating tech trouble!
    The same thing has happened to my iPod. It worked fine, then one day I plug it in and it says "Disc inserted is unreadable by this computer". As far as I remember, I didnt' update anything, make any changes, or adjust any settings to any of my hardware. SO WHAT HAPPENED?? And now I can't restore or doctor the iPod hardware bc my computer won't recognize it as actual hardware...
    pleeeeease help, if anyone has a way to fix this.
    The weirdest part, is that when I look at the information of the "unreadable hardware" it describes it with all the information, like how many gigs are available, how much space is used up, latest updates etc. So it can transfer information, but it pretends its unreadable? i dont understand.

  • Odd System Lock-Ups [XP-Pro SP3]

    Something odd is happening, on my normally, and otherwise stable laptop with XP-Pro SP3.
    I have observed that on Fridays, at about 11:30AM MST/USA, I get system lock-ups. Everything just freezes.
    I have poured over Event Viewer, and nothing is getting launched at about that time. Really nothing in System, or Applications, from about boot-up, other than my Browser (Chrome). Not one Warning, or Error, and little real activity.
    I cannot verify that this happens every Friday (do not remember it on Friday Jan. 13, for instance, but then the Adobe Forum Log-in went down), as I am often out of town. However, and based only on memory, this has now happened about 5 - 6 times, and always late in the morning, and on Fridays.
    Normally, I only have my Browser open, though this time also had Windows Explorer minimized. During this AM, I had PrPro, PrE and Photoshop open at times, but none was open, when the lock-up happened.
    I tend to suspect something is trying to update, but it's not showing in Event Viewer. A few times, there was a Norton Live Update Scan, but those were usually hours before. Those are not download/installs, as I have Live Update to full manual, and the same for all other such utilities.
    Does anyone have any ideas, or perhaps a monitoring utility, that will gather data, better than Event Viewer?
    TIA,
    Hunt

    hmm.... google.... i dont really trust google much....
    i used to have something ( i use xp ) that basically I had total control over when to connect to isp etc and disconnect... but for life of me cant remember what it was. that was years ago.
    now when i start computer it automatically ( partially this is due to isp of verizon ) connects and then gives me control of computer ( is part of boot and load process now ).
    your prob seems to be some kinda scheduled thing is why i was thinking maybe turn stuff ' off ' that might be trying to update or something under the radar ( is part of the system more or less.. components ...)
    this area
    you wont see this related stuff in event viewer type listings ... and gets kinda complicated to me at least.

  • Odd behavior when using custom Composite/CompositeContext and antialiasing

    Hi,
    I created a custom Composite/CompositeContext class and when I use it with antialiasing it causes a black bar to appear. I seems it has nothing to do with the compose() code but just that fact that I set my own Composite object. The submitted code will show you what I mean. There are 3 check boxes 1) allows to use the custom Composite object, 2) allows to ignore the compose() code in the CompositeContext and 3) toggles the antialiasing flag in the rendering hints. When the antialiasing flag is set and the Composite object is used the bar appears regardless of if the compose() method is executed or not. If the Composite object is not used the bar goes away.
    The Composite/CompositeContext class performs clipping and gradient paint using a Ellipse2D.Float instance.
    a) When the Composite is not used the code does a rectangular fill.
    b) When the Composite is used it should clip the rectangular fill to only the inside of a circle and do a gradient merge of background color and current color.
    c) If the compose() method is ignored then only the background is painted.
    d) When antialiasing is turned on the black bar appears, i) if you ignore the compose() method it remains, ii) if you do not use the Composite object the bar disappears (???)
    NOTE: the compose method's code is only for illustration purposes, I know that AlphaComposite, clipping and/or Gradient paint can be used to do what the example does. What I am trying to find out is why the fact of simply using my Composite object with antialiasing will cause the odd behavior.  Been trying to figure it out but haven't, any help is appreciated.
    Thx.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class TestCustomComposite2
    extends JFrame
    implements ActionListener {
        private JCheckBox useCompositeChk, useAntialiasingChk, useCompositeContextChk;
        private Shape clippingShape = new Ellipse2D.Float(100, 100, 100, 100);
        private MergeComposite composite = new MergeComposite();
        public TestCustomComposite2() {
            super("Test Custom Composite");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel cp = (JPanel) getContentPane();
            cp.setLayout(new BorderLayout());
            cp.add(new TestCanvas(), BorderLayout.CENTER);
            JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
            panel.add(useCompositeChk = new JCheckBox("Use Composite", true));
            useCompositeChk.addActionListener(this);
            panel.add(useCompositeContextChk = new JCheckBox("Use Composite Context", true));
            useCompositeContextChk.addActionListener(this);
            panel.add(useAntialiasingChk = new JCheckBox("Use Antialiasing"));
            useAntialiasingChk.addActionListener(this);
            cp.add(panel, BorderLayout.SOUTH);
            pack();
            setVisible(true);
        public void actionPerformed(ActionEvent evt) {
            useCompositeContextChk.setEnabled(useCompositeChk.isSelected());
            invalidate();
            repaint();
        private class TestCanvas
        extends JComponent {
            public TestCanvas() {
                setSize(300, 300);
                setPreferredSize(getSize());
            public void paint(Graphics gfx) {
                Dimension size = getSize();
                Graphics2D gfx2D = (Graphics2D) gfx;
                gfx2D.setColor(Color.GRAY);
                gfx2D.fillRect(0, 0, size.width, size.height);
                RenderingHints rh = null;
                if(useAntialiasingChk.isSelected()) {
                    rh = gfx2D.getRenderingHints();
                    gfx2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                Rectangle r = clippingShape.getBounds();
                //gfx2D.setColor(Color.GREEN);
                //gfx2D.drawRect(r.x, r.y, r.width, r.height);
                gfx2D.setColor(Color.YELLOW);
                gfx2D.fill(clippingShape);
                Composite oldComposite = null;
                if(useCompositeChk.isSelected()) {
                    oldComposite = gfx2D.getComposite();
                    gfx2D.setComposite(composite);
                gfx2D.setColor(Color.ORANGE);
                gfx2D.fillRect(r.x, r.y, r.width + 1, r.height + 1);
                if(oldComposite != null)
                    gfx2D.setComposite(oldComposite);
                if(rh != null)
                    gfx2D.setRenderingHints(rh);
        public class MergeComposite
        implements Composite, CompositeContext {
            public CompositeContext createContext(ColorModel srcColorModel,
                                                  ColorModel dstColorModel,
                                                  RenderingHints hints) {
                return this;
            public void compose(Raster src,
                                Raster dstIn,
                                WritableRaster dstOut) {
                if(!useCompositeContextChk.isSelected())
                    return;
                int[] srcPixel = null;
                int[] dstPixel = null;
                for(int sy = src.getMinY(); sy < src.getMinY() + src.getHeight(); sy++) {
                    for(int sx = src.getMinX(); sx < src.getMinX() + src.getWidth(); sx++) {
                        int cx = sx - dstOut.getSampleModelTranslateX();
                        int cy = sy - dstOut.getSampleModelTranslateY();
                        if(!clippingShape.contains(cx, cy)) continue;
                        srcPixel = src.getPixel(sx, sy, srcPixel);
                        int ox = dstOut.getMinX() + sx - src.getMinX();
                        int oy = dstOut.getMinY() + sy - src.getMinY();
                        if(ox < dstOut.getMinX() || ox >= dstOut.getMinX() + dstOut.getWidth()) continue;
                        if(oy < dstOut.getMinY() || oy >= dstOut.getMinY() + dstOut.getHeight()) continue;
                        dstPixel = dstIn.getPixel(ox, oy, dstPixel);
                        float mergeFactor = 1.0f * (cy - 100) / 100;
                        dstPixel[0] = merge(mergeFactor, srcPixel[0], dstPixel[0]);
                        dstPixel[1] = merge(mergeFactor, srcPixel[1], dstPixel[1]);
                        dstPixel[2] = merge(mergeFactor, srcPixel[2], dstPixel[2]);
                        dstOut.setPixel(ox, oy, dstPixel);
            protected int merge(float mergeFactor, int src, int dst) {
                return (int) (mergeFactor * src + (1.0f - mergeFactor) * dst);
            public void dispose() {
        public static void main(String[] args) {
            new TestCustomComposite2();
    }

    I got a better version to work as expected. Though there will probably be issues with the transformation to display coordinates as mentioned before. At least figured out some of the kinks of using a custom Composite/CompositeContext object.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class TestCustomComposite2
    extends JFrame
    implements ActionListener {
        private JCheckBox useCompositeChk, useAntialiasingChk, useCompositeContextChk;
        private Shape clippingShape = new Ellipse2D.Float(100, 100, 100, 100);
        private MergeComposite composite = new MergeComposite();
        public TestCustomComposite2() {
            super("Test Custom Composite");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel cp = (JPanel) getContentPane();
            cp.setLayout(new BorderLayout());
            cp.add(new TestCanvas(), BorderLayout.CENTER);
            JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
            panel.add(useCompositeChk = new JCheckBox("Use Composite", true));
            useCompositeChk.addActionListener(this);
            panel.add(useCompositeContextChk = new JCheckBox("Use Composite Context", true));
            useCompositeContextChk.addActionListener(this);
            panel.add(useAntialiasingChk = new JCheckBox("Use Antialiasing"));
            useAntialiasingChk.addActionListener(this);
            cp.add(panel, BorderLayout.SOUTH);
            pack();
            setVisible(true);
        public void actionPerformed(ActionEvent evt) {
            useCompositeContextChk.setEnabled(useCompositeChk.isSelected());
            invalidate();
            repaint();
        private class TestCanvas
        extends JComponent {
            public TestCanvas() {
                setSize(300, 300);
                setPreferredSize(getSize());
            public void paint(Graphics gfx) {
                Dimension size = getSize();
                Graphics2D gfx2D = (Graphics2D) gfx;
                gfx2D.setColor(Color.GRAY);
                gfx2D.fillRect(0, 0, size.width, size.height);
                RenderingHints rh = null;
                if(useAntialiasingChk.isSelected()) {
                    rh = gfx2D.getRenderingHints();
                    gfx2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                Rectangle r = clippingShape.getBounds();
                //gfx2D.setColor(Color.GREEN);
                //gfx2D.drawRect(r.x, r.y, r.width, r.height);
                gfx2D.setColor(Color.YELLOW);
                gfx2D.fill(clippingShape);
                Composite oldComposite = null;
                if(useCompositeChk.isSelected()) {
                    oldComposite = gfx2D.getComposite();
                    gfx2D.setComposite(composite);
                gfx2D.setColor(Color.ORANGE);
                gfx2D.fillRect(r.x, r.y, r.width + 1, r.height + 1);
                if(oldComposite != null)
                    gfx2D.setComposite(oldComposite);
                if(rh != null)
                    gfx2D.setRenderingHints(rh);
        public class MergeComposite
        implements Composite, CompositeContext {
            public CompositeContext createContext(ColorModel srcColorModel,
                                                  ColorModel dstColorModel,
                                                  RenderingHints hints) {
                return this;
            public void compose(Raster src,
                                Raster dstIn,
                                WritableRaster dstOut) {
    //            dumpRaster("SRC   ", src);
    //            dumpRaster("DSTIN ", dstIn);
    //            dumpRaster("DSTOUT", dstOut);
    //            System.out.println();
                if(dstIn != dstOut)
                    dstOut.setDataElements(0, 0, dstIn);
                if(!useCompositeContextChk.isSelected())
                    return;
                int[] srcPixel = null;
                int[] dstPixel = null;
                int w = Math.min(src.getWidth(), dstIn.getWidth());
                int h = Math.min(src.getHeight(), dstIn.getHeight());
                int xMax = src.getMinX() + w;
                int yMax = src.getMinY() + h;
                for(int x = src.getMinX(); x < xMax; x++) {
                    for(int y = src.getMinY(); y < yMax; y++) {
                        try {
                            // THIS MIGHT NOT WORK ALL THE TIME
                            int cx = x - dstIn.getSampleModelTranslateX();
                            int cy = y - dstIn.getSampleModelTranslateY();
                            if(!clippingShape.contains(cx, cy)) {
                                dstPixel = dstIn.getPixel(x, y, dstPixel);
                                dstOut.setPixel(x, y, dstPixel);
                            else {
                                srcPixel = src.getPixel(x, y, srcPixel);
                                dstPixel = dstIn.getPixel(x, y, dstPixel);
                                float mergeFactor = 1.0f * (cy - 100) / 100;
                                dstPixel[0] = merge(mergeFactor, srcPixel[0], dstPixel[0]);
                                dstPixel[1] = merge(mergeFactor, srcPixel[1], dstPixel[1]);
                                dstPixel[2] = merge(mergeFactor, srcPixel[2], dstPixel[2]);
                                dstOut.setPixel(x, y, dstPixel);
                        catch(Throwable t) {
                            System.out.println(t.getMessage() + " x=" + x + " y=" + y);
            protected int merge(float mergeFactor, int src, int dst) {
                return (int) (mergeFactor * src + (1.0f - mergeFactor) * dst);
            protected void dumpRaster(String lbl,
                                      Raster raster) {
                System.out.print(lbl + ":");
                System.out.print(" mx=" + format(raster.getMinX()));
                System.out.print(" my=" + format(raster.getMinY()));
                System.out.print(" rw=" + format(raster.getWidth()));
                System.out.print(" rh=" + format(raster.getHeight()));
                System.out.print(" tx=" + format(raster.getSampleModelTranslateX()));
                System.out.print(" ty=" + format(raster.getSampleModelTranslateY()));
                System.out.print(" sm=" + raster.getSampleModel().getClass().getName());
                System.out.println();
            protected String format(int value) {
                String txt = Integer.toString(value);
                while(txt.length() < 4)
                    txt = " " + txt;
                return txt;
            public void dispose() {
        public static void main(String[] args) {
            new TestCustomComposite2();
    }

  • My gf is borrowing an iPhone and theres a few odd things setup on it regarding wireless syncing and something under SMS with a receiving email address. I was wondering if msgs she is sending or even receiving would be going to this address.

    Another odd thing I just this second found is it looks like the phone is setup to wirelessly sync to a designated laptop as soon as it is discovered in the network. Any help or suggestion on how to stop this?

    Install ClamXav and run a scan with that. It should pick up any trojans.   
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 
    Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101

  • IMac OSX 21.5 late 2010, had MTN Lion on it. Prob with thousands of my photos in IPhoto all mixed up and intermingled with thousands of odd images I had not seen before. After trying to erase them, too numerous, I used original disk for disk utility. Disk

    Utility had issues with erasing disk. It took 36 hours and then said it was a failure. I tried repairing and verifying and partitioning. Finally, I used the original disk to install the system. It installed Snow Leopard. I was unable to install the 2nd disk ILife items, so I repurchased those. I thought I was all set but it would not upgrade past 10.6 or something. After it is all set up, I realize there is nothing on the computer. The updates were in download folders and in reading the install logs, it said the install disc was read only and the system was installed from somewhere else and then it was reaped and something about a sandbox and it seemed important that all the Asian languages were added in, even though I unchecked that option. All these odd programs and windows are on there, which I do not use and do not want on there and do not see it on there. So, I tried this several more times, it appears someone is using the Root user. I tried to disable the root user as I do not understand how to set it. Last night, I took the main partition that I put everything on and made me the owner and took over that whole disk. Then the other two were locked, do I ejected them. Then I wanted to erase 4 things - an iDisk an some other trash and the trash is suddenly emptying 989 items, I think were the logs. So, I turned it off. What is going on? I was unable to fix the install disk. The permissions were not repairable on the partition, it was verified as being ok though. Has someone taken over my computer? How can I get rid of them and get it fixed? It has affected my iPad and my iPhone 5. I really need these devices. I am an artist and need to take and post photos of my work. Is this Chinese people doing this and are they nearby?  I did notice they wanted me to sign up for mo ole me. in the logs  it even said, no [email protected]. And no password access at that address.  So, I was also not able to update to Mountain Lion and Icloud again. at one point it looked like I had. i downloaded everything I purchased that was in Icloud to Itunes and it showed the lion in Mail but there was no cloud icon and Mountain Lion said to install, meaning it was not installed. System information confirmed this. oh, and my main disk in disk Utility is named with an unchangeable name that is the serial number of the mac and it says it is an in/out sata media drive. Please, please help me.

    1. If you break your post into paragraphs it is much easier to read.
    2. I have no idea what your post is referring to, and how - if at all - it relates to iPhoto.
    3. It's a good idea to re-read what you've posted, and ask yourself how it might look to someone who doesn't know you and doesn't know what's going on with your machine.

  • Restored SP2010 site "broken" in an odd way - home.aspx is not accessible, but default.aspx is.

    So we are testing out a 3rd party backup and recovery tool. The testing for individual pages and list items went pretty well. However, we are seeing really odd behavior when attempting to recover the sites. Obviously we will be working with the vendor on
    the issue from their side of things.
    I just don't know if there is something that we might have configured oddly that might be contributing to the issue.
    I created a from scratch test site using the team template on our SP 2010 service pack 2 farm.
    We have an F5 load balancer handing traffic off two 2 web front end servers, with two application servers behind the scenes along with a sql server.
    The product backed up the content, then I deleted the site so that we could test the restore ability.
    There are a number of problems that we see right off the bat when trying to recover a site.
    1. The Site Pages/Home.aspx appears to have a problem - attempting to access it creates an error page that the ULS describes as:
    Timestamp             
    Process                                
    TID         Area                         
    Category                     
            EventID               
    Level                    
    Message             
    Correlation
    04/10/2014 10:50:29.92 w3wp.exe (NTPSSPFE01NEW:0x0E14)        
    0x13DC SharePoint Foundation        
            Logging Correlation Data     
             xmnv    
    Medium              
    Name=Request (GET:http://myfarm:80/sites/IT/d27/col/SecondTestSite/SitePages/Home.aspx)
    a7a882f4-71c9-40aa-aeb5-8d089467ad4b
    04/10/2014 10:50:29.93 w3wp.exe (NTPSSPFE01NEW:0x0E14)        
    0x13DC SharePoint Foundation        
            Logging Correlation Data     
             xmnv    
    Medium              
    Site=/sites/IT     a7a882f4-71c9-40aa-aeb5-8d089467ad4b
    04/10/2014 10:50:29.93 w3wp.exe (NTPSSPFE01NEW:0x0E14)        
    0x13DC SharePoint Foundation        
            Monitoring                   
    b4ly        High      
    Leaving Monitored Scope (PostResolveRequestCacheHandler). Execution Time=7.44193745294444               
    a7a882f4-71c9-40aa-aeb5-8d089467ad4b
    04/10/2014 10:50:29.96 w3wp.exe (NTPSSPFE01NEW:0x0E14)        
    0x13DC SharePoint Foundation        
            Runtime                      
    tkau       Unexpected      
    System.FormatException: Input string was not in a correct format.   
    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)    
    at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)    
    at System.Convert.ToInt32(String value, IFormatProvider provider)    
    at Microsoft.SharePoint.Utilities.SPUtility.CreateSystemDateTimeFromXmlDataDateTimeFormat(String strDT, Boolean fPreserveMilliseconds)    
    at Microsoft.SharePoint.ApplicationPages.Calendar.SafeFieldAccessor.GetDateTimeFieldValue(SPItem item, String fieldName)    
    at Microsoft.SharePoint.ApplicationPages.Calendar.CalendarItemRetriever.<RetrieveInternal>b__0(SPItem item)    
    at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() ...            
    a7a882f4-71c9-40aa-aeb5-8d089467ad4b
    04/10/2014 10:50:29.96*              
    w3wp.exe (NTPSSPFE01NEW:0x0E14)        
    0x13DC SharePoint Foundation        
    Runtime                      
            tkau      
    Unexpected       ...   
    at System.Linq.Enumerable.<ExceptIterator>d__92`1.MoveNext()    
    at System.Linq.Buffer`1..ctor(IEnumerable`1 source)    
    at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()    
    at Microsoft.SharePoint.ApplicationPages.Calendar.CalendarItemRetriever.ConvertItemType(IEnumerable`1 items)    
    at Microsoft.SharePoint.ApplicationPages.Calendar.DefaultCalendarListAccessor.Retrieve(String selectedDate, String scope, Dictionary`2 entityInfo)    
    at Microsoft.SharePoint.ApplicationPages.Calendar.CalendarService.CreateStartupResponse(ICalendarAccessor accessor, Dictionary`2 parameters, String viewType, String selectedDate)    
    at Microsoft.SharePoint.ApplicationPages.WebControls.AjaxCalendarView.CreateStartupData(String viewType, String selectedDate)    
    at Microsoft.SharePoint.Appl...              
    a7a882f4-71c9-40aa-aeb5-8d089467ad4b
    04/10/2014 10:50:29.96*              
    w3wp.exe (NTPSSPFE01NEW:0x0E14)        
    0x13DC SharePoint Foundation        
    Runtime                      
            tkau      
    Unexpected               
    ...icationPages.WebControls.AjaxCalendarView.CreateBodyOnLoadScript(SPWeb web)    
    at Microsoft.SharePoint.ApplicationPages.WebControls.AjaxCalendarView.OnPreRender(EventArgs e)    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Control.PreRenderRecursiveInternal()    
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStag...               
    a7a882f4-71c9-40aa-aeb5-8d089467ad4b
    04/10/2014 10:50:29.96*              
    w3wp.exe (NTPSSPFE01NEW:0x0E14)        
    0x13DC SharePoint Foundation        
    Runtime                      
            tkau      
    Unexpected       ...esAfterAsyncPoint)   
    a7a882f4-71c9-40aa-aeb5-8d089467ad4b
    04/10/2014 10:50:29.96 w3wp.exe (NTPSSPFE01NEW:0x0E14)                    0x13DC SharePoint Foundation        
            Monitoring                                   
    b4ly        Medium               Leaving Monitored Scope (Request (GET:http://myfarm:80/sites/IT/d27/col/SecondTestSite/SitePages/Home.aspx)).
    Execution Time=50.8621207443963               a7a882f4-71c9-40aa-aeb5-8d089467ad4b
    2. What we did find was a
    http://myfarm/sites/IT/d27/col/SecondTestSite/default.aspx page that displayed what SitePages/Home.aspx used to be.
    However, that page is not marked as the home page. I know I can mark that page as the home page to get around the problem - but why would the original page not load any longer? I tried going into the Site Pages library and the how to use the featurees page
    still works okay - just not the home page.
    I also am finding that the them of the site was lost, a workflow attached to a list was lost - I don't just mean one instance of the workflow; the list no longer has a workflow attached to it. Also the default view of a calendar part on the front page was
    lost.
    Is this common for SharePoint site recoveries - to lose various fundamental settings?
    I am just wondering whether this sounds like something site specific or if it sounds like every other recovery out there.
    Thank you

    Hi,
    According to your description, my understanding is that the error occurred when you used a 3rd party backup and recovery tool.
    I recommend to use Backup-SPSite and Restore-SPSite command to see if the issue still occurs.
    If not, then the error should be regarding to the 3rd party tool, you need to get help from the experts who are professional at the 3rd party tool.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • User gets odd behavior when print previewing calendar

    User calls with an odd problem.
    She is using 32 bit IE 9 with our SP 2010 farm.
    She goes to her department calendar. She sees events.
    She presses Print Preview. No events are shown on the page.
    She tries to export the data to Outlook - it tells her there is too much data.
    She calls me.
    I look - her default view is running into the resource throttling of the farm. So I try to create a unique view that only shows this week's events.
    It works fine for me. Print preview and printing work as well.
    When she looks at it in her browser, it works fine.
    When she tries to print preview - no events show up on the preview page.
    She tries to export from the new view - Outlook gets no events.
    She is using IE9, so the IE7 comments in old threads are not relevant.
    I set the web part configuration to 12 inches as one conversation suggestions. That doesn't help.
    Does anyone else have any ideas of things to try?

    When I look at the custom calendar within SharePoint Designer, the page has a ListView Web Part but not an XsltListViewWebPart.
    I have tried several times to step through blog entries that describe editing the page, setting the view of the web part, etc. At one point whatever I tried turned the calendar view into a list view ... sigh. I created a new calendar view and made it
    the default.
    I have asked the user to try the print preview out today to see if it works for her after I created the new view.
    The really odd thing about all of this is that at least 2 people don't have the problem with not seeing event data in the print preview.
    It _almost_ sounds like some sort of machine specific issue she is having.
    I wonder if I should ask the admins to repair Office 2010 on her machine to make certain the DLLs are all working properly.

  • I recently updated my iPhone 4s to ios6, and lost 1200 odd contacts. I have a backup from about 4-5 months ago avaiable.  Can I add/update contacts from the back up rather than restore which i assume will literally delete any new contacts added...?

    I recently updated my iPhone 4s to ios6, and lost 1200 odd contacts. I recently sold my macbook air and also my mac book pro, so have no recent backups avaiable.  I have a backup from about 4-5 months ago available on an external hdd as a time machine backup.  Can I add/update contacts from the back up rather than restore?  The reason i wish to do this is because in the update i didnt lose any messages, so all of the people i have met and networked with since that last update those many months ago, i have in my messages listings.  They are all unidentified numbers at present but over time i will be able to work through the messages and based on the conversation recall who each was with.  Also, yesterday, some two weeks after the update had left my contacts list entirely empty... a vast majority just reappeard, though all of them are without any phone numbers, all just emails or facebook contacts.  This is the work of facebook not mac/ios6 isnt it...?  Any help here would be greatly apprecaited.  I am about 2 days from flying to canada and having those contacts would make life a lot easier.

    You should be syncing your contacts with an app on your computer or cloud service (iCloud, Gmail, Yahoo, etc), and not relying on a backup.  If you haven't been doing this, start now and then restore your old backup.  You will then be able to sync the new contacts back into the phone.  However, you will lose all messages, etc newer thant the backup.

  • Just checking on another odd feature: Typedef enum Property Node "Value" not reflecting changes in the Typedef?

    Just encountered this odd behavior in LV 2011 which I reduced to the following example:
    - create a new VI and drop an enum control on te FP.
    - make this control a typedef and open the corresponding typedef
    - create a "case 1" item and a "case 2" item
    - save the typedef (I used the name Typedef Control 1) and CLOSE it (this is to allow updating of the original control).
    - drop a case structure on the diagram and connect the enum to it:
    So far so good. Now create a "Value" Property node for the enum and use it instead of the terminal:
    If I now go back to the typedef and add a "case 3" item, save the typedef and close it, the control is updated, but the Property node is not.
    How do I know that? For one, the Case Structure contextual menu does not offer to create a case for every value. Also, if I add a "case 3" case manually, it turns red.
    Luckily, the magic Ctrl-R key stroke actually does solve this problem.
    Tested in LV 2011.

    By Ctrl-R trick do you simply mean running the VI?  That is one way to force a recompile, but if you hold down Ctrl while pressing the run button you can recompile without running.  This should not be "dangerous" in any situation.
    As you have drawn your example, I see no reason not to use a local in that situation (ok, maybe for vanity).  Still, I view the behavior you describe as a bug, and it should certainly be fixed for the benefit of local haters out there.  You have to be a little careful where you draw the line between what gets handled in real time and what gets handled only at compile time.

  • How to print new order in odd page or new page

    Hi Experts,
    I want to print my order layout in oddpage. If any new order comes it should print inthe odd page. Currently its printing Back to back.
    But I want to print my order layout in oddpage or new page.
    Any one guide this??
    Offering points is against the terms of engagement.  Text changed by moderator.  Also, do not post the same question in more than one forum.
    Mohana
    Edited by: Mohana Vijayan on Oct 31, 2008 8:35 AM

    Hi mohana,
    For script or smartform?
    In case smartform
    Create  pages as per your requirement.
    In the global defintion --> initialization tab -->
    if w_page = 1.
    control_parameters-startpage = '%PAGE1'.
    else.
    control_parameters-startpage = '%PAGE2'.
    ENDIF.
    Regards,
    Sravanthi

  • At odd times I will get a second instance of Firefox startup. I have run avast av, spybot, malwarebytes, both in normal and safe mode and nothing has been found, any ideas?

    at odd times I will get a second instance of Firefox startup. I have run avast av, spybot, malwarebytes, both in normal and safe mode and nothing has been found, any ideas?

    That second one sounds like malware.
    Do a malware check with some malware scanning programs on the Windows computer.<br />
    You need to scan with all programs because each program detects different malware.<br />
    Make sure that you update each program to get the latest version of their databases before doing a scan.<br /><br />
    *http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    *http://www.superantispyware.com/ - SuperAntispyware
    *http://www.microsoft.com/security/scanner/en-us/default.aspx - Microsoft Safety Scanner
    *http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    *http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    *http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

Maybe you are looking for

  • Firefox crashes, then when restarts, it doesn't go to the page where it crashes. It is blank, so I have to reboot

    Firefox is crashing but restarting to a blank page. I then have to start all over again. Information on the crash is sent to Firefox on the crash, but it doesn't explain why it is not reopening to the place where the crash occurred. I am not getting

  • Business rules attached to form

    Hi Business rules attached to form was disappeared, after we install 9.3.1 shared services services pack1.BR's is there in EAS and i can run them from there.But i can not see them in any where in planning.I am not able to see in the list of BRs, when

  • The sound on my G5 imac disappears when playing itunes

    The sound on my imac just cuts out when playing itunes. If I press the Sound Increse or Decrease button on the keyboard it comes back - for a while ! The problem doesn't seem to be affected by anything else running. The only thing that does seem to h

  • Macbook to Asus monitor resolution problem

    I have a '08 Macbook connected to an Asus monitor via DVI. I've been working at 1280 x 800 with a "usable" resolution of 1280 x 720 (listed in Mac Color LCD dialogue box). In the Asus VH238 dialogue box, many higher resolutions are available (max 192

  • FCE Freezes while importing video

    While importing video, FCE freezes, usually within 3-4 minutes of capture. I have to force quit. I am using Capture Now. I have no problem importing with iMovie. In fact I've been importing in to iMovie and then copying the clips into FCE to get arou