Netbios Name query injected into socket connect.

Folks,
I have a java application which communicates to a networking device via sockets.
It was written with J2SE 1.4, I have ported it to 1.5/5.0.
When issuing a socket connect, I observe that the application/JRE is issuing
several Netbios Name queries to the device.
The device is responding with ICMP Destination unreachable.
After 3 Name queries, the socket connect continues as before (1.4) and the app proceeds as before.
The problem is that the name queries has introduced a 9 second delay to each connect to the appliance and the app now appears unresponsive.
This did not happen with JRE1.4. I have made no changes to the socket code.
Is there a way to stop the name queries?
The getHostName in the JRE connect code below is causing the name queries.
java.net.SocksSocketImpl
    protected void connect(SocketAddress endpoint, int timeout) throws IOException {
     SecurityManager security = System.getSecurityManager();
     if (endpoint == null || !(endpoint instanceof InetSocketAddress))
         throw new IllegalArgumentException("Unsupported address type");
     InetSocketAddress epoint = (InetSocketAddress) endpoint;
     if (security != null) {
         if (epoint.isUnresolved())
          security.checkConnect(epoint.getHostName(),
                          epoint.getPort());
         else
          security.checkConnect(epoint.getAddress().getHostAddress(),
                          epoint.getPort());
     if (server == null) {
         // This is the general case
         // server is not null only when the socket was created with a
         // specified proxy in which case it does bypass the ProxySelector
         ProxySelector sel = (ProxySelector)
          java.security.AccessController.doPrivileged(
              new java.security.PrivilegedAction() {
               public Object run() {
                   return ProxySelector.getDefault();
         if (sel == null) {
           * No default proxySelector --> direct connection
          super.connect(epoint, timeout);
          return;
         URI uri = null;
--->>>>>>>> String host = epoint.getHostName();
         // IPv6 litteral?
         if (epoint.getAddress() instanceof Inet6Address &&
          (!host.startsWith("[")) && (host.indexOf(":") >= 0)) {
          host = "[" + host + "]";
         }Mauro Zallocco.

The resolution of this is to turn off the new proxy server feature in JRE1.5.
You do this by informing the jre that you do not have a default proxy server.
This is done with the following lines of code placed somewhere in you application:
import java.net.ProxySelector;
ProxySelector.setDefault(null);
With this, the NetBIOS name queries do not emanate, and we revert back to the 1.4 behavior.
Mauro Zallocco.

Similar Messages

  • Netbios name required for Windows 7 clients to connect?

    I upgraded my production server to Lion tonight. 
    My Windows 7 test machines (all standalone -- no AD here) now need to log into the server with the netbios name of the 10.7 server as part of the login:
    ie, instead of "maser" as the User Name
    it now requires "<netbiosname>\maser" as the User Name
    Everything works, but that futz's up the pass-through authentication I had set up for the Win7 users whom I had just set their Windows account/password combination to match the 10.6 server account/password combination.
    (smb://<server> from the Mac side doesn't care about the netbios name…)
    Any suggestions on what might need to be tweaked in com.apple.smb.server.plist?
    - Steve

    Hi,
    According to the error message: 接收到显式 EAP 失败, you can refer to the KB below to download and install hotfix tool for this problem for test.
    Windows 7 does not connect to an IEEE 802.1X-authenticated network if an invalid certificate is installed:
    http://support.microsoft.com/kb/2494172/en-us
    In addition, another library that teaching about Configure 802.1X Wired Access Clients for EAP-TLS Authentication might be helpful with your problem.
    http://technet.microsoft.com/en-us/library/dd759237.aspx
    Roger Lu
    TechNet Community Support

  • MII and Plant Connectivity 2.2 Bi-directional Socket Connection

    Hi,
    I have to send a command to a serial device from within MII via a socket connection to be able to have a respons from the device.  I know in Plant Connectivity a socket connector can be setup. But is it also possible to send a message from MII to the serial device over Plant Connectivity, because it seems that the socket can only be setup to trigger notifications based on received messages from sources (and not from destinations). I read this functionality was planned to be build into Plant Connectivity 2.2, but I can't figure out how to set it up?
    kind regards,

    Hi Bram,
    We can set up connection between PCO & MII through "UDC" connector. UDC connector is available in MII through
    Data Services --> Data Servers --> New --> UDC and click on "OK" button.
    You need to provide all PCO system details like server name, Port number etc and save the connection. Check the status of connectivity through Data Services --> Connection Status.
    Go through the URL : http://help.sap.com/saphelp_mii121/helpdata/en/43/e80b59ad40719ae10000000a1553f6/frameset.htm
    Navigate to Data Services --> SAP MII Workbench --> Query Template --> Tag Query
    Upon successful connection, open SAP MII workbench (Data Services --> SAP MII Workbench) and create a new "Tag Query" template to pull details from PCO.
    So far, we pulled information from PCO, manipulated those values in MII and send these values to ERP to create notification. Let us know business scenario on which you need to send back information to PCO from MII.
    Thanks
    Rajesh.S

  • Open a Socket Connection

    I have an RFID reader that has an internal memory bank that
    stores rfid scans. From speaking to the company in order to get the
    data off I need to create a socket connection to port 8080 and send
    RQL (which is similar to sql) and then it will send me back piped
    results.
    Can anyone assist me on how to open a connection to ip
    192.168.1.139 port 8080 and send this
    SELECT read_count, protocol_id, antenna_id, id FROM tag_id
    WHERE protocol_id='GEN2' set time_out=8000
    and then output the results it returns.
    Thanks in advance!

    Thanks for your response, ok i've change the code to use the
    following, but now it just hangs... i.e. it looks like it's working
    in the browser but then just times out.
    <cfsetting requesttimeout="1000">
    <cfflush interval="5">
    <!-- begin code sample -->
    <cfset serverStruct = structNew() />
    <!-- the variables -->
    <cfset serverStruct.serverIp = "192.168.1.139" />
    <cfset serverStruct.serverPort = "8080" />
    <cfset serverStruct.portConnected = "" />
    <cfset sLines = "">
    <!--- Create the socket object --->
    <cfset objSocket = CreateObject("java", "java.net.Socket")
    />
    <!--- Connect --->
    <cftry>
    <!--- Set up socket to IP:port of remote server --->
    <cfset objSocket.init(serverStruct.serverIp,
    serverStruct.serverPort)/>
    <cfset serverStruct.portConnected =
    objSocket.isConnected()>
    <!--- Did we connect? --->
    <cfif serverStruct.portConnected>
    <!-- create the string. Note the use of quotes to escape
    quotes in a string -->
    <cfset mySendData = "SELECT id FROM tag_id WHERE
    protocol_id='GEN2';">
    <!--- obtain the streams --->
    <cfset input = objSocket.getInputStream()>
    <cfset output = objSocket.getOutputStream()>
    <!--- set up buffered reader for the socket; it will read
    character data
    into a buffer until until enough of it can be processed
    efficiently. However,
    a buffered reader reads a reader object, hence we first have
    to convert the
    inputstream into a reader --->
    <cfobject class="java.io.BufferedReader" name="brObj"
    action="CREATE" type="JAVA">
    <cfobject class="java.io.InputStreamReader" name="isrObj"
    action="CREATE" type="JAVA">
    <cfset streamReader = isrObj.init(input)>
    <cfset dataBuffer = brObj.init(streamReader)>
    <!--- send the data to the remote server --->
    <cfobject class="java.io.PrintStream" name="pwObj"
    action="CREATE" type="JAVA">
    <cfset writer = pwObj.init(output)>
    <cfset sentData = writer.println(mySendData)>
    <!--- Get the response from the server --->
    <!---<cfset response = dataBuffer.readLine()>
    <cfset sLines = "">--->
    <cfset sLine = dataBuffer.readLine()>
    <cfloop condition="#isDefined('sLine')#">
    <cfset sLines = "#sLines##sLine#">
    <cfset sLine = dataBuffer.readLine()>
    </cfloop>
    <!--- Close the streams and the connection --->
    <cfset streamReader.close()>
    <cfset dataBuffer.close()>
    <cfset writer.close()>
    <cfset objSocket.close()>
    </cfif>
    <cfcatch type="any">
    something went wrong.
    </cfcatch>
    </cftry>
    <cfdump var="#sLine#">

  • Trouble with DNS/NetBIOS name resolution over VPN

    I’ve got one for the DNS/WINS gurus out there who are also familiar with VPN connections.
    We have a VPN setup on our Mikrotik RouterBoard 532 for a number of employees running Windows 7 Pro laptops. Unfortunately the Mikrotik is maintained by our ISP so I don’t have access to it, but I can call them to make changes. Anyhow, I do not believe it
    is a problem with the Mikrotik.
    The problem is with resolving NetBIOS names (UNC paths, drive letters, etc…) over the VPN from remote locations, and ONLY with laptops joined to our
    abc.local domain. If I use my home PC or disjoin the domain laptop from the
    abc.local domain and return it to WORKGROUP, keeping the same Windows VPN client settings, I am able to resolve paths just fine.
    For example, when I type \\server1 from Start>Run, it fails and tells me “server1 is not accessible. You might not have permission to use this network resource.” Using the FQDN is no problem at all, which makes me believe the problem is with NetBIOS resolution
    and takes me to the WINS servers on the network.
    The VPN hands out primary and secondary WINS servers, and they appear to be configured correctly in our Server 2003/2008/2012 environment. When I run
    nbtstat –A IPAddressOfLaptop from a WINS server it resolves the laptop, and the same command from the laptop looking to the server resolves OK too.
    What’s strange is that when I ping “server1” I get a valid response from server1.abc.local, as expected, but for some reason I still can’t browse to it from start>Run… “\\server1”.
    The DNS suffix abc.local is in the “DNS suffix or this connection” field in the properties of the VPN client since the Mikrotik VPN is unable to deal this to clients.
    I have ruled out Group Policy as the culprit because even after removing any group policy from applying to one of the laptops the result was the same.
    I’ve used every resource and tool that I could to try and find where the problem lies and can’t seem to solve it. Everything looks properly configured.
    I would greatly appreciate some assistance!

    When you run an ipconfig /all, do you see the WINS server addresses being provided? How about the connection specific suffix for the domain, domain.local (or whatever it is called)?
    I assume that you are using the Microtik as the VPN server and you are not using AD accounts for authentication. I would highly suggest to do that, otherwise, there will be a mismatch.
    What VPN client is being used?
    What is offering DHCP, a Windows Server or the Microtik?
    FYI, using NetBIOS connection method, such as \\server1, will use the current logged on account for authentication. If the VPN credentials are not AD credentials, but the VPN client is setting the logged on credentials account
    (some of them do that), then it will cause issues.
    From what I see that NetBIOS is not being blocked, so that doesn't appear to be an issue, but it's coming down to credentials. Maybe in the mapped drive you can preset the credentials, and might be one way around it.
    Ace Fekay
    MVP, MCT, MCITP/EA, MCTS Windows 2008/R2 & Exchange 2007, Exchange 2010 EA, MCSE & MCSA 2003/2000, MCSA Messaging 2003
    Microsoft Certified Trainer
    Microsoft MVP - Directory Services
    Technical Blogs & Videos: http://www.delawarecountycomputerconsulting.com/
    This post is provided AS-IS with no warranties or guarantees and confers no rights.

  • I suppose it is the problem with socket connection,Please help

    Hi,
    I'm trying to build a chat server in Java on Linux OS.I've created basically 2 classes in the client program.The first one shows the login window.When we enter the Login ID & password & click on the ok button,the data is sent to the server for verification.If the login is true,the second class is invoked,which displays the messenger window.This class again access the server
    for collecting the IDs of the online persons.But this statement which reads from the server causes an exception in the program.If we invoke the second class independently(ie not from 1st class) then there is no problem & the required data is read from the server.Can anyone please help me in getting this program right.I'm working on a p4 machine with JDK1.4.
    The Exceptions caused are given below
    java.net.SocketException: Connection reset by peer: Connection reset by peer
    at java.net.SocketInputStream.SocketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:119)
         at java.io.InputStreamReader$CharsetFiller.readBytes(InputStreanReader.java :339)
         at java.io.InputStreamReader$CharsetFiller.fill(InputStreamReader.java:374)
         at java.io.InputStreamReader.read(InputStreamReader.java:511)
         at java.io.BufferedReader.fill(BufferedReader.java:139)
         at java.io.BufferedReader.readLine(BufferedReader.java:299)
         at java.io.BufferedReader.readLine(BufferedReader.java:362)
         at Login.LoginData(Login.java:330)
         at Login.test(Login.java:155)
         at Login$Buttonhandler.actionPerformed(Login.java:138)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1722)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:17775)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:4141)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:253)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:261)
         at java.awt.Component.processMouseEvent(Component.java:4906)
         at java.awt.Component.processEvent(component.java:4732)
         at java.awt.Container.processEvent(Container.java:1337)
         at java.awt.component.dispatchEventImpl(Component.java:3476)
         at java.awt.Container.dispatchEventImpl(Container.java:1399)
         at java.awt.Component.dispatchEvent(Component.java:3343)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3302)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3014)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2967)
         at java.awt.Container.dispatchEventImpl(Container.java:1373)
         at java.awt.window.dispatchEventImpl(Window.java:1459)
         at java.awt.Component.dispatchEvent(Component.java:3343)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:439)
         at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:150)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:131)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
         My program looks somewhat like this :
    1st class definition:
    public class Login extends Jframe// Login is the name of the first class;
    Socket connection;
    DataOutputStream outStream;
    BufferedReader inStream;
    Frame is set up here
    public class Buttonhandler implements ActionListener
    public void actionPerformed(ActionEvent e) {
    String comm = e.getActionCommand();
    if(comm.equals("ok")) {
    check=LoginCheck(ID,paswd);
    test();
    public void test() //checks whether the login is true
    if(check)
    new Messenger(ID);// the second class is invoked
    public boolean LoginCheck(String user,String passwd)
    //Enter the Server's IP & port below
    String destination="localhost";
    int port=1234;
    try
    connection=new Socket(destination,port);
    }catch (UnknownHostException ex){
    error("Unknown host");
    catch (IOException ex){
    ex.printStackTrace ();
    error("IO error creating socket ");
    try{
    inStream = new BufferedReader(new InputStreamReader(connection.getInputStream()));
    outStream=new DataOutputStream(connection.getOutputStream());
    }catch (IOException ex){
    error("IO error getting streams");
    ex.printStackTrace();
    System.out.println("connected to "+destination+" at port "+port+".");
    BufferedReader keyboardInput=new BufferedReader(new InputStreamReader(System.in));
    String receive=new String();
    try{
    receive=inStream.readLine();
    }catch(IOException ex){ error("Error reading from server");}
    if(receive.equals("Logintrue"))
    check=true;
    else
    check=false;
    try{
    inStream.close();
    outStream.close();
    connection.close();
    }catch (IOException ex){
    error("IO error closing socket");
    return(check);
    // second class is defined below
    public class Messenger
    Socket connect;
    DataOutputStream outStr;
    BufferedReader inStr;
    public static void main(String args[])
    { Messenger mes = new Messenger(args[0]);}
    Messenger(String strg)
    CreateWindow();
    setupEvents();
    LoginData(strg);
    fram.show();
    void setupEvents()
    fram.addWindowListener(new WindowHandler());
    login.addActionListener(new MenuItemHandler());
    quit.addActionListener(new MenuItemHandler());
    button.addActionListener(new Buttonhandle());
    public void LoginData(String name)
    //Enter the Server's IP & port below
    String dest="localhost";
    int port=1234;
    int r=0;
    String str[]=new String[40];
    try
    connect=new Socket(dest,port);
    }catch (UnknownHostException ex){
    error("Unknown host");
    catch (IOException ex){
    ex.printStackTrace ();
    error("IO error creating socket ");
    try{
    inStr = new BufferedReader(new InputStreamReader(connect.getInputStream()));
    outStr=new DataOutputStream(connect.getOutputStream());
    }catch (IOException ex){
    error("IO error getting streams");
    ex.printStackTrace();
    String codeln=new String("\n");
    try{
    outStr.flush();
    outStr.writeBytes("!@*&!@#$%^");//code for sending logged in users
    outStr.writeBytes(codeln);
    outStr.write(13);
    outStr.flush();
    String check="qkpltx";
    String receive=new String();
    try{
    while((receive=inStr.readLine())!=null) //the statement that causes the exception
    if(receive.equals(check))
    break;
    else
         str[r]=receive;
         r++;
    }catch(IOException ex){ex.printStackTrace();error("Error reading from socket");}
    catch(NullPointerException ex){ex.printStackTrace();}
    } catch (IOException ex){ex.printStackTrace();
    error("Error reading from keyboard or socket ");
    try{
    inStr.close();
    outStr.close();
    connect.close();
    }catch (IOException ex){
    error("IO error closing socket");
    for(int l=0,k=1;l<r;l=l+2,k++)
    if(!(str[l].equals(name)))
    stud[k]=" "+str[l];
    else
    k--;
    public class Buttonhandle implements ActionListener
    public void actionPerformed(ActionEvent e) {
    //chat with the selected user;
    public class MenuItemHandler implements ActionListener
    public void actionPerformed(ActionEvent e)
    String cmd=e.getActionCommand();
    if(cmd.equals("Disconnect"))
    //Disconnect from the server
    else if(cmd.equals("Change User"))
         //Disconnect from the server & call the login window
    else if(cmd.equals("View Connection Details"))
    //show connection details;
    public class WindowHandler extends WindowAdapter
    public void windowClosing(WindowEvent e){
    //Disconnect from server & then exit;
    System.exit(0);}
    I�ll be very thankful if anyone corrects the mistake for me.Please help.

    You're connecting to the server twice. After you've successfully logged in, pass the Socket to the Messenger class.
    public class Messenger {
        Socket connect;
        public static void main(String args[]) {
            Messenger mes = new Messenger(args[0]);
        Messenger(Socket s, String strg) {
            this.connect = s;
            CreateWindow();
            setupEvents();
            LoginData(strg);
            fram.show();
    }

  • Problem with socket connection

    have my gps reciver connected to the usb port - i have a daemon gpsd running which makes data available on tcp port 2947 for querying. when i do telnet, it gives proper data.
    but when i open a socket connection using java, it does not print anything as output. actually telnet asks for an escape charatcer so i am sending "r" initially to the server but still the program does not print anything as output.
    here is my java code -
    import java.io.*;
    import java.net.Socket;
    public class test2
    public static void main(String[] args)
    try
    Socket s = new Socket("localhost",2947);
    PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
    s.getOutputStream())),true);
    out.println("r");
    BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream()));
    String line;
    while(true)
    line = in.readLine();
    System.out.println(line);
    catch (Exception e)
    or sometimes it even shows error as
    Exception in thread "main" java.net.SocketException: Invalid argument or cannot assign requested address
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    and this is the output which i get on telnet -
    ot@localhost ~]# telnet localhost 2947
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    r
    GPSD,R=1
    $GPRMC,000212,V,18000.0000,N,00000.0000,W,0.0000,180.000,101102,,*1A
    $GPGSA,A,1,,,,,,,,,,,,,,,,*32
    $PGRME,400.00,0.00,0.00*7B
    $GPRMC,000213,V,18000.0000,N,00000.0000,W,0.0000,180.000,101102,,*1B
    $GPGSA,A,1,,,,,,,,,,,,,,,,*32
    $PGRME,400.00,0.00,0.00*7B
    $GPRMC,000214,V,18000.0000,N,00000.0000,W,0.0000,180.000,101102,,*1C
    $GPGSA,A,1,,,,,,,,,,,,,,,,*32

    Actually the problem does not seem to be in the code because i tried some basic client server programs (without any gpsd etc in picture) and even they are not working in linux though they work perfectly in windows (on the same machine). In linux it shows exception
    My socket programs dont work in linux it shows error -
    ot@localhost winc]# java parser
    Exception in thread "main" java.net.SocketException: Invalid argument or cannot assign requested address
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at java.net.Socket.<init>(Socket.java:309)
    at java.net.Socket.<init>(Socket.java:124)
    at parser.main(parser.java:10)
    i have removed the firewall settings etc and it still doesnot work in linux
    what could be the cause for this?
    Sowmya

  • Problem with socket connection in midp 2.0

    hello everyone.
    I'm new one in j2me and I am learning socket connection in j2me. I'm using basic socket,datagram example wich is come with sun java wireless toolkit 2.5. for it i wrote small socket server program on c# and tested it example on my pc and its working fine. also socket server from another computer via internet working fine. But when i instal this socket example into my phone on nokia n78 (Also on nokia 5800) it's not working didn't connect to socket server.. On phone I'm using wi-fi internet. Can anybody help me with this problem? I hear it's need to modify manifest file and set appreciate pressions like this
    MIDlet-Permissions: javax.microedition.io.Connector.socket,javax.microedition.io.Connector.file.write,javax.microedition.io.Connector.ssl,javax.microedition.io.Connector.file.read,javax.microedition.io.Connector.http,javax.microedition.io.Connector.https
    is it true?
    can anybody suggest me how can i solve this problem?
    where can I read full information about socket connection specifiecs in j2me?
    Thanks.

    Maybe this can be helpful:
    [http://download-llnw.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/index.html]
    you can check there the Datagram interface anda DatagramConnection interface and learn a little about that.
    If the client example runs fine in the wireless toolkit emulator, it should run the same way in your phone; i suggest to try to catch some exception that maybe is hapenning and display it on a Alert screen, this in the phone.

  • Connect Flash to Serial Port with Local Socket Connection

    Hey all,
    So, I am trying to connect a Flash movie to a serial port
    and have it react to the input coming in. Of course, Flash does not
    have this capability built in, so I need a workaround. I also
    program in Director, and there are easier ways to deal with this
    there, but since there hasn't been an update in years, and for
    other technical reasons, I would like to use a pure Flash program.
    I also need to take advantage of some of the new hardware
    acceleration improvements and horizontal sync issues that come with
    running the Flash player full screen. So, there are some tools out
    there that will let me stream the input from the serial port to a
    web address. I figure I could use the local address and assign a
    port number, then use Flash to create a local socket connection. I
    am having issues opening ports on my computer, and a few other
    things, but in theory, I think it should work. I know that I won't
    get all the answers here, but if anyone has done anything of the
    sort, or might know of some similar projects, it would really help.
    I am more of a Director/Flash programmer, and not so much one on
    the system level. So, opening local sockets, etc, while I am sure I
    can figure it out, is still a bit beyond me. Thanks all!
    - Bruce

    You may want to look into flash remoting, which would allow
    you to push content to the flash movie. You could then write a
    proxy between the source of your stream and flash the remoting
    server.

  • TCP Socket connection in CLOSE_WAIT status and not getting closed

    I am facing an issue with the TCP socket connections not getting closed and they are in CLOSE_WAIT status for ever.
    As a part of batch process in our application, emails are sent with 4 embedded images. These images are downloaded from 3rd party site with IP say "UUU.XXX.YYY.ZZZ"
    The images are embedded to email as follows
    1. An URL object is created with the site url.
    URL urlPhoto = new
    URL("http://UUU.XXX.YYY.ZZZ/email/photos.jpg");
    2.     The image cid is created with the URL object and the image name
    HtmlEmail htmlEmail = new HtmlEmail();
    String cid1 = htmlEmail.embed(urlPhoto,
    "photo.jpg");
    3.     The image cid is added to the email template by replacing the ${cid1} and the email is sent.
    <td valign="top">
                   <img src="cid:${cid1}" width="279" height="274">
              </td>
    When a mail is sent, 4 new TCP connections are opened and are put in CLOSE_WAIT status for ever. For every mail sent 4 new connections are opened. In UNIX there is an upper limit on the number of open file handles (defaults to 1024) at any point of time. The open TCP connection has the underlying socket in CLOSE_WAIT status and is not getting closed at all. When the upper limit (1024) is reached the batch process is throwing the following exception and terminates.
    Caused by: com.inet.tds.ap: java.net.SocketExceptionjava.net.SocketException: Too many open files
    at com.inet.tds.am.a(Unknown Source)
    at com.inet.tds.TdsDriver.a(Unknown Source)
    at com.inet.tds.TdsDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at com.hcomemea.batchprocess.dataaccess.database.BaseJdbcDao.openConnection(BaseJdbcDao.java:106)
    ... 12 more
    When I run the command lsof in UNIX which list the open file handles in the system
    $ /usr/sbin/lsof -p 22933 -i | grep CLOSE_WAIT
    java 22933 build_master 297u IPv6 129841943 TCP integration.com:47929->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 298u IPv6 129841947 TCP integration.com:47933->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 299u IPv6 129841950 TCP integration.com:47936->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 300u IPv6 129841970 TCP integration.com:47952->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    ���list of 935 connections similarly�
    I tried 2 solutions
    1. Got the HttpURLConnection from the URL object and invoked disconnect method on the same. But it doesn�t work.
    2. Ran the batch process java program with the parameter �Dhttp.keepAlive=false to close the underlying connection but didn�t help.
    I need the underlying sockets to be closed and not put in CLOSE_WAIT status after sending the mail.
    Is it the problem with the embed method of HtmlEmail object not closing the underlying socket connection.
    If anyone has faced this issue before, kindly let me know the possible solutions for the same ASAP.
    Thank you,
    Ramesh G

    This sounds more like a problem due to connection pooling at middle tier/application server.
    If that has been ruled out, then you might to enable DCD or set expiry time on the server.

  • Change NetBIOS name in 10.6 Server

    I'm setting up  a new server to replace my PowerMac G5 Leopard server, just got a Mac Pro so I put 10.6 server on there for file sharing services. I cannot figure how to change the NetBIOS name however. When i go into System Prefs and try to change it that way, it points me to Server Admin, but I can't figure out where to change it. It's currently at new-host.local, and I would like to change it to Lambda.local. How do I go about doing this? Thanks

    Hi,  
    We can use the active directory rename tools to rename domain NetBIOS name. But it is a complex and risky process.
    For more information about how to use random.exe to rename domain name, please refer to the following article:
    Rendom
    http://technet.microsoft.com/en-us/library/cc732097.aspx
    Besides, renaming of the NetBIOS domain name is not supported in any version of Exchange Server.
    For more information about this, the following threads can be referred to.
    NetBios Name Change
    https://social.technet.microsoft.com/Forums/en-US/2cd9d561-e737-43ee-b791-0501105b85e9/netbios-name-change?forum=winserverDS
    Can we change our domain netbios name?
    https://social.technet.microsoft.com/forums/windowsserver/en-US/989a8a16-7c8b-4787-8092-605de6b9d617/can-we-change-our-domain-netbios-name-
    Best Regards,
    Erin

  • Establishing a socket connection between a .swf file and a socket-test program (TCP/IP builder - Windows), in AS3.

    I have an issue with a college project I'm working on.
    Using Actionscript 3, I made a simple .swf program, an animated, interactive smiley, that 'reacts' to number inputs in a input-box.
    For the sake of the project, I now need to make the framework for establishing a socket connection with the smiley .swf, and another program.
    This is where I encounter issues. I have very little knowledge of AS3 programming, so I'm not certain how to establish the connection - what's required code-wise for it, that is.
    To test the connection, I'm attempting to use the "TCP/IP builder" program from windows, which lets me set up a server socket. I need to program the .swf file into a client - to recognize it, connect to it, then be able to receive data (so that the data can then be used to have the smiley 'react' to it - like how it does now with the input-box, only 'automatically' as it gets the data rather than by manual input).
    My attempts at coding it are as follows, using a tutorial (linked HERE):
    //SOCKET STUFF GOES HERE
        var socket:XMLSocket;        
        stage.addEventListener(MouseEvent.CLICK, doConnect); 
    // This one connects to local, port 9001, and applies event listeners
        function doConnect(evt:MouseEvent):void 
        stage.removeEventListener(MouseEvent.CLICK, doConnect); 
        socket = new XMLSocket("127.0.0.1", 9001);   
        socket.addEventListener(Event.CONNECT, onConnect); 
        socket.addEventListener(IOErrorEvent.IO_ERROR, onError); 
    // This traces the connection (lets us see it happened, or failed)
        function onConnect(evt:Event):void 
            trace("Connected"); 
            socket.removeEventListener(Event.CONNECT, onConnect); 
            socket.removeEventListener(IOErrorEvent.IO_ERROR, onError); 
            socket.addEventListener(DataEvent.DATA, onDataReceived); 
            socket.addEventListener(Event.CLOSE, onSocketClose);             
            stage.addEventListener(KeyboardEvent.KEY_UP, keyUp); 
        function onError(evt:IOErrorEvent):void 
            trace("Connect failed"); 
            socket.removeEventListener(Event.CONNECT, onConnect); 
            socket.removeEventListener(IOErrorEvent.IO_ERROR, onError); 
            stage.addEventListener(MouseEvent.CLICK, doConnect); 
    // Here, the flash tracks what keyboard button is pressed.
    // If 'q' is pressed, the connection ends.
            function keyUp(evt:KeyboardEvent):void 
            if (evt.keyCode == 81) // the key code for q is 81 
                socket.send("exit"); 
            else 
                socket.send(evt.keyCode); 
    // This one should handle the data we get from the server.
            function onDataReceived(evt:DataEvent):void 
            try { 
                trace("From Server:",  evt.data ); 
            catch (e:Error) { 
                trace('error'); 
        function onSocketClose(evt:Event):void 
            trace("Connection Closed"); 
            stage.removeEventListener(KeyboardEvent.KEY_UP, keyUp); 
            socket.removeEventListener(Event.CLOSE, onSocketClose); 
            socket.removeEventListener(DataEvent.DATA, onDataReceived);
    Trying to connect to the socket gives me either no result (other than a 'connection failed' message when I click the .swf), or the following error:
    Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: file:///C|/Users/Marko/Desktop/Završni/Flash%20documents/Smiley%5FTCP%5FIP%5Fv4.swf cannot load data from 127.0.0.1:9001.
        at Smiley_TCP_IP_v4_fla::MainTimeline/doConnect()[Smiley_TCP_IP_v4_fla.MainTimeline::frame1:12] 

    Tried adding that particular integer code, ended up with either errors ("use of unspecified variable" and "implicit coercion") , or no effect whatsoever (despite tracing it).
    Noticed as well that the earlier socket code had the following for byte reading:
    "sock.bytesAvailable > 0" (reads any positive number)
    ...rather than your new:
    "sock.bytesAvailable != 0" (reads any negative/positive number)
    Any difference as far as stability/avoiding bugs goes?
    So then, I tried something different: Have the program turn the "msg" string variable, into a "sentnumber" number variable. This seemed to work nicely, tracing a NaN for text (expected), or tracing the number of an actual number.
    I also did a few alterations to the input box - it now no longer needs the 'enter' key to do the calculation, it updates the animation after any key release.
    With all this considered and the requirements of the project, I now have a few goals I want to achieve for the client, in the following order of priority:
    1) Have the "sentnumber" number variable be recognized by the inputbox layer, so that it puts it into the input box. So in effect, it goes: Connect -> Send data that is number (NaN's ignored) -> number put into input box -> key press on client makes animation react. I optionally might need a way to limit the number of digits that the animation reacts to (right now it uses 1-3 digit numbers, so if I get sent a huge number, it might cause issues).
    - If the NaN can't be ignored (breaks the math/calculus code or some other crash), I need some way of 'restricting' the data it reads to not include NaN's that might be sent.
    - Or for simplicity, should I just detect the traced "NaN" output, reacting by setting the number variable to be "0" in such cases?
    2) After achieving 1), I'll need to have the process be automatic - not requiring a keyboard presses from the client, but happening instantly once the data is sent during a working connection.
    - Can this be done by copying the huge amounts of math/calculus code from the inputbox layer, into the socket layer, right under where I create the "sentnumber" variable, and modifying it delicately?
    3) The connection still has some usability and user issues - since the connection happens only once, on frame 1, it only connects if I already have a listening server when I run the client, and client can't re-connect if the server socket doesn't restart itself.
    I believe to do this, I need to make the connection happen on demand, rather than once at the start.
    For the project's requirement, I also need to allow client users to define the IP / port it's going to connect to (since the only alternative so far is editing the client in flash pro).
    In other words, I need to make a "Connect" button and two textboxes (for IP and port, respectively), which do the following:
    - On pressing "Connect", the button sets whatever is in the text boxes as the address of the IP and port the socket will connect to, then connects to that address without issues (or with a error message if it can't due to wrong IP/port).
    - The connection needs to work for non-local addresses. Not sure if it can yet.
    - On re-pressing connect, the previous socket is closed, then creates a new socket (with new IP/port, if that was altered)
    It seems like making the button should be as simple as putting the existing socket code under the function of a button, but it also seems like it's going to cause issues similar to the 'looping frames' error.
    4) Optional addition: Have a scrolling textbox like the AIR server has, to track what the connection is doing on-the-fly.
    The end result would be a client that allows user to input IP/Port, connects on button press (optionally tracking/display what the socket is doing via scrollbox), automatically alters the smiley based on what numbers are sent whilst the connection lasts, and on subsequent button presses, makes a new connection after closing off the previous one.
    Dropbox link to new client version:
    https://www.dropbox.com/s/ybaa8zi4i6d7u6a/Smiley_TCP_IP_v7.fla?dl=0
    So, starting from 1), can I, and how can I, get the number variable recognized by "inputbox" layer's code? It keeps giving me 'unrecognized variable' errors.

  • Socket connections / smtp

    I have a form that sends mail (smtp) through a socket
    connection (actionscript), which I picked up here,
    http://www.bytearray.org/?p=27
    Tested and works fine locally, but when posted online and
    tested, it quietly fails.
    I am trying to send mail from my domain, to the mail function
    within my host server. (same domain).
    Tried both "local" and "network" publishing options.
    I have read the article on socket security at
    http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_04.html
    but I do not have the option to place a crossdomain.xml file
    at port 843 since I am on a shared server.
    I've read everything that I can online but because policy
    changes from player 9,0,115,0 on, it seems that older posts may not
    be relevant, so is there another way to approach this matter?
    Is it possible for me to hard code the cross domain policy
    into my scripts or .fla?
    Thanks,
    Key.

    I seem to be having the same problems, I can't make a
    connection using the newest player and I have my crossdomain file
    on the root of the server, does anyone have any clue how to solve
    this.

  • MDEX intermittantly not returning response, getting com.endeca.navigation.ENEConnectionException: Error reading from socket connection buffer.Connection reset

    Intermittant issue where certain portlets have the spinning wheel and error getting thrown in the log, and resulting in stuck threads, has anyone seen this?
    Caused by: com.endeca.navigation.ENEConnectionException: Error reading from socket connection buffer.Connection reset
            at com.endeca.navigation.OptiInputBuffer.read(Unknown Source)
            at com.endeca.navigation.OptiInputBuffer.readFully(Unknown Source)
            at com.endeca.navigation.OptiInputBuffer.readUInt(Unknown Source)
            at com.endeca.navigation.OptiInputBuffer.readLine(Unknown Source)
            at com.endeca.navigation.OptiBinaryInterp.FormatCat(Unknown Source)
            at com.endeca.navigation.OptiBinaryInterp.FormatCatsWithAncs(Unknown Source)
            at com.endeca.navigation.OptiBinaryInterp.FormatCatGroup(Unknown Source)
            at com.endeca.navigation.OptiBinaryInterp.FormatBin(Unknown Source)
            at com.endeca.navigation.OptiBinaryInterp.FormatBinList(Unknown Source)
            at com.endeca.navigation.OptiBinaryInterp.ParseBinaryNode(Unknown Source)
            at com.endeca.navigation.OptiBackend.getNavigation(Unknown Source)
            at com.endeca.navigation.HttpENEConnection.query(Unknown Source)
            at com.endeca.portal.mdex.MDEXUtil.execute(MDEXUtil.java:433)
            at com.endeca.portal.data.DataSource.execute(DataSource.java:546)

    Message appears in logs internmittantly during page rendering which has Breadcrumbs, Results Table, Guided Navigation portlets.  There are Agraphs in front of several Dgraphs.

  • Generate query  at a time &  connect  two database ?

    Hi
    Could u help me? it is necessary  that  
    I have  two database ( RSHPL,RSPL)  and both data base have  same table name and same fieldname (Table Name :-OITM, Fieldname :ONHAND ,pk- ITEMcode,) 
    At first I tell u what I want?
    I want to generate query  at a time &  connect  two database and same table name(OITM)  to select the TOTAL VALUE of this  field(ONHAND) and pk-key is Itemcode.  
    Is it Possible? If  Possible  plz  write this query and send me.

    Hi,
    I don't think its possible to write a query from within SAP that allows you to get data from another SAP database. 
    I have used SQL Reporting Services to report on data from multiple databases, and this works very well for many of my clients.  It depends on what you want to do with the data, do you need to display it on the screen in SAP and it to a field or will a report suffice?
    Regards,
    Adrian

Maybe you are looking for

  • Deskjet 3050 wireless problem

    Hi, Hope someone can help ASAP please!!!!!! Have a Deskjet 3050 wireless printer, which i have tried all ways of installing, but cant get it to print wireless. I have a Compaq laptop with wireless, Belgin Wireless router, I can see the network on the

  • Buffer Busy Waits on Primary Keys - RKI

    11.2.03 - HPUX Hi All. We're seeing significant Buffer Busy Waits (around 15% of non idle waits during bad times) and most of the contention is on the following; SYS.SEQ$, and two primary keys.. The primary key one seems easier to fix in the first in

  • Mac Mini 2009 - Can't daisy chain two FW800 drives

    I have two FW800 enclosures with 3.5-inch drives and external power. Each one mounts individually when connected to the Mini FW800 port but when I daisy-chain them the second one in the chain doesn't mount and is not seen by disk utility. Those enclo

  • WL 8.1

    While I am aware that WL 8.1 a.k.a Olympic in in limited beta, it would be           great if Bea gave us a heads up on what to expect in terms of new features.           I am particularly interested in JMS enhancements.           Regards,           

  • Adobe Creative Suite CS3 - Adobe Indesign CS3 Debug: Installation on the same PC?

    Hi Is it possible to install Adobe Creative Suite CS3 and Adobe Indesign CS3 Debug on the same PC? If yes how can I do that? I have tried it but if I install the debug version there is a message that I can't install it because there is a conflict. Th