N. Ganapathy

Greenhorn
+ Follow
since Apr 16, 2012
N. likes ...
Netbeans IDE Oracle Java
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by N. Ganapathy

We have created a JAX-WS webservice which is built and deployed using Axis 2. The webservice implements a remote interface. The webservice is annotated as Stateleess. The webservice accepts a POJO as argument and returns another POJO. Both POJOs are annotated as XMLRootEelement.

Problem statement:
When we hit the webservice from SOAP UI, it returns error that the argument passed is null. To avoid this error if we add annotation Style.RPC then we get the marshalling error.


<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>javax.xml.bind.MarshalException
- with linked exception:
[javax.xml.bind.JAXBException: [xxxyyyVO; is not known to this context]</faultstring>
<detail/>
</soapenv:Fault>


thanks in advance
9 years ago

Karn Kumar wrote:Can you elaborate what all you tried and how exactly you are trying so that we can understand your requirement ?

Is it simply to fetch total Count / Per Page records = total pages (Can be done by Ajax call to get DB call and return final total number of pages ) .



Dear Karn,

We are uploading a pdf file from client side. Actually we need to the find the total number of pages of the document based on which the user will decide whether the file has to be uploaded or not.

Instead passing it to the another jsp file and calculating the pagenumber, we need to handle this in the same java script file itself.
9 years ago
JSP

How to find the total number of pages in java script . Kindly let me know how to achieve it.

Thanks in advance.
9 years ago
JSP
When i try to deploy my webservice in JBoss 6 . The following error occurs.


2013-07-29 17:59:13,498 ERROR [ProfileServiceBootstrap] (Thread-2) Failed to load profile:: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

DEPLOYMENTS IN ERROR:
Deployment "vfs:///F:/jboss-6.0.0/server/default/deploy/RTBAWebServices.war" is in error due to the following reason(s): java.lang.InternalError: Enclosing method not found

at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.GA]
at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.0.0.Final]
at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107) [:0.2.2]
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [:6.0.0.Final]
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.Final]
at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
at java.lang.Thread.run(Thread.java:619) [:1.6.0_06]



Kindly help me out. I am migrating the webservice from JBoss4 to JBoss 6.

Thanks in Advance,
10 years ago
I tried to deploy the webservice in Jboss 6 but it is showing an error saying that "Only one JAX-RS Application class is allowed". But the same is deployed in JBOSS 4. Kindly help me out to solve the issue.

I have attached the screenshot of the error.

Thanks in Advance.
10 years ago
Window1 -> one.jsp, from this jsp , we are calling one more jsp (Window2) to generate pdf by window.open("two.jsp?x=y"). By doing this it opens Two.jsp and generate the pdf as well , finally that window2 get closed. But the scenario is, the copy of Window1 still exist in the view with empty content even HttpServletResponse gets committed.

Code in Two.jsp:

File NewFile=new File(outpath);
byte[] fileData = new byte[(int)NewFile.length()];
FileInputStream fis = new FileInputStream(NewFile);
fis.read(fileData);
response.reset();
response.setContentType("application/pdf");
response.setContentLength(fileData.length);
response.setHeader("Content-Disposition","attachment;filename=\"Sample.pdf\"");
ServletOutputStream outputStream = response.getOutputStream();
outputStream.write(fileData);
outputStream.flush();
outputStream.close();
fis.close();
Currently we are migrating from JBOSS 4.0.2 to JBOSS 6.0 , The above code is working fine in JBOSS 4.0.2. Is this issue related to JBOSS 6.0? Kindly help us to come out from this issue. Expecting your valuable suggetions.

Thanks in advance.


10 years ago
Wendy Gibbons

It is a SQL server 2005, i want query to compare the two databases. I am having query to compare databases of same server.. now i want to know how can achieve this between different servers??
Actually i have two Databases which are similar. once is deployed in UAT and Another one in Production. Now i want to compare these two , to know what changes have been done recently.
Please help me out. i want to compare two database of different servers. kindly provide me any solutions.


Regards,
Ganapathy.N
I am trying google search funtionality .How to change text box into Listbox dynamically or how to load all the values of listbox in textbox. I am getting search results in combo box now i want load the search results into textbox. is ther anyway to use text box as listbox.
My jsp code
<%--
Document : index
Created on : Aug 6, 2012, 5:51:25 PM
Author : Administrator
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> <meta http-equiv="Expires" content="Sat, 01 Dec 2001 00:00:00 GMT">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<link rel="stylesheet" type="text/css" href="/prowebapp/web/css/bondstyle.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Address Search</title>
<script language="javascript" src="Scripts/Ajaxcalling.js"></script>

<script language="javascript">
function passvalue(){

document.getElementById('name').value=document.getElementById('DROPDOWN').value;

}
</script>


</head>
<body onload="document.DPIDS.name.focus()">

<div id="StateCombo" style="border-right: #000000 thin solid; border-top: #000000 thin solid;
font-weight: normal; border-left: #000000 thin solid; width:540px; border-bottom: #000000 thin solid;
height: 10px; background-color: gainsboro">

<form name="DPIDS">
<table class=textgreyboldTable>
<%
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires", 0); //prevents caching at the proxy server
response.setHeader("Cache-Control", "max-stale=0"); // HTTP 1.1
%>

<tr>
<td>
<label>Address              :</label>


<input type="textarea" id="name" name="name" class=textInputDetails style="width: 300px" size="10" onkeyup="onKey();"/>

<input type="button" id="GetAdd" class="button3" value=" Go " onclick="getAddress();"/>
</td>
</tr>
<tr>
<td>
<label>Matching Address:</label>
<select name="DROPDOWN" id="DROPDOWN" style="width: 300px" size="10" onchange="passvalue();">
</select>
</td>
</tr>
<tr>
<td align="center">
<input type="button" id="SetValue" name="SetValue" class="button3" value=" Ok " onclick="GetMoniker();"/>
<input type="button" id="cancel" name="cancel" value="Cancel" onclick="window.parent.close();">
</td>
</tr>
<input type="hidden" id="dpid" name="dpid" class='textInputBox'>
<input type="hidden" name="Street" id="Street"/>
<input type="hidden" name="len" id="len"/>
<
<input type="hidden" name="Suburb" id="Suburb"/>
<input type="text" name="Postcode" id="Postcode" style="visibility: hidden"/>
<input type="hidden" name="Barcode" id="Barcode"/>
<input type="hidden" name="Statecode" id="Statecode"/>



</table>

</form>
</div>
</body>
</html>

Thanks in advance
11 years ago
JSP
I am facing problem while giving input to the webservice through servlet. the below code shows some of the variable for which we pass the input . i can't pass input to the variable "Engine" which has datatype ENGINETYPE


@XmlElement(name = "Engine", required = true)
protected EngineType engine;
@XmlElement(name = "Layout")
protected String layout;

how to give input to the variable which is set as protected. please help me out with the above datatype "ENGINETYPE" and the variable is "engine".
the other variable which has datatype String can be given input. This code is in webservice. please help me out to pass the input to the variable "Engine".

Thanks in Advance
11 years ago
Session ID of this connection:1272716213
Date
Error in appending null
kumar
Error in appending null
appdata
Error in appending null
raja
Error in appending null
approver V1
Error in appending null
naveen
Error in appending null
APS V1
Error in appending null
as
Error in appending null
ce
Error in appending null
ce V1
Error in appending null
ce V1(2012_3_26_16_58_50_920)
Error in appending null
CEASCANOC20JOB
Error in appending null
Classificator
Error in appending null
Custom Reports
Error in appending null

Cabinet DisConnected Successfully and session id is:1272716213



This is my output.
11 years ago
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author Administrator
*/
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;


import com.newgen.dmsapi.DMSXmlList;
import com.newgen.dmsapi.DMSXmlResponse;
import com.newgen.omni.wf.util.app.*;


import java.io.FileInputStream;
import java.sql.*;
import java.util.Iterator;
import java.util.Vector;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;

public class ReadExcelFile {


private String inputFile;
NGEjbClient ejbObj;
StringBuffer strBuffer = null;
String strInputXml="";
String strOutputXml = "";
String strSessionId = "";
String strLogPath = "D://netbe//samp";
String strReportLogPath = "";
//Date dtCurDate = new Date();
String strCurTime = "";
String strCurDateTime = "";
String strJbossIp = "192.168.12.87";
String strJbossPort = "1099";
String strCabinetName = "tr_spt";
String strUserName = "supervisor";
String strPassword = "supervisor351";
String sFolderName="";
String strInputFilepathAS="outfile.csv";
String strVendornameA="";
String strVendorname1A="";
Connection conn=null;

public void connect()throws Exception{
ejbObj=NGEjbClient.getSharedInstance();
ejbObj.initialize("192.168.12.87","1099","Jboss");
strBuffer=new StringBuffer();
//String strInputXml = "";
DMSXmlResponse xmlResponse = null;
DMSXmlList xmlList = null;
strInputXml ="<?xml version=1.0?>"
+"<NGOConnectCabinet_Input>"
+ "<Option>NGOConnectCabinet</Option>"
+"<CabinetName>"+strCabinetName+"</CabinetName>"
+"<UserName>"+strUserName+"</UserName>"
+"<UserPassword>"+strPassword+"</UserPassword>"
+"<UserExist>N</UserExist>"
+"<UserType>S</UserType>"
+"<NGOConnectCabinet_Input>";

strOutputXml=ejbObj.makeCall(strInputXml.toString());
xmlResponse=new DMSXmlResponse(strOutputXml);
System.out.println("Cabinet Connected Successfully\n");
System.out.println("Fetched List While Connect:\n\n"+strOutputXml);
xmlList = xmlResponse.createList("Instruments", "Instrument");
if(xmlResponse.getVal("Status").equals("0")){
strSessionId=xmlResponse.getVal("UserDBId");
System.out.println("Session ID of this connection:"+strSessionId);
}else{
System.out.println("Error in Connecting Application Server");
return;
}
}
public void DisconnectCabinet() throws Exception{

ejbObj=NGEjbClient.getSharedInstance();
ejbObj.initialize("192.168.12.87","1099","Jboss");
DMSXmlResponse xmlResponse = null;

strInputXml ="<?xml version='1.0'?>"
+"<NGODisconnectCabinet_Input>"
+"<Option>NGODisconnectCabinet</Option>"
+"<CabinetName>"+strCabinetName+"</CabinetName>"
+"<UserDBId>"+strSessionId+"</UserDBId>"
+"</NGODisconnectCabinet_Input>";
strOutputXml=ejbObj.makeCall(strInputXml.toString());
xmlResponse=new DMSXmlResponse(strOutputXml);
if(xmlResponse.getVal("Status").equals("0")){
// strSessionId=xmlResponse.getVal("UserDBId");
System.out.println("\n Cabinet DisConnected Successfully and session id is:"+strSessionId);
// System.out.println("fetched list:"+strOutputXml);
}else{
System.out.println("Error in DisConnecting Application Server");

return;
}
}

/*

public static Vector ReadCSV(String fileName) {
Vector cellVectorHolder = new Vector();

try {
FileInputStream myInput = new FileInputStream(fileName);
POIFSFileSystem myFileSystem = new POIFSFileSystem(myInput);
HSSFWorkbook myWorkBook = new HSSFWorkbook(myFileSystem);
HSSFSheet mySheet = myWorkBook.getSheetAt(0);
Iterator rowIter = mySheet.rowIterator();

while (rowIter.hasNext()) {
HSSFRow myRow = (HSSFRow) rowIter.next();
Iterator cellIter = myRow.cellIterator();
Vector cellStoreVector = new Vector();
while (cellIter.hasNext()) {
HSSFCell myCell = (HSSFCell) cellIter.next();
cellStoreVector.addElement(myCell);
}
cellVectorHolder.addElement(cellStoreVector);
}
} catch (Exception e) {
e.printStackTrace();
}
return cellVectorHolder;
}

public static void printCellDataToConsole(Vector dataHolder) {
//LinkedList<String> row = new LinkedList<>;
Connection conn = null;
Vector row = new Vector();
for (int i = 0; i < dataHolder.size(); i++) {
Vector cellStoreVector = (Vector) dataHolder.elementAt(i);
for (int j = 0; j < cellStoreVector.size(); j++) {
HSSFCell myCell = (HSSFCell) cellStoreVector.elementAt(j);
String stringCellValue = myCell.toString();
System.out.print(stringCellValue + "\t");
try{
Statement sta = conn.createStatement();
String table = "INSERT INTO ashok (username) VALUES('" +stringCellValue+ "')";
System.out.println(table);



sta.executeUpdate(table);
sta.close();
} catch (Exception ex) {
System.out.println("Error in appending " + ex.getMessage());
}
}
}

}
@SuppressWarnings("static-access")
public static void main(String[] args) {

String fileName = "test.xls";
Vector dataHolder = ReadCSV(fileName);
printCellDataToConsole(dataHolder);
try
{
ReadExcelFile objConn=new ReadExcelFile();
objConn.connect();
objConn.ReadCSV(fileName);
objConn.printCellDataToConsole(dataHolder);
objConn.DisconnectCabinet();
}
catch(Exception e)
{
System.out.println("Error in Main" + e.getMessage());
}
}
}*/

public void readExcelFile(String fileName)

{
/**
* Create a new instance for cellDataList
*/

List cellDataList = new ArrayList();
try
{
/**
* Create a new instance for FileInputStream class
*/
FileInputStream fileInputStream = new FileInputStream(fileName);
/**
* Create a new instance for POIFSFileSystem class
*/
POIFSFileSystem fsFileSystem = new POIFSFileSystem(fileInputStream);
/*
* Create a new instance for HSSFWorkBook Class
*/
HSSFWorkbook workBook = new HSSFWorkbook(fsFileSystem);
HSSFSheet hssfSheet = workBook.getSheetAt(0);
/**
* Iterate the rows and cells of the spreadsheet
* to get all the datas.
*/
Iterator rowIterator = hssfSheet.rowIterator();
while (rowIterator.hasNext())
{
HSSFRow hssfRow = (HSSFRow) rowIterator.next();
Iterator iterator = hssfRow.cellIterator();
List cellTempList = new ArrayList();
while (iterator.hasNext())
{
HSSFCell hssfCell = (HSSFCell) iterator.next();
cellTempList.add(hssfCell);
}
cellDataList.add(cellTempList);
}
}
catch (Exception e)
{
e.printStackTrace();
}
/**
* Call the printToConsole method to print the cell data in the
* console.
*/
printToConsole(cellDataList);
}

/**
* This method is used to print the cell data to the console.
* @param cellDataList - List of the data's in the spreadsheet.
*/
public void printToConsole(List cellDataList)
{

for (int i = 0; i < cellDataList.size(); i++)
{
List cellTempList = (List) cellDataList.get(i);
for (int j = 0; j < cellTempList.size(); j++)
{
HSSFCell hssfCell = (HSSFCell) cellTempList.get(j);
String stringCellValue = hssfCell.toString();
System.out.print(stringCellValue + "\t");

System.out.println();
try{
Statement sta = conn.createStatement();
String table = "INSERT INTO ashok (username) VALUES('" +stringCellValue+ "')";
System.out.println(table);



sta.executeUpdate(table);
sta.close();
} catch (Exception ex) {
System.out.println("Error in appending " + ex.getMessage());
}
} }
}

public static void main(String[] args)
{
String fileName ="test.xls";
new ReadExcelFile().readExcelFile(fileName);

try
{
ReadExcelFile objConn=new ReadExcelFile();
objConn.connect();
objConn.readExcelFile(fileName);
// objConn.printToConsole(null);
objConn.DisconnectCabinet();

}
catch(Exception e)
{
System.out.println("Error in Main" + e.getMessage());
}
}
}


this is my coding
11 years ago
I fetched the data from excel sheet while i trying to export to database it is displayin as "error in appending"
11 years ago


please help me out with this. how to import data from excel sheet to database in java i tried different codes but it is not working . please help me friends



thanks in advance
11 years ago