Exception setting property value with CGLIB ( in hibernate)

My hbm.xml file is:
<hibernate-mapping>
<class name="com.dst.fourx.model.codeModel.CodeGroupDisplay" table="CODE_GROUP_DISPAY1">
<composite-id name="codeGroupDisplayKey" class="com.dst.fourx.model.codeModel.CodeGroupDisplayKey">
<key-property name="nlsLanguage" type="java.lang.String" column="LANG_CD" />
<key-many-to-one name="codeGroupCode" class="com.dst.fourx.model.codeModel.CodesGroup" column="CD_GRP_CD" />
</composite-id>
<property name="createDate" column="CREATE_DT" type="java.util.Date" not-null="true"/>
<property name="createUserCode" column="CREATE_USER_CD" type="java.lang.String" not-null="true"/>
<property name="updateDate" column="LAST_MOD_DT" type="java.util.Date"/>
<property name="updateUserCode" column="LAST_MOD_USER_CD" type="java.lang.String"/>
<property name="displayText" column="DISPLAY_TXT" type="java.lang.String" not-null="true"/>
</class>
<query name="findAllEditableCodeGroups">
<![CDATA[from CodeGroupDisplay]]>
     </query>
</hibernate-mapping>
I m getting the following error while running the above query:
org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.dst.fourx.model.codeModel.CodeGroupDisplayKey.setCodeGroupCode
     at org.hibernate.tuple.PojoComponentTuplizer.setPropertyValues(PojoComponentTuplizer.java:63)
     at org.hibernate.type.ComponentType.setPropertyValues(ComponentType.java:262)
     at org.hibernate.type.ComponentType.resolve(ComponentType.java:447)
     at org.hibernate.type.ComponentType.nullSafeGet(ComponentType.java:182)
     at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:759)
     at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:292)
     at org.hibernate.loader.Loader.doQuery(Loader.java:412)
     at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
     at org.hibernate.loader.Loader.doList(Loader.java:1593)
     at org.hibernate.loader.Loader.list(Loader.java:1577)
     at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)
     at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
     at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
     at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
     at com.dst.fourx.core.impl.ao.dao.actions.HibernateNamedQueryAction.execute(HibernateNamedQueryAction.java:79)
     at com.dst.fourx.core.impl.ao.dao.BaseDAOHibernate.execute(BaseDAOHibernate.java:129)
     at com.dst.fourx.core.impl.ao.dao.AddEditCodeDAO.getAllFundingTypes(AddEditCodeDAO.java:47)
     at com.dst.fourx.core.impl.ao.dao.AddEditDAOTest.testGetCreditBankAccts(AddEditDAOTest.java:29)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:585)
     at junit.framework.TestCase.runTest(TestCase.java:154)
     at junit.framework.TestCase.runBare(TestCase.java:127)
     at junit.framework.TestResult$1.protect(TestResult.java:106)
     at junit.framework.TestResult.runProtected(TestResult.java:124)
     at junit.framework.TestResult.run(TestResult.java:109)
     at junit.framework.TestCase.run(TestCase.java:118)
     at junit.framework.TestSuite.runTest(TestSuite.java:208)
     at junit.framework.TestSuite.run(TestSuite.java:203)
     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: net.sf.cglib.beans.BulkBeanException: com.dst.fourx.model.codeModel.CodesGroup$$EnhancerByCGLIB$$fd9c7e4e
     at com.dst.fourx.model.codeModel.CodeGroupDisplayKey$$BulkBeanByCGLIB$$ae2c0401_2.setPropertyValues(<generated>)
     at org.hibernate.tuple.PojoComponentTuplizer.setPropertyValues(PojoComponentTuplizer.java:59)
     ... 32 more
Caused by: java.lang.ClassCastException: com.dst.fourx.model.codeModel.CodesGroup$$EnhancerByCGLIB$$fd9c7e4e
     ... 34 more

check the setter method for the property LANG_CD in com.dst.fourx.model.codeModel.CodeGroupDisplay.
it must be like -
setNlsLanguage(CodesGroup xyz) { ... }
The paremeters must be objects, not the type of the database column. We can specify the actual field in CodesGroup which acts as the foreign key in CodeGroupDisplay in the "property-ref" attribute of <many-to-one> element in the mapping file for CodeGroupDisplay.
This worked for me. Hope it works for you too.

Similar Messages

  • HibernateSystemException: exception getting property value with CGLIB

    I am getting a hibernate exception error
    HibernateSystemException: exception getting property value with CGLIB
    does anyone know what it means?

    check the setter method for the property LANG_CD in com.dst.fourx.model.codeModel.CodeGroupDisplay.
    it must be like -
    setNlsLanguage(CodesGroup xyz) { ... }
    The paremeters must be objects, not the type of the database column. We can specify the actual field in CodesGroup which acts as the foreign key in CodeGroupDisplay in the "property-ref" attribute of <many-to-one> element in the mapping file for CodeGroupDisplay.
    This worked for me. Hope it works for you too.

  • Exception setting property.....

    Can any one tell me what can be the possible reasons of getting below error :
    ERROR : "Exception setting property PROP_NAME of base with class CLASS_NAME"

    Hard to say it without having the complete stacktrace. You can do yourself and our a lot of favour if you read the stacktrace yourself and find and interpret the root cause.

  • How to get Document Set property values in a SharePoint library in to a CSV file using Powershell

    Hi,
    How to get Document Set property values in a SharePoint library into a CSV file using Powershell?
    Any help would be greatly appreciated.
    Thank you.
    AA.

    Hi,
    According to your description, my understanding is that you want to you want to get document set property value in a SharePoint library and then export into a CSV file using PowerShell.
    I suggest you can get the document sets properties like the PowerShell Command below:
    [system.reflection.assembly]::loadwithpartialname("microsoft.sharepoint")
    $siteurl="http://sp2013sps/sites/test"
    $listname="Documents"
    $mysite=new-object microsoft.sharepoint.spsite($siteurl)
    $myweb=$mysite.openweb()
    $list=$myweb.lists[$listname]
    foreach($item in $list.items)
    if($item.contenttype.name -eq "Document Set")
    if($item.folder.itemcount -eq 0)
    write-host $item.title
    Then you can use Export-Csv PowerShell Command to export to a CSV file.
    More information:
    Powershell for document sets
    How to export data to CSV in PowerShell?
    Using the Export-Csv Cmdlet
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Set JArray values with invalid key value: "LastUpdatedTime" on new alert rule creation

    Hey all!
    I'm trying to create a new alert rule using version 0.9.11 of the Monitoring Library and am getting this error on alertsClient.rules.CreateOrUpdate:
    "Set JArray values with invalid key value: "LastUpdatedTime". Array position index expected."
    That's interesting because LastUpdatedTime is a DateTime object, and whether I set it or I don't, if I set a breakpoint, it does set itself correctly, but the API appears to be expecting a JSON hash?
    I've tested alertsClient and I'm able to get existing alerts (also metrics with metrics client), so I don't believe it's an access issue.
    Any ideas?
    The full code I'm using for the test (borrowed virtually verbatim from the Cloud Cover video
    here): 
    Rule newRule = new Rule
        Name = "CPU Over 90%",
        Id = Guid.NewGuid().ToString(),
        Description = "CPU Has been over 90% for 5 minutes",
        IsEnabled = true,
        LastUpdatedTime = DateTime.Now,
        Condition = new ThresholdRuleCondition
            Operator = Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.ConditionOperator.GreaterThan,
            Threshold = 90,
            WindowSize = TimeSpan.FromMinutes(5),
            DataSource = new RuleMetricDataSource
                MetricName = "Percentage CPU",
                ResourceId = "",
                MetricNamespace = ResourceIdBuilder.BuildCloudServiceResourceId(<cloudservicename>, <deploymentname>)
    RuleAction action = new RuleEmailAction
        SendToServiceOwners = true,
    newRule.Actions.Add(action);
    OperationResponse alertResponse = alertsClient.Rules.CreateOrUpdate(new
    RuleCreateOrUpdateParameters { Rule = newRule });
    Console.WriteLine("Create alert rule response: " + alertResponse.StatusCode);

    Hi Greg,
    Thanks for your post!
    Error "JArray" has been fixed in the latest nugget package.
    Refer to:
    http://www.nuget.org/packages/Microsoft.WindowsAzure.Management.Monitoring/
    Hope this helps!
    Regards,
    Sadiqh

  • Get a web property value with REST

    Hello,
    i want to get the value of a property that i have set in my web property bag using REST call,
    is it possible?
    Thanks a lot

    Hi,
    According to your post, my understanding is that you want to get the web property.
    Per my knowledge, we could not use the listdata.svc to get the web properties, however, we can use the
    Webs web service to achieve it.
    https://social.msdn.microsoft.com/Forums/en-US/198dd547-22fd-4fda-89f2-b76553498c3b/get-web-properties-through-web-service
    What’s more, we can also use the JavaScript Client Object Model to access the property bag.
    http://derekgusoff.wordpress.com/2012/04/24/accessing-the-web-property-bag-with-javascript/
    http://www.jeremythake.com/2013/10/using-the-sharepoint-csom-api-to-get-a-property-bag-value/
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • How to set textfield-values with a process

    Hi.
    I have a form in which the user can fill in some textfields. To ease the usability, there should be a button to set the textfields to predefined values.
    I tried to set the values by implementing the following process:
    BEGIN
    :P2120_VALUE := 100;
    END;
    How can this be realised? What should the "process-point" value of the process be?
    Thanks very much in advance for your help.
    Stephan

    One way to do this would be to set each of the items' Source Used attributes to "Only, ..." and create the process like the one you showed as an after-submit (when button pressed) process then have a branch that goes back to the same page when the button is pressed.
    You should then see the form fields populated with the values established by the process after the branch happens.
    Sometimes with this kind of page logic you have to take care that no after-submit computations, validations, processes, and branches fire when this special button is used, unless you want them to.
    Scott

  • To call a bean function to set a property value with hx:ajaxRefreshRequest

    I have an input box
    I need to output some text onto an output box,When the input box value changes
    I am using Ibm jsf implementation and RSA 7.0,JSF 1.1 implementation
    I know how to call a bean property's setter method using this hx:refresh submit and associated behaviours and target actions.
    As explained in this tutorial
    http://www.ibm.com/developerworks/rational/library/06/1205_kats_rad2/
    But my aim is to call a bean function other than the setter method,because i could do some business logic there and give output.This is possible via setters too,but i believe thats a poor programming practice.
    Hope ppl have got a clear picture of my problem.
    Help me in this.

    You can use any jsf implementation you want, I suggested you only the steps to accomplish the task but I don't know the components you are using...
    You can also accomplish the task without Ajax at all using "classic" http requests but it will be very frustrating for your users...
    Catch client side event (input value change) -> fire an action that update the model -> update presentation layer with up to date model values

  • Javascript to set slider value with System Events

    If I open System Preferences and run this in Script Editor, it fails. It sets the volume to zero, not 50%.
      var se = Application("System Events");
      var spp = se.processes["System Preferences"];
      var curr = spp.windows[0].sliders[0].value();
      console.log("Current value: " + curr + " - " + typeof(curr));
      spp.windows[0].sliders[0].value = 0.5
      var curr = spp.windows[0].sliders[0].value();
      console.log("Current value: " + curr + " - " + typeof(curr));
    But the same thing in AppleScript seems to work fine.
    tell application "System Events"
       tell process "System Preferences"
       set v to value of slider 0 of window 0
       log v
       set value of slider 0 of window 0 to 0.5
       end tell
    end tell
    Anyone know what the problem is?
    thanks,
    Rob

    Jon Handy wrote:
    Hello,
    You should use something like this within the link attribute for that report column.
    onClick="javascript:setItem('P48_RECEIPT_ID',#RECEIPT_ID#);"As noted above, it is not considered good practice in this forum to post unnecessary follow-ups to long expired threads and users. It's worse to do so with information that is inaccurate or incomplete.
    What is the purpose of <tt>javascript:</tt> in this code?
    What is <tt>setItem</tt>? It is not a standard APEX JavaScript API method.
    You're welcome to get involved in the forum, but why make your first post an inaccurate response to a random 6 month old post that is only one of hundreds/thousands of questions on setting an item value using JavaScript?

  • How to set default values with parameter ID EVO

    Hi I need to set price adoption as ''do not copy'' in purchasing default values for buyer(OMFI) and need to assign this default value to the user using the EVO parameter.
    I can not see the parameter ID in dropdown list in maintain user screen.
    Can any one help me in this regard?
    Thank you,

    Just addition to Charlie's suggestion, make sure that you put the same value as used while creating parameter ID. if EVO key is created with Z1 and you put z1 then it wont work, you must put the same value Z1.
    Regards
    Arif Mansuri

  • Set default value with mouse click?

    Hi guys,
    I'm new enough to LabVIEW, and indeed this forum, so I hope you can help. I'm guessing it's a simple problem, but I can't figure out how to do it.
    I've got a cRIO taking in 4 analog voltages. Each voltage is from a linear potentiometer which is measuring suspension displacment on a Formula Student race car.
    I have a simple formula set up to convert input voltage to displacment. I've set up a table of inputs which allows me to set maximum, minimum,(from previous sensor calibration) and "stationary" value of each sensor.
    The "stationary" value is what the sensor should be reading when the car is stopped. This is then used as a baseline for either positive or negative displacments.
    My problem is that each time a different driver gets in the car, the susspension is adjusted, or fuel is added, the "stationary" value will be different. I then have to manually set the stationary value back to whatever the current value is when the car is stopped, press "make current value default", and save the VI before continuing.
    What I would like, is a "calibrate" button which I can press that sets the "stationary" value to whatever the current input voltage is. This way, I wouldn't have to reset 4 values each time the car is modified.
    If you have any ideas on how to do this, please let me know.
    I'll attach my VI once I get back to the laptop where it is saved!
    Thanks,
    Kevin Irving
    Solved!
    Go to Solution.

    Kevin,
    As you have discovered you cannot change the default values on a running VI.
    The best way to do what you want is to use a configuration file.  There is a set of VIs specifically designed for that purpose on the File I/O palette.  When the user presses the "calibrate" button, the values are saved to the file. When the program starts it reads the file and sets the controls to the values in the file.  You can even keep different sets for each driver, if the data is consistent enough.
    Read the detailed help files for the configuration VIs and look at the examples.  These will show you how to get started.
    Lynn

  • How to call Instance Methods and set property values in BAPI?

    In Project systems, for the three business objects viz.
    Network, ProjectDefinition and WBS, there are two kinds of methods which are available : class methods and instance methods. We have tried calling some instance methods, for instance, BAPI_PROJECTDEF_GETDETAIL to get details pertaining to a project. While importing this BAPI, it shows two elements for mapping i.e. Current Internal Project(string) and Current External Project(string). We supplied these values for an existing project. Upon running this call through an XML client at our end, it
    returned an error "Module Unknown Exception". This general message is present on every instance method thus far. Upon searching in BAPI Explorer for Project System->ProjectDefinition->GetDetail, we found that this BAPI didn't take any input parameter.
    Following message was displayed in BAPI Exlorer for this BAPI:
    "... Obligatory import parameters are the external and internal keys CURRENTEXTERNALPROJE and CURRENTINTERNALPROJE of the project definition.The system reads parameters contained in the structure
    BAPI_PROJECT_DEFINITION_EX ..."
    i) How to supply the values of Obligatory import parameters.
    ii) What are the possible causes of this exception.
    iii) How to call an instance method. We are using same mechanism for calling class as well as instance methods so far, we have been to call only class level methods successfully. Is there anything special that we
    need to do to call instance methods.

    Hi,
    what version is the SAP PS running?  If WebAs or higher,  create an inbound synch interface containing your two parameters in the request structure and as many as you require in your response structure.  Generate an Inbound ABAP proxy, where you can plug in some code, i.e. create and instantiate an object of the required type and make the call to the BAPI.
    If SAP PS on lower than WebAs, then create a wrapper function module and make it RFC enabled.  Then plug your code in here and do the same thing.
    Watch out for commits!
    Cheers,
    Mark

  • Setting Default value with SQL Query as Data Model

    Hi All,
    I am developing report based on SQL query.date set as 'SQL Query'. I have created two params start-date and end-date. I am fetching records from database between these two dates.
    I want to populate sysdate as a default values. I do not want to use datatemplate approach i mean using beforeReport trigger.
    Thansk,
    Vara

    Hi Vara,
    To set the default value for one of your parameters to SYSDATE you need to enter:
    {$SYSDATE()$}
    in the Default Value text box
    Is this what you require?
    Cheers
    Andy

  • Set property values using  javascript

    How can I recreate this while using javascript?
    <PARAM NAME="AllowSelection" VALUE="false">
    I tried this...
    document.Grid.setPropertyValue(AllowSelection,false);
    but it did not work.  Where is the documentation that would describe this in its entirety.  Thank you in advance.

    Chip,
    here is the Javascript for you.
    document.iGrid.getGridObject().setAllowSelection(NEWVALUE);
    Documentation you can find under the help Link in MII. You can also use the SAP MII Script Assistant
    to see all supported methods .
    Regards
    Pedro

  • Setting default values with stored procedures

    I have a form that has Start Date and End Date text fields
    that I want to use to colect parameters to send to another page.
    How do I make these default to the first and last day of the
    current year? I know how to use the DATEADD and DATEDIFF functions
    to get the dates but when the value gets to the page it is 0. My
    data is stored in an SQL server.
    CREATE PROCEDURE [dbo].[sp_FirstDayOfCurrentYear] AS
    SELECT DATEADD(yy, DATEDIFF(yy,0,GETDATE()),0)
    GO
    When I run the in the SQL Query Analyzer it returns
    2006-01-01 00:00:00.000
    The command on the asp page is
    Type = Stored Procedure
    SQL = dbo.sp_FirstDayOfCurrentYear
    Variables: Name = @RETURN_VALUE Type = Integer Direction =
    RETURN_VALUE The remainder are blank.

    You'll need to edit the DW-generated code so your parameter
    is Empty instead
    of whatever default DW assigns (usually "" if you leave
    default blank).
    "mtsonic1971" <[email protected]> wrote in
    message
    news:e7rj9j$132$[email protected]..
    >I have a form that has Start Date and End Date text
    fields that I want to
    >use
    > to colect parameters to send to another page. How do I
    make these default
    > to
    > the first and last day of the current year? I know how
    to use the DATEADD
    > and
    > DATEDIFF functions to get the dates but when the value
    gets to the page it
    > is
    > 0. My data is stored in an SQL server.
    >
    > CREATE PROCEDURE [dbo].[sp_FirstDayOfCurrentYear] AS
    >
    > SELECT DATEADD(yy, DATEDIFF(yy,0,GETDATE()),0)
    > GO
    >
    > When I run the in the SQL Query Analyzer it returns
    2006-01-01
    > 00:00:00.000
    >
    > The command on the asp page is
    > Type = Stored Procedure
    > SQL = dbo.sp_FirstDayOfCurrentYear
    > Variables: Name = @RETURN_VALUE Type = Integer Direction
    = RETURN_VALUE
    > The
    > remainder are blank.
    >

Maybe you are looking for