Saturday, November 21, 2009

UCM Content Server Error

Sometimes UCM Content Server doesnot start when you attempt to start it. If the error is one of the below, then it is because some other service is already listening on that port. So kill that process and the content server will start sweetly.

Follow my earlier post "How to find the process which is using a port" or do a google search on how to find the process which is already listening on a port.

After you the find the process listening on the port that content server is attempting to listen kill that process and then start the content server.
It should be java.exe.

*********************************************************
C1Node1: Unable to start the providers for 'Idc Content Service idc'. Unable to start the system provider 'SystemServerSocket'. Could not listen on address 10.102.65.46 port 4444. java.net.BindException: Address already in use: JVM_Bind [ Details ]
An error has occurred. The stack trace below shows more information.

!$C1Node1: !csUnableToStartProviders,Idc Content Service idc!csProviderUnableToStartSystem,SystemServerSocket!csCouldNotListen,10.102.65.46,4444!syExceptionType2,java.net.BindException,Address already in use: JVM_Bind
intradoc.common.ServiceException: !csProviderUnableToStartSystem,SystemServerSocket
at intradoc.server.IdcSystemLoader.prepareStartMonitorProviders(IdcSystemLoader.java:2104)
at intradoc.server.IdcManagerBase.startProviders(IdcManagerBase.java:67)
at intradoc.server.IdcManagerBase.serviceStart(IdcManagerBase.java:297)
at intradoc.server.IdcServerManager.serviceStart(IdcServerManager.java:170)
at IdcServerNT.init(IdcServerNT.java:87)
at IdcServerNT.main(IdcServerNT.java:54)
Caused by: intradoc.data.DataException: !csCouldNotListen,10.102.65.46,4444
at intradoc.provider.SocketIncomingProvider.startProvider(SocketIncomingProvider.java:255)
at intradoc.provider.Provider.startProvider(Provider.java:83)
at intradoc.provider.Provider.startProvider(Provider.java:76)
at intradoc.server.IdcSystemLoader.prepareStartMonitorProviders(IdcSystemLoader.java:2081)
... 5 more
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at intradoc.provider.SocketIncomingProvider.createServerSocket(SocketIncomingProvider.java:544)
at intradoc.provider.SocketIncomingProvider.startProvider(SocketIncomingProvider.java:235)
**********************************************************

C1Node1: Failed to initialize the server. Unable to start the system provider 'SystemServerSocket'. Could not listen on address 10.102.65.46 port 4444. java.net.BindException: Address already in use: JVM_Bind [ Details ]
A fatal error has occurred. The stack trace below shows more information.

!$C1Node1: !csFailedToInitServer!csProviderUnableToStartSystem,SystemServerSocket!csCouldNotListen,10.102.65.46,4444!syExceptionType2,java.net.BindException,Address already in use: JVM_Bind
intradoc.common.ServiceException: !csProviderUnableToStartSystem,SystemServerSocket
at intradoc.server.IdcSystemLoader.prepareStartMonitorProviders(IdcSystemLoader.java:2104)
at intradoc.server.IdcManagerBase.startProviders(IdcManagerBase.java:67)
at intradoc.server.IdcManagerBase.serviceStart(IdcManagerBase.java:297)
at intradoc.server.IdcServerManager.serviceStart(IdcServerManager.java:170)
at IdcServerNT.init(IdcServerNT.java:87)
at IdcServerNT.main(IdcServerNT.java:54)
Caused by: intradoc.data.DataException: !csCouldNotListen,10.102.65.46,4444
at intradoc.provider.SocketIncomingProvider.startProvider(SocketIncomingProvider.java:255)
at intradoc.provider.Provider.startProvider(Provider.java:83)
at intradoc.provider.Provider.startProvider(Provider.java:76)
at intradoc.server.IdcSystemLoader.prepareStartMonitorProviders(IdcSystemLoader.java:2081)
... 5 more
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at intradoc.provider.SocketIncomingProvider.createServerSocket(SocketIncomingProvider.java:544)
at intradoc.provider.SocketIncomingProvider.startProvider(SocketIncomingProvider.java:235)

How to find which process is using a port in Windows

The netstat command is used to display the TCP/IP network protocol statistics and information.

For help and to find all the options available with netstat command execute the below command.
c:/>netstat /?

To find all the open ports and which process is listening on those ports in Windows 2003 server follow the below steps.

Go to command prompt and type netstat -ano
It gives you the result of all active process running on the system along with the port to which they listen.

Then once you get the process id(PID) from the above step,
Go to Task Manager -> Processes tab.
Click View Menu -> Select Columns..
And select the check box of PID so that it gets displayed on the Processes tab.
Now using the PID got from the first step, get the process name which is listening on a particular port.

Monday, September 21, 2009

Ebooks

Books of every technology is available for free in this site in pdf format.
www.flazx.com

Tuesday, September 8, 2009

Servlet and Jsp Version and Server Information

Servlet and Jsp Version and also the Server information such as name and version that is being used can be obtained using the follwing code.

package com.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspFactory;

public class VersionServlet extends HttpServlet {

protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {

PrintWriter out = response.getWriter();

//Servlet Version
//getMajorVersion() -> Returns the major version of the Java Servlet API that this servlet container supports.
//getMinorVersion() -> Returns the minor version of the Servlet API that this servlet container supports.
out.println("Servlet Version " +
this.getServletContext().getMajorVersion() + "." +
this.getServletContext().getMinorVersion());

//Jsp Version
out.println("Jsp Version " +
JspFactory.getDefaultFactory().getEngineInfo().
getSpecificationVersion());

//ServerInformation
//getServerInfo -> Returns the name and version of the servlet container on which the servlet is running.
out.println("Server Info " + this.getServletContext().getServerInfo());


}

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}

}

Tuesday, July 28, 2009

Case Insensitive Replace in Java

public class TestReplaceAll {
public static void main(String[] args) {
String str = "I am a programMeR";
System.out.println("input : " + str);
str = str.replaceAll("(?i)programmer", "developer");
System.out.println("output : " + str);
}
}

This program might be helpful in replacing words which are not consistent with respect to case in a string. This piece of code was given by a colleague.

Sunday, July 26, 2009

Simple Javascript code for validating only numbers in a text box

A small script which will allow only numbers to be typed inside a textbox.
No other character or symbol will be allowed.
This would be helpful if we have a field in which only numbers should be entered by user.


function validateForNumbers(valFromTextBox)
{
if(valFromTextBox.value.length>0)
{
valFromTextBox.value =
valFromTextBox.value.replace(/[^\d]+/g, '');
}
}

Call this function on "onkeyup" event.

Bye...

Java - Rounding floating point numbers to a certain number of decimal places

Small piece of code to round decimal numbers to specified number of decimal places.
public float Round(float val, int roundOffTo){
float p = (float)Math.pow(10,roundOffTo);
val = val * p;
float tmp = Math.round(val);
return (float)tmp/p;
}

Sunday, July 19, 2009

Hi.. Started off blogging 2day..