Struts Log Error - Method Invokation Failed - java

For a long time, ever since a recent change that allowed our users to keep their lost work in case of a system failure for our contact log form, we have had reports of a problem with one of our input forms. When the user tries to enter a very basic contact log (No files, one option, a date to mark it, and the log itself), they are bounced out of our app. Immediately afterwards, if they log in and try again, they can successfully submit the form.
We have been so far unable to duplicate this error on our test server, but we have narrowed down the error thrown when it happens. In our log, it looks like this:
[5/23/13 13:18:47:837 EDT] 46b24806 PropertyUtils E org.apache.commons.beanutils.PropertyUtils Method invocation failed.
[5/23/13 13:18:47:853 EDT] 46b24806 PropertyUtils E org.apache.commons.beanutils.PropertyUtils TRAS0014I: The following exception was logged java.lang.IllegalArgumentException: argument type mismatch
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java(Inlined Compiled Code))
It goes on for several lines, but the jist of the errors seem to indicate a Struts problem. The method being utilized is a do method that writes to an SQL database, though the database itself doesn't seem to be the source of this problem.
Any sort of help or guidance would be appreciated. We have thrown multiple theories across the table, but without being able to duplicate the problem, it's fairly difficult to find a solution. Thank you in advance.
ONE ADDITIONAL NOTE: We are using Struts v. 1.2

Related

Hibernate - handling SQLException

All,
I am working on a project to upgrade hibernate from 4.1.4.FINAL to 5.2.17.FINAL. We have a bunch of Sybase stored procedures executed using org.hibernate.jdbc.Work. These stored procedures raise errors with some valid error codes like 20010. The error messages raised are caught and used to display on the UI. Here is the Sybase syntax to raise errors.
raiserror 20005 'Invalid'
I see that the new version of hibernate delegates SQL exceptions to convert to a specific exception in the JDBCException hierarchy. See -
org.hibernate.exception.internal.StandardSQLExceptionConverter
If it doesn't find a specific exception then it creates GenericJDBCException with a default message set. For example see
org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.coordinateWork -
Here the SQL exception is caught and the convert method is called with message 'error executing work'. So genericJDBCException.getMessage() will give this message.
I know that GenericJDBCException.getSQLException().getMessage() will give the actual sql exception message. But it is not feasible to change the existing code.
Is there a way to add our own delegate so that I can check the error code and return an exception with the message in SQLException. Or is there any better way to handle this?
Thanks

Memcache delete: Unknown exception deleting key

I am trying to determine if its possible to find out the cause of an exception we occasionally get when using Google App Engine's Memcache.
The documentation states that if the key doesn't exist it returns false, so I believe the error indicates a different issue.
This is the stack trace of the error we are getting:
com.google.appengine.api.memcache.LogAndContinueErrorHandler handleServiceError: Service error in memcache (LogAndContinueErrorHandler.java:49)
com.google.appengine.api.memcache.MemcacheServiceException: Memcache delete: Unknown exception deleting key: ahBzfmlkZXh4LXNlcnZpY2Vzch0LEgdQYXRpZW50GICA6ODn6-ELDAsSA0pvYhgBDA
at com.google.appengine.api.memcache.MemcacheServiceApiHelper$RpcResponseHandler.handleApiProxyException(MemcacheServiceApiHelper.java:69)
at com.google.appengine.api.memcache.MemcacheServiceApiHelper$1.absorbParentException(MemcacheServiceApiHelper.java:111)
at com.google.appengine.api.utils.FutureWrapper.handleParentException(FutureWrapper.java:52)
at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:91)
at com.google.appengine.api.memcache.MemcacheServiceImpl.quietGet(MemcacheServiceImpl.java:26)
at com.google.appengine.api.memcache.MemcacheServiceImpl.delete(MemcacheServiceImpl.java:125)
Here is some relevant code:
boolean putValue = memcacheService.put(syncKey, syncKey, Expiration.byDeltaMillis(60000), MemcacheService.SetPolicy.ADD_ONLY_IF_NOT_PRESENT);
memcacheService.delete(syncKey, 100L);
Later requests are unable to put the same key indicating that the object still exists. Given that I am specifying a 60 second expiration, I'd expect that it'd be available after that time, but it's not the case. Right now, the only way we've found to fix this is to clear the entire Memcache.

javax.naming.OperationNotSupportedException Java application with Active directory

We have a java application that has multiple threads and that connects to an active directory application to read the data. But most of time, some thread (not all) fails with exception:
"javax.naming.OperationNotSupportedException: [LDAP: error code 12 - 00000057: LdapErr: DSID-0C090753, comment: Error processing control, data 0, v1db1 ];" when getting next page of result (pagesize = 1000)
I googled and found that we should use only one context through the search. We have done the same thing, we are using the same context to get next page, but failing with the exception. Our domain controller is windows server 2008 r2. Is it related to domain controller or are we missing something here?
I got the solution as we are passing control for sorting of data on attribute CN. The sorting control while searching on DC is not supported once we disabled sorting it worked.

How to handle client side exceptions in GWT/GXT?

I am using GWT. if any server side exception is generated, we are sending an email with error details(have used log4j SMTPAppender). Based on the line number, we can fix the issue..
My scenario is, if any exception is generated in the client package code, as of now, we are giving generic message saying "Some Exception has Occured". But is it possible to display error stack trace along with the exception cause and line number? my code is as below:
GWT.setUncaughtExceptionHandler(new
GWT.UncaughtExceptionHandler() {
public void onUncaughtException(Throwable e) {
Window.alert("Some Exception has Occured");
}
});
I dont think it is possible as client package is converted into Javascript in web mode. Please suggest me if there is any approach to display exception cause and line number where it has occured.
You can read this page
Basically, you have to use JUL to do your logging, and it's client logging : firebug, JS console, etc... You may do some smarter things with the RemoteLogging but i can't help you on that.
The main problem is that log4j is not supported. Maybe with a bridge between JUL and log4j you will be able to achieve everything you want
I would recommend using gwt-log:
Project Page
gwt-log has support for an 'UncaughtExceptionHandler' and a RemoteLogger to send messages/exception to the server.
in gwt-log, you can also turn on the "emulated stack", which is exactly what you want to do:
Wiki Page - Emulated Stack
please note however that this adds a LOT of code to the compiled JS-script

java.lang.IllegalStateException while closing popup form using OC4J 10.1.3.5 and ADF

We are using OC4J 10.1.3.5 and ADF. I have a popup form and when closing we got error below. I wonder what am I missing and how can I resolve it?
Jun 15, 2010 8:26:49 AM com.sun.faces.lifecycle.ApplyRequestValuesPhase execute
SEVERE: java.lang.IllegalStateException: popView(): No view has been pushed.
javax.faces.el.EvaluationException: java.lang.IllegalStateException: popView(): No view has been pushed.
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:150)
at oracle.adf.view.faces.component.UIXComponentBase.__broadcast(UIXComponentBase.java:1087)
at oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:204)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:269)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:327)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:99)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:233)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:202)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:12
From the documentation:
IllegalStateException signals that a method has been invoked at an illegal or inappropriate time. In other words, the Java environment or Java application is not in an appropriate state for the requested operation.
There's no silver bullet to resolve these kinds of exceptions; you have to deal with it on a case by case basis, studying the API of whatever library you're using, and figuring out where the illegal state happens.
In this particular case, it looks like popView() is being called when the stack is empty. You may be missing a pushView, or miscalculating the number of pushes vs pops.

Categories