• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Application Build error: Could not find method or setter for attribute  RSS feed

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Application run on 1.6 SE. I migrated to 12c R2 which uses 1.8 by default. I get the error
weblogic.application.ModuleException: java.lang.IllegalArgumentException: Could not find method or setter for attribute cute on class xxx with preferred type java.util.HashMap
How do i fix it
 
Sheriff
Posts: 21719
102
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Can you show us the code for class cute? It's apparently missing a method or field, but I want to know why.
 
Shilpa Sathyan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no method called cute in my class. The method name is 'execute' which is an abstract method called from my class. This method also has an annotation @WebServiceRef. THe applications runs fine in 1.6 SE .
 
Ranch Hand
Posts: 201
2
Android Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please post your code for class xxx
 
Shilpa Sathyan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public class classname extends abstractClass{
   public classname () {
       super();
   }

   private static final String className = "classname";

   @WebServiceRef
   public String execute(HashMap<String, String> ctrlInfo, String strXMLMsg) {
;;;
}
 
Randy Tong
Ranch Hand
Posts: 201
2
Android Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why you have so many ; ?
 
Shilpa Sathyan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just mean to say statements inside.
 
Ranch Hand
Posts: 381
2
Fedora IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So there is no field cute in class xxx?
 
Al Hobbs
Ranch Hand
Posts: 381
2
Fedora IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it actually say cute in the error message or does it say execute?  Probably you screwed up somewhere by writing cute instead of execute
 
Shilpa Sathyan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NO .. I dont have any attribute called cute. I think it is expecting setters for the 'exe'cute method name. Now if i change the method name to setwebserviceConfig() ..I get the error Could not find method or setter for attribute webserviceConfig on class xxx with preferred type java.util.HashMap

 
Al Hobbs
Ranch Hand
Posts: 381
2
Fedora IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it actually says cute in the error then thats what its looking for.  I don't know exactly what youre trying to do but probably there is something wrong if it's looking for 'cute'
 
Shilpa Sathyan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


<May 9, 2019 4:21:31,540 PM IST> <Warning> <EJB> <BEA-012035> <The Remote interface method: public abstract java.lang.String com.xxx.common.xmlwrapper.JDBCWrapperEJB.executeSelectSqls(java.util.HashMap,com.xxx.common.util.UserContext) in EJB JDBCWrapperEJB contains a parameter of type com.xxx.common.util.UserContext which is not serializable. Though the EJB JDBCWrapperEJB has call-by-reference set to false, this parameter is not serializable and hence will be passed by reference. A parameter can be passed using call-by-value only if the parameter type is serializable.>
<May 9, 2019 4:21:32,892 PM IST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID "1212644072273576" for task "0" on [partition-name: DOMAIN]. Error is: "weblogic.application.ModuleException: java.lang.IllegalArgumentException: Could not find method or setter for attribute cute on class com.xxx.lm.bookNew with preferred type java.util.HashMap"
weblogic.application.ModuleException: java.lang.IllegalArgumentException: Could not find method or setter for attribute cute on class com.xxx.lm.bookNew with preferred type java.util.HashMap
at weblogic.application.internal.ExtensibleModuleWrapper.activate(ExtensibleModuleWrapper.java:123)
at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:114)
at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:212)
at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:207)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalArgumentException: Could not find method or setter for attribute cute on class com.xxx.lm.bookNew with preferred type java.util.HashMap
at weblogic.utils.reflect.ReflectUtils.getMethodOrFieldForSetter(ReflectUtils.java:340)
at weblogic.j2ee.injection.BaseComponentContributor.findTargetMethodOrField(BaseComponentContributor.java:278)
at weblogic.j2ee.injection.BaseComponentContributor.parseInjectionTarget(BaseComponentContributor.java:266)
at weblogic.j2ee.injection.BaseComponentContributor.parseInjectionTarget(BaseComponentContributor.java:239)
at weblogic.j2ee.injection.BaseComponentContributor.addServiceRef(BaseComponentContributor.java:203)
Truncated. see log file for complete stacktrace
weblogic.application.ModuleException: java.lang.IllegalArgumentException: Could not find method or setter for attribute cute on class com.xxx.lm.bookNew with preferred type java.util.HashMap
at weblogic.application.internal.ExtensibleModuleWrapper.activate(ExtensibleModuleWrapper.java:123)
at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:114)
at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:212)
at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:207)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalArgumentException: Could not find method or setter for attribute cute on class com.xxx.lm.bookNew with preferred type java.util.HashMap
at weblogic.utils.reflect.ReflectUtils.getMethodOrFieldForSetter(ReflectUtils.java:340)
at weblogic.j2ee.injection.BaseComponentContributor.findTargetMethodOrField(BaseComponentContributor.java:278)
at weblogic.j2ee.injection.BaseComponentContributor.parseInjectionTarget(BaseComponentContributor.java:266)
at weblogic.j2ee.injection.BaseComponentContributor.parseInjectionTarget(BaseComponentContributor.java:239)
at weblogic.j2ee.injection.BaseComponentContributor.addServiceRef(BaseComponentContributor.java:203)
Truncated. see log file for complete stacktrace

[04:21:33 PM] Deployment cancelled.


 
Master Rancher
Posts: 4042
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Could not find method or setter for attribute cute on class com.xxx.lm.bookNew with preferred type java.util.HashMap"

Something somewhere is referring to an attribute cute on the class bookNew.
Is there some mapping somewhere?
 
Shilpa Sathyan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not cute attribute. I have a method execute in my class .Same method name is declared in an abstract class which is called in a bean class.
 
Dave Tolls
Master Rancher
Posts: 4042
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you need to show us those declarations.
For example the bookNew class.


Because those errors don't lie.
Somewhere it has been told to look for an attribute called cute on the bookNew class.
It'll be a typo, but it will exist.
 
Shilpa Sathyan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public class bookNew extends CommandInf //abstract class with method name execute {
 
   public bookNew() {
       super()  ;
   }

   private static final String className = "bookNew";

   @WebServiceRef
   public String execute(HashMap<String, String> ctrlInfo, String strXMLMsg) {

   ....
}
 
Dave Tolls
Master Rancher
Posts: 4042
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And that is being referenced from somewhere.
Maybe XML?
Or an annotation somewhere?

Somewhere that Weblogic is trying to inject a bookNew (possibly) or inject a value into a bookNew.

That's where the issue is.
Something is saying that there is a cute attribute.
 
Shilpa Sathyan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 3 java classes: a remote interface,client interface and a bean class which delegates method calls to the original classes. The abstract method execute() does the job. Here the execute() method in my booknew class has a @WebserviceRef annotation.  There is no attribute called 'cute' to generate setter method.  
 
Dave Tolls
Master Rancher
Posts: 4042
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does this occur on startup, or on a call to the service?

If it's a call to the service, do you have the calling code, and the call that failed?
 
Dave Tolls
Master Rancher
Posts: 4042
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now that I've had a proper think about this, is that actually a valid place to stick an @WebServiceRef annotation?

I thought it was used to mark a variable as being a web service to be used, so would be associated with an instance variable or (at a guess) a setter.  It was a way of injecting a reference.
Now, since this is being associated with a method, I am wondering if it is assuming that this is a setter, and so (slightly hackily) substrings out the 'set', leaving you with 'cute'.

Essentially I would say you are using the wrong annotation.
 
Shilpa Sathyan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This was working properly in 1.6 SE .Now had i migrated my code to 1.8 this error pop up while running the application. I tried changing the method name to 'setexecute' as though it is expecting a setter method. But the error was could not find method or setter for attribute "execute". If @WebServiceRef is not the right annotation what would i try otherwise.?
 
Marshal
Posts: 64179
215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set up a trial Java6 installation somewhere and compile your app with that JDK. Tell us what happens.
 
Shilpa Sathyan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works fine with Java 6.
 
Dave Tolls
Master Rancher
Posts: 4042
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no idea exactly what annotation you should be using, but that one (in the documentation) clearly refers to it being for use on the client to mark a variable as a service.

If you are marking the execute method as a service, on the server, then presumably there's an annotation for that.

As far as I can make out this has been the case for quite a while, and it is quite possible you were operating with a bug that has since been fixed.
 
Dave Tolls
Master Rancher
Posts: 4042
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indeed, thinking about it, this can't have been doing anything at all, so what happens if you remove the annotation entirely?
 
Shilpa Sathyan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i completely remove the annotation it throws weblogic.application.ModuleException: java.io.EOFException: Response had end of stream after 0 bytes
 
Dave Tolls
Master Rancher
Posts: 4042
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When does it throw that exception?
What is it doing when it throws that exception?
Is there a stack trace?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!