[jboss-user] [Installation, Configuration DEPLOYMENT] - Re: java.lang.NoSuchMethodException: org.jboss.resource.adap

2008-03-24 Thread cpnehete

Dear jaikiran,

I have changed the calling method name to

 

anonymous wrote : 
  | Method m = ps.getClass().getMethod(methodName, parameters);
  | 


and it's working fine.

Big thanks for the valuable help.




View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4138490#4138490

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4138490
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Installation, Configuration DEPLOYMENT] - Re: java.lang.NoSuchMethodException: org.jboss.resource.adap

2008-03-15 Thread jaikiran
anonymous wrote : java.lang.NoSuchMethodException: 
org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeBatch() 


private Object executeVerboseQuery(String methodName, Class[] parameters)
  | throws
  | SQLException,
  | NoSuchMethodException,
  | InvocationTargetException,
  | IllegalAccessException {
  | //determine which method we have
  | Method m = ps.getClass().getDeclaredMethod(methodName, 
parameters);
  | 
  | 

The executeBatch method is available on the 
org.jboss.resource.adapter.jdbc.WrappedStatement which is a superclass of 
org.jboss.resource.adapter.jdbc.WrappedPreparedStatement. Your are calling 
getDeclaredMethod(executeBatch,null) on WrappedPreparedStatement and hence 
getting the NoSuchMethodException. The getDeclaredMethod method does not look 
for the method in the superclass(es). Instead use getMethod:

Method m = ps.getClass().getMethod(methodName, parameters);

See the javadoc of these methods to understand their difference 
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Class.html


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4136886#4136886

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4136886
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Installation, Configuration DEPLOYMENT] - Re: java.lang.NoSuchMethodException: org.jboss.resource.adap

2008-03-14 Thread cpnehete
Hi Jaikiran,

Please find code for debuggable statement class below,

And I think i didn't change any jar file.

Please do the needful.


  | 
  | package com.work.net;
  | 
  | import java.io.InputStream;
  | import java.io.Reader;
  | import java.lang.reflect.InvocationTargetException;
  | import java.lang.reflect.Method;
  | import java.math.BigDecimal;
  | import java.net.URL;
  | import java.sql.Blob;
  | import java.sql.Clob;
  | import java.sql.Connection;
  | import java.sql.ParameterMetaData;
  | import java.sql.PreparedStatement;
  | import java.sql.Ref;
  | import java.sql.ResultSet;
  | import java.sql.ResultSetMetaData;
  | import java.sql.SQLException;
  | import java.sql.SQLWarning;
  | import java.sql.Time;
  | import java.sql.Timestamp;
  | import java.util.Calendar;
  | import java.util.StringTokenizer;
  | 
  | 
  | public class DebuggableStatement implements PreparedStatement {
  | 
  | private PreparedStatement ps; //preparedStatement being proxied for.
  | private String sql; //original statement going to database.
  | private String filteredSql;
  | //statement filtered for rogue '?' that are not bind variables.
  | private DebugObject[] variables; //array of bind variables
  | private SqlFormatter formatter; //format for dates
  | private long startTime; //time that statement began execution
  | private long executeTime; //time elapsed while executing statement
  | private DebugLevel debugLevel; //level of debug
  | 
  | 
  | protected DebuggableStatement(
  | Connection con,
  | String sqlStatement,
  | SqlFormatter formatter,
  | DebugLevel debugLevel)
  | throws SQLException {
  | //set values for member variables
  | this.ps = con.prepareStatement(sqlStatement);
  | this.sql = sqlStatement;
  | this.debugLevel = debugLevel;
  | this.formatter = formatter;
  | 
  | //see if there are any '?' in the statement that are not bind 
variables
  | //and filter them out.
  | boolean isString = false;
  | char[] sqlString = sqlStatement.toCharArray();
  | for (int i = 0; i  sqlString.length; i++) {
  | if (sqlString == '\'')
  | isString = !isString;
  | //substitute the ? with an unprintable character if the 
? is in a
  | //string.
  | if (sqlString == '?'  isString)
  | sqlString = '\u0007';
  | }
  | filteredSql = new String(sqlString);
  | 
  | //find out how many variables are present in statement.
  | int count = 0;
  | int index = -1;
  | while ((index = filteredSql.indexOf(?, index + 1)) != -1) {
  | count++;
  | }
  | 
  | //show how many bind variables found
  | if (debugLevel == DebugLevel.VERBOSE)
  | System.out.println(count=  + count);
  | 
  | //create array for bind variables
  | variables = new DebugObject[count];
  | 
  | }
  | 
  | /**
  |  * Facade for PreparedStatement
  |  */
  | public void addBatch() throws SQLException {
  | ps.addBatch();
  | }
  | 
  | /**
  |  * Facade for PreparedStatement
  |  */
  | public void addBatch(String sql) throws SQLException {
  | ps.addBatch();
  | }
  | 
  | /**
  |  * Facade for PreparedStatement
  |  */
  | public void cancel() throws SQLException {
  | ps.cancel();
  | }
  | 
  | /**
  |  * Facade for PreparedStatement
  |  */
  | public void clearBatch() throws SQLException {
  | ps.clearBatch();
  | }
  | 
  | /**
  |  * Facade for PreparedStatement
  |  */
  | public void clearParameters() throws SQLException {
  | ps.clearParameters();
  | }
  | 
  | /**
  |  * Facade for PreparedStatement
  |  */
  | public void clearWarnings() throws SQLException {
  | ps.clearWarnings();
  | }
  | 
  | /**
  |  * Facade for PreparedStatement
  |  */
  | public void close() throws SQLException {
  | ps.close();
  | }
  | 
  | /**
  |  * Executes query and Calculates query execution time if DebugLevel = 
VERBOSE
  |  * @return results of query
  |  */
  | public boolean execute() throws SQLException {
  | //execute query
  | Boolean results = null;
  | try {
  | results = (Boolean) executeVerboseQuery(execute, 
null);
  | }
  | catch (SQLException sqle) {
  | throw sqle;
  | }
  | catch (Exception e) {
  | e.printStackTrace();
  | 

[jboss-user] [Installation, Configuration DEPLOYMENT] - Re: java.lang.NoSuchMethodException: org.jboss.resource.adap

2008-03-05 Thread jaikiran
anonymous wrote : 12:41:55,517 ERROR [STDERR] at 
java.lang.Class.getDeclaredMethod(Class.java:1264)
  | 12:41:55,517 ERROR [STDERR] at 
net.itcube.util.jdbc.DebuggableStatement.executeVerboseQuery(DebuggableStatement.java
 

Looks like your application's class net.itcube.util.jdbc.DebuggableStatement is 
trying to call a method on JBoss specific class.  Do you have the code of 
DebuggableStatement.executeVerboseQuery, which might show us which was exactly 
might be wrong?

I checked the jar files in both 3.2.3 and 4.0.3 and i do see that the 
executeBatch method on WrappedPreparedStatement (which extends from 
WrappedStatement) is available in both the versions. Did you modify any of the 
jar files in JBoss?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4134148#4134148

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4134148
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Installation, Configuration DEPLOYMENT] - Re: java.lang.NoSuchMethodException: org.jboss.resource.adap

2008-03-04 Thread cpnehete
Dear jaikiran,

Please find the code below,



  | 
  | public int modifyMasterData(String[] selEmployeeId,
  | String[] facilityId, String[] facilityValues)
  | throws RemoteException, ValidationException {
  | 
  | Connection con = null;
  | PreparedStatement pstmt = null;
  | 
  | long salMasterId = 0;
  | 
  | try {
  | con = ConnectionManager.getConnection();
  | 
  | pstmt = StatementFactory.getStatement(con,
  | getQuery(SQL_MODIFY_MASTER));
  | for (int i = 0; i  selEmployeeId.length; i++) {
  | 
  | salMasterId = this.getMaxCount(MASTER_ID,
  | TAB_EMP_MASTER, con);
  | 
  | if (facilityId.charAt(0) == ',') {
  | int index = facilityId.indexOf(,);
  | if (index == 0) {
  | facilityId = 
facilityId.substring(index + 1,
  | 
facilityId.length());
  | }
  | }
  | String[] tempFacilityIds = 
facilityId.split(,);
  | 
  | if (facilityValues != null  facilityValues != 

  |  facilityValues.charAt(0) == 
',') {
  | int index = facilityValues.indexOf(,);
  | if (index == 0) {
  | facilityValues = 
facilityValues.substring(
  | index + 1, 
facilityValues.length());
  | }
  | }
  | String[] tempFacilityValues = 
facilityValues.split(,);
  | 
  | for (int j = 0; j  tempFacilityIds.length; 
j++) {
  | if (tempFacilityValues[j] != null
  |  
tempFacilityValues[j].length()  0) {
  | pstmt.setLong(1, ParsingUtility
  | 
.parseToLong(tempFacilityValues[j]));
  | } else {
  | pstmt.setLong(1, 0);
  | }
  | pstmt.setLong(2, ParsingUtility
  | 
.parseToLong(selEmployeeId));
  | pstmt.setLong(3, ParsingUtility
  | 
.parseToLong(selEmployeeId));
  | pstmt.setLong(4, ParsingUtility
  | 
.parseToLong(tempFacilityIds[j]));
  | pstmt.addBatch();
  | }
  | pstmt.executeBatch();
  | }
  | ConnectionManager.cleanUp(null, pstmt);
  | } catch (Exception e) {
  | e.printStackTrace();
  | } finally {
  | ConnectionManager.cleanUp(con, pstmt);
  | }
  | 
  | return selEmployeeId.length;
  | }
  | 
  | 

The screen consists of rows having master data.I can select multiple rows with 
the help of checkbox with every row.Then i am clicking on update,which calls 
above method.

Jboss3.2.3 stacktrace for above error is given below.

12:41:55,517 ERROR [STDERR] java.lang.NoSuchMethodException: 
org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.ex
ecuteBatch()
12:41:55,517 ERROR [STDERR] at 
java.lang.Class.getDeclaredMethod(Class.java:1264)
12:41:55,517 ERROR [STDERR] at 
net.itcube.util.jdbc.DebuggableStatement.executeVerboseQuery(DebuggableStatement.java
:949)
12:41:55,517 ERROR [STDERR] at 
net.itcube.util.jdbc.DebuggableStatement.executeBatch(DebuggableStatement.java:257)
12:41:55,517 ERROR [STDERR] at 
net.itcube.payroll.report.ReportSessionBean.modifySalaryMasterData(ReportSessionBean.
java:1490)
12:41:55,517 ERROR [STDERR] at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12:41:55,517 ERROR [STDERR] at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
12:41:55,517 ERROR [STDERR] at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

12:41:55,517 ERROR [STDERR] at 
java.lang.reflect.Method.invoke(Method.java:324)
12:41:55,517 ERROR [STDERR] at 

[jboss-user] [Installation, Configuration DEPLOYMENT] - Re: java.lang.NoSuchMethodException: org.jboss.resource.adap

2008-03-02 Thread jaikiran
Post the entire exception stacktrace. When do use see this error? Also post the 
appropriate code of your application. 

Remember to use the Code button while posting the logs and the code. For more 
details see my signature which has the link to the wiki, listing down the 
guidelines for posting in the forums.  

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4133543#4133543

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4133543
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user