hi all, i have been trying to discovery the bug in my code but i couldn't..
Because i can`t understand the exception message.
so, follow the classe definition and the exception message
CLASSE:
namespace MMS.Models
{
using System;
using System.Collections.Generic;
using Castle.ActiveRecord;
using NHibernate.Expression;
[ActiveRecord("tab_machine")]
public class Machine : ActiveRecordBase
{
private int id;
private string code;
private DateTime acquisitionDate;
private DateTime guaranteeDate;
private float operationVoltage;
private float departureCurrent;
private float ratedCurrent;
private float frequency;
private float departureCoefficient;
private string aditionalInformation;
/* Relacionamentos */
private MachineModel machineModel;
private MachineType machineType;
private MachineGroup machineGroup;
private AssemblyLineStage assemblyLineStage;
//private IList<ActivityMachine> activityMachine = new
List<ActivityMachine>();
[PrimaryKey("id")]
public int Id
{
get { return id; }
set { id = value; }
}
[Property("code")]
public string Code
{
get { return code; }
set { code = value; }
}
[Property("acquisition_date")]
public DateTime AcquisitionDate
{
get { return acquisitionDate; }
set { acquisitionDate = value; }
}
[Property("guarantee_date")]
public DateTime GuaranteeDate
{
get { return guaranteeDate; }
set { guaranteeDate = value; }
}
[Property("operation_voltage")]
public float OperationVoltage
{
get { return operationVoltage; }
set { operationVoltage = value; }
}
[Property("departure_current")]
public float DepartureCurrent
{
get { return departureCurrent; }
set { departureCurrent = value; }
}
[Property("rated_current")]
public float RatedCurrent
{
get { return ratedCurrent; }
set { ratedCurrent = value; }
}
[Property("frequency")]
public float Frequency
{
get { return frequency; }
set { frequency = value; }
}
[Property("departure_coefficient")]
public float DepartureCoefficient
{
get { return departureCoefficient; }
set { departureCoefficient = value; }
}
[Property("aditional_information")]
public string AditionalInformation
{
get { return aditionalInformation; }
set { aditionalInformation = value; }
}
[BelongsTo("tab_machine_model_id")]
public MachineModel MachineModel
{
get{return machineModel;}
set{machineModel = value;}
}
[BelongsTo("tab_machine_type_id")]
public MachineType MachineType
{
get { return machineType; }
set { machineType = value; }
}
[BelongsTo("tab_machine_group_id")]
public MachineGroup MachineGroup
{
get { return machineGroup; }
set { machineGroup = value; }
}
[BelongsTo("tab_line_stage_id")]
public AssemblyLineStage AssemblyLineStage
{
get { return assemblyLineStage; }
set { assemblyLineStage = value; }
}
/*
[HasMany(Table = "tab_atividade_maquina", ColumnKey =
"tab_machine_id",
Inverse = true, Cascade =
ManyRelationCascadeEnum.AllDeleteOrphan)]
public IList<ActivityMachine> ActivityMachine
{
get { return activityMachine; }
set { activityMachine = value; }
}
*/
public static Machine[] FindAll()
{
return (Machine[])FindAll(typeof(Machine));
}
public static Machine FindById(int id)
{
return (Machine)FindByPrimaryKey(typeof(Machine), id);
}
}
}
VIEW:#content_begin($formTitle)
#form_begin($formAction)
#field_hidden($updateId)
#fieldset_begin("Dados da Máquina")
#field_required("Código" "machine.Code" "10")
#field_date("Data de Aquisição" "machine.AcquisitionDate")
#field_date("Data de Garantia" "machine.GaranteeDate")
#fieldset_end()
#fieldset_begin("Dados Técnicos")
#field_select("Grupo" "machine.MachineGroup.Id" $machinegroups "Name")
#field_select("Tipo" "machine.MachineType.Id" $machinetypes "Name")
#field_hidden("machine.MachineModel.Id" "1")
<br/>
#field_float("Tensão de Operação" "machine.OperationVoltage" "5")
#field_float("Corrente de Partida" "machine.DepartureCurrent" "5")
#field_float("Corrente Nominal" "machine.RatedCurrent" "5")
#field_float("Frequência" "machine.Frequency" "5")
#field_float("Coeficiente de Partida" "machine.DepartureCoefficient"
"5") <br/>
#field_note("Informações Adicionais" "machine.AditionalInformation" "60"
"10")
#fieldset_end()
#fieldset_begin("Localização")
#field_hidden("machine.AssemblyLineStage.Id" "1")
#fieldset_end()
#formfooter_begin()
#button_submit("salvar")
#formfooter_end()
#form_end()
#content_end()
AND THE EXCEPTION MSG:
RailsException
Message:
Error building method arguments. Last param analyzed was machine with value
''
StackTrace: at
Castle.MonoRail.Framework.SmartDispatcherController.BuildMethodArguments
(System.Reflection.ParameterInfo[] parameters, IRequest request, IDictionary
actionArgs) [0x00000] at
Castle.MonoRail.Framework.SmartDispatcherController.InvokeMethod
(System.Reflection.MethodInfo method, IRequest request, IDictionary
actionArgs) [0x00000] at Castle.MonoRail.Framework.Controller.InvokeMethod
(System.Reflection.MethodInfo method, IDictionary methodArgs) [0x00000] at
Castle.MonoRail.Framework.ControllerLifecycleExecutor.ProcessSelectedAction
(IDictionary actionArgs) [0x00000]
*Inner exception:* BindingException
Message:
Attempt to create or obtain a composite node named machine, but a node with
the same exists with the type Leaf
StackTrace: at Castle.Components.Binder.TreeBuilder.GetOrCreateCompositeNode
(Castle.Components.Binder.CompositeNode parent, System.String nodeName)
[0x00000] at Castle.Components.Binder.TreeBuilder.ProcessNode
(Castle.Components.Binder.CompositeNode node, System.Type type,
System.String name, System.Object value) [0x00000] at
Castle.Components.Binder.TreeBuilder.PopulateTree
(Castle.Components.Binder.CompositeNode root,
System.Collections.Specialized.NameValueCollection nameValueCollection)
[0x00000] at Castle.Components.Binder.TreeBuilder.BuildSourceNode
(System.Collections.Specialized.NameValueCollection nameValueCollection)
[0x00000] at
Castle.MonoRail.Framework.SmartDispatcherController.get_ParamsNode ()
[0x00000] at
Castle.MonoRail.Framework.SmartDispatcherController.ObtainParamsNode
(ParamStore from) [0x00000] at
Castle.MonoRail.Framework.DataBindAttribute.Bind
(Castle.MonoRail.Framework.SmartDispatcherController controller,
System.Reflection.ParameterInfo parameterInfo) [0x00000] at
Castle.MonoRail.Framework.SmartDispatcherController.BuildMethodArguments
(System.Reflection.ParameterInfo[] parameters, IRequest request, IDictionary
actionArgs) [0x00000]
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---