Binding to port 162?

I'm trying to write code that will bind to port 162. I'm able to do this
if I'm root, however if I'm another user this fails. The user account
I'm trying this under has the same group memberships as root. Could you
please let me know what I need to do to be able to do this?
Thanks in advance,
Dave Zeltserman
[email protected]

Try this sample code as root:
/* compile using cc test.c -lnsl */
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <netdb.h>
#include <stropts.h>
#include <tiuser.h>
#include <netinet/in.h>
#include <signal.h>
#define BUFSIZE 256
#define PORT 162
extern int t_errno; /* TLI globle errno */
main()
int fd, flags; /* Transport endpoint */
char buffer[BUFSIZE]; /* Data buffer */
struct t_call call;              / TLI call request */
struct t_bind bind;              / TLI bind request */
struct sockaddr_in server;
if ((fd = t_open("/dev/tcp", O_RDWR, (struct t_info *)NULL)) < 0)
t_error("t_open failed for fd");
exit(1);
/* Set up bind structures */
if ((bind = (struct t_bind *)t_alloc(fd, T_BIND, T_ALL)) == NULL)
t_error("t_alloc of t_bind struct failed");
exit(1);
memset((char *)&server, 0, sizeof(server));
server.sin_family = AF_INET;
server.sin_port = htons(PORT);
server.sin_addr.s_addr = htonl(INADDR_ANY);
bind->addr.maxlen = sizeof(server);
bind->addr.len = sizeof(server);
bind->addr.buf = (char *)&server;
bind->qlen = 5;
if (t_bind(fd, bind, bind) < 0)
t_error("t_bind failed for fd");
exit(1);
* Was the correct address bound ?
if (((struct sockaddr_in *)(bind->addr.buf))->sin_port != PORT)
printf("t_bind bound wrong address\n");
printf("Got %d instead of %d.\n", ((struct sockaddr_in *)(bind->addr.buf))->sin_port, PORT);
exit(1);
printf("Got Port %d \n", ((struct sockaddr_in *)(bind->addr.buf))->sin_port);
if ((call = (struct t_call *)t_alloc(fd, T_CALL, T_ALL)) == NULL)
t_error("t_alloc of t_call structure failed");
exit(1);
Output:
# ./a.out
Got Port 162
#

Similar Messages

  • ICal Server starts but does not bind to port 8008 or 8443

    I am having some trouble getting ICal server to start up and be available. When is start up I get the following log entry
    2008-01-31 20:04:28+0000 [-] Log opened.
    2008-01-31 20:04:28+0000 [-] twistd 2.5.0 (/System/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python 2.5.1) starting up
    2008-01-31 20:04:28+0000 [-] reactor class: <class 'twisted.internet.selectreactor.SelectReactor'>
    2008-01-31 20:04:28+0000 [-] 1 processors found, configuring 1 processes.
    2008-01-31 20:04:28+0000 [-] twistedcaldav.logging.AMPLoggingFactory starting on "'/var/run/caldavd.sock'"
    2008-01-31 20:04:35+0000 [-] [caldav-8008]  [-] Log opened.
    2008-01-31 20:04:35+0000 [-] [caldav-8008]  [-] twistd 2.5.0 (/System/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python 2.5.1) starting up
    2008-01-31 20:04:35+0000 [-] [caldav-8008]  [-] reactor class: <class 'twisted.internet.selectreactor.SelectReactor'>+
    2008-01-31 20:04:36+0000 [-] [caldav-8008]  [-] Configuring directory service of type: twistedcaldav.directory.appleopendirectory.OpenDirectoryService
    2008-01-31 20:04:36+0000 [-] [caldav-8008]  [-] "Directory service <OpenDirectoryService '/Search': '/Search'> has no GUID; generating service GUID from realm name."
    2008-01-31 20:04:37+0000 [-] [caldav-8008]  [-] Configuring SudoDirectoryService with file: /etc/caldavd/sudoers.plist
    2008-01-31 20:04:37+0000 [-] [caldav-8008]  [-] Setting up document root at: /Library/CalendarServer/Documents
    2008-01-31 20:04:37+0000 [-] [caldav-8008]  [-] Setting up principal collection: <class 'twistedcaldav.directory.principal.DirectoryPrincipalProvisioningResource'>
    2008-01-31 20:04:37+0000 [-] [caldav-8008]  [-] Setting up calendar collection: <class 'twistedcaldav.static.CalendarHomeProvisioningFile'>
    2008-01-31 20:04:37+0000 [-] [caldav-8008]  [-] Setting up root resource: <class 'twistedcaldav.root.RootResource'>
    2008-01-31 20:04:37+0000 [-] [caldav-8008]  [-] Setting up default ACEs on root resource
    2008-01-31 20:04:37+0000 [-] [caldav-8008]  [-] Setting up AdminPrincipals
    2008-01-31 20:04:37+0000 [-] [caldav-8008]  [-] Setting root ACL
    2008-01-31 20:04:37+0000 [-] [caldav-8008]  [-] Configuring authentication for realm: /Search
    2008-01-31 20:04:37+0000 [-] [caldav-8008]  [-] Setting up scheme: kerberos
    2008-01-31 20:04:37+0000 [-] [caldav-8008]  [-] Setting up scheme: digest
    2008-01-31 20:04:37+0000 [-] [caldav-8008]  [-] Initializing database /var/run/caldavd/.db.digestcredentialscache
    2008-01-31 20:04:37+0000 [-] [caldav-8008]  [-] Configuring authentication wrapper
    2008-01-31 20:04:37+0000 [-] [caldav-8008]  [-] Setting up service
    2008-01-31 20:04:37+0000 [-] [caldav-8008]  [-] Configuring log observer: <twistedcaldav.logging.AMPCommonAccessLoggingObserver object at 0x1470ed0>
    2008-01-31 20:04:37+0000 [-] [caldav-8008]  [-] Adding server at :8008
    2008-01-31 20:04:37+0000 [-] [caldav-8008]  [-] Adding SSL server at :8443
    But when I try to connect on either http (port 8008) or https (port 8443) I get:
    +Calendar Home not found for 'http://mydomain.com:8008/principals/_uids_/38535666-DA2F-4803-B26E-AD3C4CECC908/'+
    Looking at netstat on the server it seems that the caldav server is not actually binding the port.
    Any ideas how to fix?

    The log files (and the containing caldavd folder) don't exist.
    Errors in system.log do:
    Mar 4 10:15:27 internal /usr/sbin/ocspd[39025]: starting
    Mar 4 10:15:32 internal com.apple.launchd[1] (org.calendarserver.calendarserver[39026]): open("/var/log/caldavd/error.log", ...): No such file or directory
    Mar 4 10:15:35: --- last message repeated 1 time ---
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: Removing stale pidfile /var/run/caldavd.pid
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] Log opened.
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] twistd 2.5.0 (/System/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/ Contents/MacOS/Python 2.5.1) starting up
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] reactor class: <class 'twisted.internet.selectreactor.SelectReactor'>
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] 2 processors found, configuring 2 processes.
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] Adding pydirector service with configuration: /tmp/pydirmegbeS
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] twistedcaldav.logging.AMPLoggingFactory starting on "'/var/run/caldavd.sock'"
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] Traceback (most recent call last):
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] File "/usr/share/caldavd/bin/twistd", line 21, in <module>
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] run()
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] File "/usr/share/caldavd/lib/python/twisted/scripts/twistd.py", line 27, in run
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] app.run(runApp, ServerOptions)
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] File "/usr/share/caldavd/lib/python/twisted/application/app.py", line 379, in run
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] runApp(config)
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] File "/usr/share/caldavd/lib/python/twisted/scripts/twistd.py", line 23, in runApp
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] _SomeApplicationRunner(config).run()
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] File "/usr/share/caldavd/lib/python/twisted/application/app.py", line 158, in run
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] self.postApplication()
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] File "/usr/share/caldavd/lib/python/twisted/scripts/twistdunix.py", line 213, in postApplication
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] startApplication(self.config, self.application)
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] File "/usr/share/caldavd/lib/python/twisted/scripts/twistdunix.py", line 174, in startApplication
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] service.IService(application).privilegedStartService()
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] File "/usr/share/caldavd/lib/python/twisted/application/service.py", line 228, in privilegedStartService
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] service.privilegedStartService()
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] File "/usr/share/caldavd/lib/python/twisted/application/service.py", line 228, in privilegedStartService
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] service.privilegedStartService()
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] File "/usr/share/caldavd/lib/python/twisted/application/internet.py", line 68, in privilegedStartService
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] self._port = self._getPort()
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] File "/usr/share/caldavd/lib/python/twisted/application/internet.py", line 86, in _getPort
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] return getattr(reactor, 'listen'+self.method)(*self.args, **self.kwargs)
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] File "/usr/share/caldavd/lib/python/twisted/internet/posixbase.py", line 432, in listenUNIX
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] p.startListening()
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] File "/usr/share/caldavd/lib/python/twisted/internet/unix.py", line 84, in startListening
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] self.factory.doStart()
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] File "/usr/share/caldavd/lib/python/twistedcaldav/logging.py", line 364, in doStart
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] self.observer.start()
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] File "/usr/share/caldavd/lib/python/twistedcaldav/logging.py", line 207, in start
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] self._open()
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] File "/usr/share/caldavd/lib/python/twistedcaldav/logging.py", line 224, in _open
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] self.f = open(self.logpath, 'a', 1)
    Mar 4 10:15:35 internal org.calendarserver.calendarserver[39026]: 2008-03-04 10:15:35-0500 [-] IOError: [Errno 2] No such file or directory: '/var/log/caldavd/access.log'
    Mar 4 10:15:35 internal com.apple.launchd[1] (org.calendarserver.calendarserver[39026]): Exited with exit code: 1
    Mar 4 10:15:35 internal com.apple.launchd[1] (org.calendarserver.calendarserver): Throttling respawn: Will start in 7 seconds
    So, as I suspected, it isn't starting up correctly. Now, what to do about that? Do I just need to create taht caldavd folder and touch the log files?
    Greg

  • Re-routing of SNMP traps from port 162 to port greater than 1024

    Hello,
    I have to re-route SNMP traps received at port 162 to some other port greater that 1024 (say 2041). There is an application which sends SNMP traps to port 162 and our application running on Windows listens for SNMP traps on port 2041, so we want
    to route/forward the traps internally from port 162 to 2041.
    I have been looking at the rules defined in 'Windows Firewall with advanced security' but not able to succeed. I noticed that there is a predefined rule for SNMP traps but it does not give me an option to forward the trap to another port. I tried
    creating a new rule but that also does not give me an option to change the port.
    Please help.

    Hi,
    According to Technet Library:
    SNMP uses the default UDP port 161 for general SNMP messages and UDP port 162 for SNMP trap messages. If these ports are being used by another protocol or service, you can change the settings by modifying the local Services file on the agent. The Services
    file is located in \ % SystemRoot %\System32\Drivers\Etc
    There is no file name extension. You can use any text - based editor to modify the file. The management system must also be configured to listen and send on the new ports.
    Caution:
    If you have previously configured IP security to encrypt SNMP messages on the default ports, you must also update the IP security policy with the new port settings. Otherwise, communication can be erroneously blocked or SNMP communications might not be secured.
    You can access to the link below for this article:
    http://technet.microsoft.com/en-us/library/cc959643.aspx
    Roger Lu
    TechNet Community Support

  • Operations Manager 2012 doesn't listening SNMP Trap UDP port 162

    hi,
    SCOM 2012 SP1, how come the operations manager started but the SNMP Trap UDP port 162 not listening?
    Without this port listening, I can't testing SNMP trap on SCOM.
    Thanks...KEN

    Hi,
    As described in the following blog, the TRAP service should be installed but turned off, we could not get traps coming in until we turned the service back on.
    So please verify if the service is on. You can continue audit the ports by running netstat –a.
    System Center 2012 Notes From the Field
    http://scom-2012.blogspot.in/2012/07/setting-up-snmp-monitoring-in-scom-2012.html
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    Hope this helps.

  • Direct Binding Partner Ports

    Hi,
    I have a below requirement.
    Parent orchestration has to poll a table and get the record. In the record there is a column 'MeasureID' with comma seperated values. 
    For each of these measure ID, I execute set of SQL queries (I can execute only one query at a time, CRM's WCF Service)
    So In loop, I am querying DB & passing this result set to another child orchestration to consolidate the records.
    After the loop in parent orchestration, updating the table that all the measureids are processed.
    Currently, I have a orchestration which reads the measure id one by one & executes the query and sending to child orchestration  using Direct Binding partner ports.
    I am using Correlation: BTS.Partnerport. This is my child orchestration.
    It has to create only once instance even if I 've 3measure ids. For 3measureids, I am getting 3files. How can I set the correlation. It has to generate only one file.
    Thanks,
    Lakshmi

    Hi,
    You can create a correlation type and correlation on 'measure
    id' in Parent Orchestration and then initialize the same while persisting the message to MsgBox(at
    send shape). Then you use the same correlation type in the Child Orchestration and initialize a correlation in Child Orchestration.
    So the correlating property will be promoted by Parent Orchestration and the same will be used for subscription
    by Child Orchestration.
    Rachit

  • Unalbe to bind to ports

    HI,
    I wrote an application to bind to port 80 on a solaris10 machine. The bind() function call seems to fail. I verified that there is no process or service that is already using port 80.
    I can bind to higher port numbers like 9000 or 10000 but I get a bind error when I bind to a 'lower' port like 80 or 90. Can anyone help me get around the problem.
    Thanks

    Unless you use rbac privileges only root can attach to ports < 1024.
    alan

  • ApacheJServ/1.1: Failed to bind to port(s)

    Hi,
    I'm running Oracle-HTTP-Server/1.3.28 on Red Hat Linux and JDK 1.4.2
    For many months, everything was running fine.
    Now I get the following error message (many times) in file "jserv.log":
    [Note: reformatted for easier reading.]
    [02/08/2007 18:23:32] ApacheJServ/1.1:
    Failed to bind to port(s) specified in jserv.properties.
    Please check jserv.properties and jserv.conf file, and make sure number of JServ
    process specified in jserv.conf is less than number of ports specified
    in jserv.properties and the ports are not used by other processes.I'm hoping someone will be able to help me resolve this problem.
    =========================================================
    August 3, 2007 - More information:
    JServ is configured to listen to port 8007 only.
    When iAS is started up, the first time a servlet request is sent, the process becomes defunct and is unable to release the 8007 port.
    All subsequent attempts to access that port fail, as the port is still bound to a defunct process.
    If you kill the defunct process, the port is then in a CLOSE state, as seen by using "netstat".
    Thanks,
    Avi.
    Message was edited by:
    Avi Abrami

    Hi,
    Turned out to be a file permissions problem.
    The owner of another process -- not Oracle HTTP Server -- was trying to write log messages to a file it didn't have permission to write to.
    Once the owner was granted write permission to the log file, the problem disappeared.
    Thanks for all the help ;-)
    Good Luck,
    Avi.

  • Error: DHCP-3-BIND_SRPORT_ERR: dhcp_support.c:374 Binding service port failed.

    Hi,
    I am getting bellow error messages with new wlan i created. On the same WLC i have three other wlans working OK. This wlan suppose to get authenticated with acs, i tried to disable the authentication but got same error message. With acs authentication, i am able to authenticate OK but cannot get ip address from dhcp server. DHCP server is on wlc, used by other three wlans ok. All wlans are on differnt subnets; vlans created where needed.Any ideas would be appreciated.
    Thanks
    Error from wlc:
    *Sep 10 13:23:53.303: %DHCP-3-BIND_SRPORT_ERR: dhcp_support.c:374 Binding service port failed.
    *Sep 10 13:15:33.111: %DHCP-3-BIND_SRPORT_ERR: dhcp_support.c:374 Binding service port failed.
    *Sep 10 13:07:12.920: %DHCP-3-BIND_SRPORT_ERR: dhcp_support.c:374 Binding service port failed.
    *Sep 10 12:58:52.732: %DHCP-3-BIND_SRPORT_ERR: dhcp_support.c:374 Binding service port failed.
    *Sep 10 12:50:32.535: %DHCP-3-BIND_SRPORT_ERR: dhcp_support.c:374 Binding service port failed.

    %DHCP-3-BIND_SRPORT_ERR: dhcp_support.c:374 Binding service port failed.
    This one perplexed me too, there is no answer on Cisco's website that I could find. I think I have the  solution though....
    Go to Monitor -> Interfaces -> Service-Port and have a look at the configuration.
    I'm willing to bet that DHCP is enabled for the service port (the Ethernet interface on the left side of  the controller that you may or may not use) and the Ethernet is either not connected or it's connected to  a LAN where it can't get a DHCP lease.
    What the controller is try trying to say is something like "%DHCP-3-BIND_SRPORT_ERR: dhcp_support.c:374 Failed to get a DHCP address for the service port"

  • Problems starting WLS on XP - Unable to bind to port

    Hi
    I recently changed my development environment from W2000 to XP.
    Apparently everything works as before.
    However, when I start WLS again shortly after stopping it (either by console or
    CTRL^C) I get the following error
    <01-10-2003 14:48:40 CEST> <Emergency> <WebLogicServer> <BEA-000351> <Unable to
    create a server socket on Channel Default for port: 28041. j
    ava.net.BindException: Address in use Perhaps another process is using port 28041.>
    <01-10-2003 14:48:40 CEST> <Emergency> <Security> <BEA-090085> <Server failed
    to bind to the configured port. The port may already be used b
    y another process.>
    <01-10-2003 14:48:40 CEST> <Emergency> <WebLogicServer> <BEA-000342> <Unable to
    initialize the server: Server failed to bind to the requeste
    d port. See preceeding log message for details.>
    This situation times out after an unpredictable delay (5-20 min) - and I can restart
    my WLS.
    Does anybody know how to resolve this problem.
    Regards
    Peter

    Hi Werner,
    SYSLOG is UDP port 514.  Normally this means that some other program is running and using port 514.
    Some of the TFTP servers are also SYSLOG servers and will "listen" on this port.
    You can see if port 514 is listening with Fabric Manager not running.
    To find out what is using port 514:
    (a)     Open a command prompt window.  From Start / Run enter: cmd
    (b)     From the command prompt enter: netstat -ano
    (c)      Note the PID (process identifier) associated with the ports you are  concerned about.  (Also note the Local Address, Foreign Address,  Protocol and State.)
    (d)     Then do ctrl-alt-del to bring up the Windows Task Manager.
    (e)     In Windows Task Manager, select the Processes tab.
    (f)      Look for the PID you noted when you did the netstat in step (c).  Look  to left to the image name and that tells you which process has that PID.
    - If you dont see a PID column, click on View / Select Columns.  Make sure PID is selected.  Click OK.
    - Make sure Show processes from all users is selected.
    Now you can see what process is using port 514.  FM would be listed as javaw.exe ( java exec without a console window ).
    Best regards,
    Jim

  • Binding static port for rpc service

    I want to start a RPC server in a specific TCP port.
    The default behaviour is that the server chooses some arbitrary port and registers itself with the port-mapper (rpcbind). This is not good for me as I need to work throught a firewall. The first access to the port mapper (port 111) is fine. I don't need to make the client go directly to the my server.
    But how to start the server in a specific port?
    I read in some news group about openning the socket myself, and then using svctvp_create + svc_reg or the same with TLI, but till now I was not able to put this to work.
    Any help will be appreciated.
    Regards,
    Oren.

    Do a man on bind(). This API allows you to bind to a specific port.

  • Error binding ORMI port

    Hi,
    We have installed Oracle 9ias Release 2 Infrastructure and AppServer on RedHat Linux AS 2.1 on the same machine.
    When we deploy our application onto the AppServer, it deploys fine, but gives the following error before starting the instance.
    Error starting ORMI-Server. Unable to bind socket: Address already in use
    java.lang.NullPointerException
    at com.evermind.server.rmi.RMIServer.run(RMIServer.java:350)
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:66)
    Oracle9iAS (9.0.2.0.0) Containers for J2EE initialized
    The application is available on 7779 instead of 7778.
    Is there a clash with the ports? We tried shutting down and restarting the machine and the instance, but still gives the same error.
    Can anything be wrong here with ports?
    Thanks
    Srinath

    Try changing the RMI port in the rmi.xml
    regards
    Debu

  • Ho to decrypt snmp log using Snmp4j

    Hi all
    I have problem with decoding snmp log using my own listener.
    From the sample inside the snmp4j source code, what i can see here is we have to use their listener.
    Because of this, the snmp4j listener cannot bind the port 162 because my program has bound it.
    What is another way for me to get the the real snmp log(not encrypted).
    Below are the code of my snmparser that has problem to bind the port
    public class SnmpParser extends Parser implements CommandResponder {
    private String[] data = (String[]) COLUMN_DEFAULT_VALUE.clone();
    private String strLog = "";
    private String strIP = "";
    private MultiThreadedMessageDispatcher dispatcher;
    private Snmp snmp = null;
    private Address listenAddress;
    private ThreadPool threadPool;
    private int n = 0;
    private long start = -1;
    private ByteBuffer bis = null;
    private TransportMapping transport = null;
    public SnmpParser(String strIP, String strRawlog) {
    this.strIP = strIP;
    strLog = strRawlog;
    private void init() throws UnknownHostException, IOException {
    threadPool = ThreadPool.create("Trap", 2);
    dispatcher =
    new MultiThreadedMessageDispatcher(threadPool,
    new MessageDispatcherImpl());
    listenAddress =
    GenericAddress.parse(System.getProperty("snmp4j.listenAddress",
    "udp:192.168.2.55/162")); //This 162 port caused proggram terminated because cannot bind
    if (listenAddress instanceof UdpAddress) {
    transport = new DefaultUdpTransportMapping((UdpAddress)listenAddress);
    else {
    transport = new DefaultTcpTransportMapping((TcpAddress)listenAddress);
    snmp = new Snmp(dispatcher,transport);
    snmp.getMessageDispatcher().addMessageProcessingModel(new MPv1());
    snmp.getMessageDispatcher().addMessageProcessingModel(new MPv2c());
    snmp.getMessageDispatcher().addMessageProcessingModel(new MPv3());
    USM usm = new USM(SecurityProtocols.getInstance(),
    new OctetString(MPv3.createLocalEngineID()), 0);
    SecurityModels.getInstance().addSecurityModel(usm);
    // snmp.listen();
    public void doConvert() {
    System.out.println("Rawlog : " strLog);
    +//System.out.println("Rawlog(hex) : "+ new OctetString(strLog).toHexString());
    try {
    init();
    snmp.addCommandResponder(this);
    } catch (UnknownHostException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    //fire ProcessMessage
    bis = ByteBuffer.wrap(strLog.getBytes());
    try {
    if(transport!=null) {
    ((DefaultUdpTransportMapping)transport).fireProcessMessage(new UdpAddress(InetAddress.getByName("192.168.2.55"),
    162), bis);
    System.out.println("Firing");
    } else {
    System.out.println("Not firing");
    } catch (UnknownHostException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    public void processPdu(CommandResponderEvent event) {
    System.out.println(event.getPDU());
    System.out.println(event.getPDU().getVariableBindings());
    System.out.println(event.getPDU().getType());
    Below is just my listener code
    public final class UDPListener extends Listener {
    private int iUDPPort = 0;
    private boolean bStop = false;
    private byte[] buffer = null;
    private DatagramSocket dSocket = null;
    private DatagramPacket dPacket = null;
    public UDPListener(int piUDPPort) {
    this.iUDPPort = piUDPPort;
    this.buffer = new byte[1024];
    private boolean exceptionCaught = false;
    public UDPListener(int piUPDPort, int piBufferSize) {
    this.iUDPPort = piUPDPort;
    this.buffer = new byte[piBufferSize];
    public void run() {
    // if UDP listener initialized successfully, proceed with listening
    // or else exit this thread
    if (initUDPListener()) {
    Indefinite loop while bStop remains false. bStop is only set in 2 places.
    1. when stopListener method is called
    *2. when an exception is encountered in the block*
    while (!bStop) {
    try {
    dSocket.receive(dPacket);
    extractLog();
    } catch (Exception e) {
    Signifying exception is caught. Ending loop
    Logger.getLogger(UDPListener.class).error("Error while listening to UDP port: " + iUDPPort, e);
    exceptionCaught = true;
    bStop = true;
    try {
    if (dSocket != null)
    dSocket.close();
    } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } finally {
    if (exceptionCaught)
    ListenerThreadReviver.getInstance().reinitListener("UDP", iUDPPort);
    Logger.getLogger(UDPListener.class).debug("UDPListener exiting gracefully");
    private void extractLog() {
    String strLog = "";
    String strDeviceIP = "";
    strLog = new String(dPacket.getData(), 0, dPacket.getLength());
    strDeviceIP = dPacket.getAddress().toString().replace("/", "");
    processLog(strLog, strDeviceIP);
    dPacket.setLength(buffer.length);
    private boolean initUDPListener() {
    try {
    // constructs a datagram socket and binds it to the specified port on the local host machine
    dSocket = new DatagramSocket(iUDPPort);
    // constructs a new datagram packet for receiving packets
    dPacket = new DatagramPacket(buffer, buffer.length);
    catch (SocketException e)
    // if the socket could not be opened, or the socket could not bind to the specified local port.
    e.printStackTrace();
    // attempts to close dSocket if it is open
    if (dSocket != null && !dSocket.isClosed()) {
    dSocket.close();
    // returns false to indicate initialization failure
    return false;
    return true;
    public synchronized void stopListener() {
    bStop = true;
    dSocket.close();
    -----

    instead of using  SNMPv2-SMI::mib-2.16.19.12.0  use the actual OID.
    i believe you can set it like this ipRouteNextHop.0.0.0.0 a X.X.X.X
    http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?objectInput=.1.3.6.1.2.1.4.21.1.7+&translate=Translate&submitValue=SUBMIT

  • About SNMP in weblogic!

    I am trying to configure SNMP in weblogic
    I mentiond UDP port as 161 and trap destination port addres is 171
    after i run the command java weblogic.diagnostics.snmp.cmdline.Manager SnmpTrapMonitor -p 171
    it shows following exception
    monfox.toolkit.snmp.engine.SnmpTransportException: Cannot bind to port '162'. (java.net.BindException: Permission denied)
    at monfox.toolkit.snmp.engine.UdpTransportProvider.initialize(UdpTransportProvider.java)
    at monfox.toolkit.snmp.engine.TransportProvider.newInstance(TransportProvider.java)
    at monfox.toolkit.snmp.engine.TransportProvider.newInstance(TransportProvider.java)
    at monfox.toolkit.snmp.mgr.n.<init>(n.java)
    at monfox.toolkit.snmp.mgr.SnmpSession.<init>(SnmpSession.java)
    at monfox.toolkit.snmp.appl.SnmpTrapMonitor.g(SnmpTrapMonitor.java)
    at monfox.toolkit.snmp.appl.SnmpTrapMonitor.main(SnmpTrapMonitor.java)
    at monfox.toolkit.snmp.Main.main(Main.java)
    at weblogic.diagnostics.snmp.cmdline.Manager.main(Manager.java:41)
    ERROR: monfox.toolkit.snmp.engine.SnmpTransportException: Cannot bind to port '162'. (java.net.BindException: Permission denied)
    but again i mentiond
    UDP port as :1026 and Trap destination port is : 1037
    i run the command
    java weblogic.diagnostics.snmp.cmdline.Manager SnmpTrapMonitor -p 171
    --- Snmp Trap Received ---
    Version : v1
    Source : UdpEntity:127.0.0.1:1027
    Community : public
    Enterprise : enterprises.140.625
    AgentAddr : 192.168.1.152
    TrapOID : enterprises.140.625.0.70
    RawTrapOID : 1.3.6.1.4.1.140.625.0.70
    Trap Objects : {
    { enterprises.140.625.100.5=Wed May 16 12:01:23 IST 2012 }
    { enterprises.140.625.100.10=new_ManagedServer_2 }
    Raw VarBinds : {
    { enterprises.140.625.100.5=Wed May 16 12:01:23 IST 2012 }
    { enterprises.140.625.100.10=new_ManagedServer_2 }
    --- Snmp Trap Received ---
    Version : v1
    Source : UdpEntity:127.0.0.1:1027
    Community : public
    Enterprise : enterprises.140.625
    AgentAddr : 192.168.1.152
    TrapOID : enterprises.140.625.0.70
    RawTrapOID : 1.3.6.1.4.1.140.625.0.70
    Trap Objects : {
    { enterprises.140.625.100.5=Wed May 16 12:01:23 IST 2012 }
    { enterprises.140.625.100.10=new_ManagedServer_2 }
    Raw VarBinds : {
    { enterprises.140.625.100.5=Wed May 16 12:01:23 IST 2012 }
    { enterprises.140.625.100.10=new_ManagedServer_2 }
    why it not accepted 171
    plz help me?
    Regards,
    BalaSatish Kamma

    port 162 might require root privileges. try using 1162
    On windows I have followed this tutorial and it worked :
    http://weblogic-wonders.com/weblogic/2010/12/17/weblogic-snmp-for-string-monitor/

  • More than one process bind() to a multicast port.

    Hi,
    I found one strange behavior when there are more than one process bind() to the same multicast port. The problem is as the following:
    If there is a process bind to a port, say 2000 and joined a multicast group. This process did not do a SO_REUSEADDR,
    before bind() and join the multicast group. Later on, I have another program in the same host joining the same multicast group with the same port number (with SO_REUSEADDR), the second process will not be able to receive any data from the multicast group (with the same port number) eventhough the second process can join the multicast group successfully.
    However, if both process call setsockop with SO_REUSEADDR, both process can receive multicast data from the multicast group. The simplest fix is to have both set SO_REUSEADDR. But the problem is, the first application is an off-the-shelf software and we do not have source code to it.
    I wonder if this is a problem with Solaris. Any thoughts?
    Thanks,
    Shao

    Hi,
    I found the answer to this question. Basically, according to the source code (Solaris 8 Foundation Source), ip6.c, line #2510, multicast data is forwarded to all "listeners" only if the first "binder" has a SO_REUSEADDR set. What that mean is, if the first "binder" does not set SO_REUSEADDR before bind(), any subsequent bind() with SO_REUSEADDR is meaningless (in practical terms).
    My question is, is this behavior correct? I think it's much better to allow subsequent listeners (successfully bind and joined the multicast group) to be able to receive data. The reason is that if the first binder does not set SO_REUSEADDR before bind() the port and joined the multicast group should not deny any "late comers" to join in and participate in the multicast group. "Fixing the code" is not always practical especially if one of the application is a third-party application. Or reject bind() if the first "binder" does not allow SO_REUSEADDR.
    Any comment?
    Regards,
    Shao

  • Load repository without (TCP/IP) port binding?

    Hello all,
    According to the MDM100 course, it is possible to load repositories without port binding (for port flip-over). But how do I do this?
    When I try to erase the port number of the (unloaded) repository, a message informs me that a port number between 2000 and 9999 is required.
    Is this option gone in SP05?
    Kind regards,
    Dennis klemann

    Hi Charan,
    You're right for typical use, but I'm working on a high availability scenario. Basically, it should be possible to load a slave repository without port binding. In case the master repository fails, the slave can immediately take over (by assigning the port of the master), at least in read-only mode - but better than nothing and external applications don't have to be reconfigured.
    When the master repository is up again, it can take over the port.
    For bigger installations, a clustering system is probably better suited, though...
    Kind regards,
    Dennis

Maybe you are looking for

  • How do I set numbered lists for headings in Pages 5.2, and keep that system of numbered lists saved?

    I have tried to set numbered lists for headings in Pages 5.2 but have not succeeded. I have read similar questions concerning this but this has not helped me... When I say numbered lists I mean something extremely important and simple, for instance:

  • SRM -- MDM -- ECC integration for central contract management for SRM 7.0

    Hi there, I am questioned by a client with respect to the possibility of the following scenario - 1. There are several SAP back end systems in place. 2. SRM 7.0 will be implemented as single sourcing system. 3. The SAP back end systems carry differen

  • PDFs not displaying text properly when going Mac- PC

    We have a serious issue all of a sudden where AI files using Futura being converted to PDF are NOT showing up properly when viewed on PCs. This user is running 10.4.11, CS3 and Font Reserve. When she exports to PDF, random letters will be missing fro

  • Initialize the liveCache

    Good Morning I’m Michele. I have a problem with livecache. I have installed SAP SCM 4.0 server. I have installed SAPliveCacheServer for SAP SCM Server 4.0. I have problem with initialization livecache istance. I have executed the following instructio

  • Flash Pro CS 5.5 will only open when I open as Admin

    For some reason Flash Pro CS 5.5 will only open when I open as Admin.  If I try to open it normaly or by clicking on a fla nothing happens except a program called WerFault.exe and Flash.exe show up in my Task Manager then close.  I get no report that