Search Results

Search found 694 results on 28 pages for 'validator'.

Page 4/28 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Spring validator default message codes not resolving

    - by Derek Clarkson
    Hi all, I have a custom spring validator which has the following default message: public @interface FieldMatch { String message() default "au.com.xxx.website.FieldMatchValidation"; ... The problem I'm having is that the message code is not being resolved and <form:error...> is simply displaying the code rather than the message (Which is in a properties file which is being used by a ResourceBundleMessageSource). I've also tried this as String message() default "{au.com.xxx.website.FieldMatchValidation}"; Which causes the message source to crash with an exception indicating that it thinks that the "{}" brackets should contain a number because it thinks it's a parameter place holder. I think that the issue is that the message code is not being seen as a message code and therefore not resolved, but I cannot figure out why. Any suggestions?

    Read the article

  • Spring WS & Validator interceptor

    - by mada
    I have a endpoint mapping a webservice which is used to insert in the dabatabase some keywords: @Transactional(readOnly = false,isolation= Isolation.SERIALIZABLE) public Source saveKW(...). The input is a request. I would like to add an interceptor on the method in order to validate the parameters. this one will read some values from the DB. i would like that this interceptor is EMBED in the transaction declared for the endpoint (or this opposite). In other words, i want them to be in the same transaction. Ideally im looking for something like this with annotation: @Transactional(readOnly = false,isolation= Isolation.SERIALIZABLE) @validator("KeyWordValidaor.class") public Source saveKW(...) where KeyWordValidaor will be class validating the parameters. Have you any idea or short examples to implements this like this way or in a other real way?

    Read the article

  • Min Length Custom AbstractValidationAttribute and Implementing Castle.Components.Validator.IValidato

    - by CRice
    I see with the Castle validators I can use a length validation attribute. [ValidateLength(6, 30, "some error message")] public string SomeProperty { get; set; } I am trying to find a MinLength only attribute is there a way to do this with the out of the box attributes? So far my idea is implementing AbstractValidationAttribute public class ValidateMinLengthAttribute : AbstractValidationAttribute and making its Build method return a MinLengthValidator, then using ValidateMinLength on SomeProperty public class MinLengthValidator : Castle.Components.Validator.IValidator Does anyone have an example of a fully implemented IValidator or know where such documentation exists?? I am not sure what all the methods and properties are expecting. Thanks

    Read the article

  • Rails override validator message

    - by Anand
    Hi, I have a site thats served in 2 flavours, English and French. Here's some code app/views/user/register.html.erb ----------------- <% form_for .....> <%= f.text_field :first_name %> <% end %> app/models/user.rb ------------------ class User < ActiveRecord::Base validates_presence_of :first_name end Now to display the error message in case if the site is being served in the French version, I have app/config/locales/fr.yml ------------------------- activerecord: errors: messages: empty: "ne peut pas être vide" So if someone does not fill in a first name, the validator takes the name of the field and appends the custom message for empty clause giving "First name ne peut pas être vide" which is incorrect, coz 'First name' in French is 'Prénom', hence it should be "Prénom ne peut pas être vide" Please can someone suggest a way of achieving the desired result.

    Read the article

  • NHibernate Validator - how to validate enum type

    - by Herr W.
    I'm using nhibernate validator in my current solution. Everythings is almost fine but... My view model has a property of type Gender (see example below) public virtual Gender Gender { get; set; } public enum Gender { Female = 1, Male = 2 } Now i like to have some validation to ensure that the gender property ist set. But neither the NotEmpty nor the NotNull Attribute fulfil the requirement. Is there a kind of a generic solution or best practice to handle enum validations. Thanks in advance.

    Read the article

  • TextBoxWatermarkExtender and Custom validator problem

    - by Mac
    i have two textboxes one for phone and one for email for phone textbox i have used textbox watermark extender and a filtered textbox extender provided in ajax extension toolkit as a water mark extender text iam displaying only numbers are allowed. the problem is that on client side validation of two textboxes by custom validator iam checking function ValidatePhoneEmail(source, args) { var txtEmail = $('#<%= txtEmail.ClientID %'); var txtPhone = $('#<%= txtPhone.ClientID %>'); if (txtEmail.focus().val().trim() != '' || txtPhone.focus().val().trim() != '') { args.isValid = true; } else { args.isValid = false; } } and the problem is phone textbox is not empty as it contains text "Only Numbers" so it always return false what to do..?

    Read the article

  • asp:Validator in invisible elements + invisible targets

    - by Richard Neil Ilagan
    Somewhat straightforward: will asp:Validators still perform validation when they're in invisible containers? How about if their ControlToValidate target is invisible? For example: <asp:Panel id="myPanel" runat="server" visible="false"> <asp:Textbox id="myTextbox" runat="server" /> <asp:RequiredFieldValidator id="myRfv" runat="server" controltovalidate="myTextbox" /> </asp:Panel> Above is a Validator in an invisible Panel. Would myRfv still perform validation? How about if myTextbox is invisible instead? I'm asking this because I have very specialized Validators in my ASPX, wherein I also have Panels which are hidden/shown dynamically. While I'm all for disabling the validators themselves, I'm just curious whether they'll automatically disable anyway. Thanks guys! :D

    Read the article

  • Jquery scroll to first instance of a class (.error) for jquerytools validator

    - by Tommy Arnold
    I am using jquerytools validator on a clients website but the page using this plugin is very long so I would like to add a custom handler using the folowing code. $("#form").bind("onFail", function(e, errors) { // we are only doing stuff when the form is submitted if (e.originalEvent.type == 'submit') { $(".errormsg").html("Please scroll up and fix the highlighted errors."); //alert("Please fix the highlighted errors to continue"); } }); How would I get it to scroll up to the first instance of .error? Can you recommend any plugins for this?

    Read the article

  • I want jQuery validator to add a class to the form element's parent

    - by Eystein
    How do I use jQuery validator to add/remove a classname (e.g. validate) on the form element's parent <li> so I can style everything related to that element by only setting the one classname? The markup is <li class="validate"> <label for="product">Product of interest <abbr title="Required field">*</abbr></label> <input id="product" type="text" name="product" value="" placeholder="e.g. school bench" class="required" minlength="2"> <!-- Hidden by CSS unless parent has 'validate' class --> <label for="product" class="description">Please name a product.</label> </li> and the default jQuery is $("#commentForm").validate();

    Read the article

  • How do I run jQuery form validation by class?

    - by joshcomley
    Hi there, I've been using the jQuery form validator, but I can't seem to figure out how to trigger it by class. Take this example: $("#myform").validate({ rules: { field: { required: true, date: true } } }); Where field it is expecting the name of the particular input. But, what if I have the following: <input class="date".... /> How can I tell the validator to validate all inputs with a "date" class as a date?

    Read the article

  • .NET 4 RTM MetadataType attribute ignored when using Validator

    - by bart
    I am using VS 2010 RTM and trying to perform some basic validation on a simple type using MetadataTypeAttribute. When I put the validation attribute on the main class, everything works. However, when I put it on the metadata class, it seems to be ignored. I must be missing something trivial, but I've been stuck on this for a while now. I had a look at the Enterprise Library validation block as a workaround, but it doesn't support validation of single properties out of the box. Any ideas? class Program { static void Main(string[] args) { Stuff t = new Stuff(); try { Validator.ValidateProperty(t.X, new ValidationContext(t, null, null) { MemberName = "X" }); Console.WriteLine("Failed!"); } catch (ValidationException) { Console.WriteLine("Succeeded!"); } } } [MetadataType(typeof(StuffMetadata))] public class Stuff { //[Required] //works here public string X { get; set; } } public class StuffMetadata { [Required] //no effect here public string X { get; set; } }

    Read the article

  • Access custom error messages for InArray validator when using Zend_Form_Element_Select

    - by Ben Waine
    Hello, I'm using Zend Framework 1.62 (becuase we are deploying the finished product to a Red Hat instance, which doesn't have a hgih enough PHP version to support ZF1.62). When creating a Form using Zend Form, I add a select element, add some multi options. I use the Zend Form as an in-object validation layer, passing an objects values through it and using the isValid method to determine if all the values fall within normal parameters. Zend_Form_Element_Select works exactly as expected, showing invalid if any other value is input other than one of the multi select options I added. The problem comes when I want to display the form at some point, I cant edit the error message created by the pre registered 'InArray' validator added automatically by ZF. I know I can disable this behaviour, but it works great apart from the error messages. I've tryed the following: $this->getElement('country')->getValidator('InArray')->setMessage('The country is not in the approved lists of countries'); // Doesn't work at all. $this->getElement('country')->setErrorMessage('The country is not in the approved lists of countries'); // Causes a conflict elswhere in the application and doesnt allow granular control of error messages. Anyone have any ideas? Ben

    Read the article

  • ASP.NET required field validator firing on focus in Firefox

    - by ren33
    I have 2 asp.net textboxes in an update panel. Both textbox controls have some javascript attached to autotab to the next field and to allow only numeric input. When I enter some data into the first field and press enter, focus shifts to the next field and the requiredfieldvalidator of the second field displays its "* required" error message, even though I've just entered the field. This is only happening in Firefox. How can I prevent the validator from firing when I first enter the textbox? edit Here's the code: <asp:TextBox ID="add_ISBN" runat="server" Columns="14" MaxLength="17" CssClass="focus" /> <asp:TextBox ID="add_Qty" runat="server" Columns="4" MaxLength="4" /> <asp:RequiredFieldValidator ID="rfvQty" ControlToValidate="add_Qty" ErrorMessage="* required" ForeColor="Red" Display="Dynamic" EnableClientScript="true" ValidationGroup="Add" runat="server" /> In the codebehind: add_ISBN.Attributes.Add("onkeydown", "return isbnCheck(event, '" & add_Qty.ClientID & "')") And the javascript: function isbnCheck(e, id) { e = e || window.event; var key = e.which || e.keyCode if (validIsbnChars.indexOf(parseInt(key, 10)) >= 0) { return true; } else { if (key == 13) { var nextfield = document.getElementById(id); if (nextfield) nextfield.focus(); return false; } if (e.preventDefault) e.preventDefault(); e.returnValue = false; return false; } } The javascript allows only a valid subset of characters, and if the user presses enter, sets focus to the next field.

    Read the article

  • .post inside jQuery.validator.addMethod always returns false :(

    - by abdullah kahraman
    Hello! I am very new to jQuery and javascript programming. I have a program below that checks whether username is taken or not. For now, the PHP script always returns if(isset($_POST["username"]) )//&& isset($_POST["checking"])) { $xml="<register><message>Available</message></register>"; echo $xml; } Login function works, but username checking doesn't. Any ideas? Here is all of my code: $(document).ready(function() { jQuery.validator.addMethod("checkAvailability",function(value,element){ $.post( "login.php" , {username:"test", checking:"yes"}, function(xml){ if($("message", xml).text() == "Available") return true; else return false; }); },"Sorry, this user name is not available"); $("#loginForm").validate({ rules: { username: { required: true, minlength: 4, checkAvailability: true }, password:{ required: true, minlength: 5 } }, messages: { username:{ required: "You need to enter a username." , minlength: jQuery.format("Your username should be at least {0} characters long.") } }, highlight: function(element, errorClass) { $(element).fadeOut("fast",function() { $(element).fadeIn("slow"); }) }, success: function(x){ x.text("OK!") }, submitHandler: function(form){send()} }); function send(){ $("#message").hide("fast"); $.post( "login.php" , {username:$("#username").val(), password:$("#password").val()}, function(xml){ $("#message").html( $("message", xml).text() ); if($("message", xml).text() == "You are successfully logged in.") { $("#message").css({ "color": "green" }); $("#message").fadeIn("slow", function(){location.reload(true);}); } else { $("#message").css({ "color": "red" }); $("#message").fadeIn("slow"); } }); } $("#newUser").click(function(){ return false; }); });

    Read the article

  • Localizing DataAnnotations Custom Validator

    - by Gabe G
    Hello SO, I'm currently working in an MVC 2 app which has to have everything localized in n-languages (currently 2, none of them english btw). I validate my model classes with DataAnnotations but when I wanted to validate a DateTime field found out that the DataTypeAttribute returns always true, no matter it was a valid date or not (that's because when I enter a random string "foo", the IsValid() method checks against "01/01/0001 ", dont know why). Decided to write my own validator extending ValidationAtribute class: public class DateTimeAttribute : ValidationAttribute { public override bool IsValid(object value) { DateTime result; if (value.ToString().Equals("01/01/0001 0:00:00")) { return false; } return DateTime.TryParse(value.ToString(), out result); } } Now it checks OK when is valid and when it's not, but my problem starts when I try to localize it: [Required(ErrorMessageResourceType = typeof(MSG), ErrorMessageResourceName = "INS_DATA_Required")] [CustomValidation.DateTime(ErrorMessageResourceType = typeof(MSG), ErrorMessageResourceName = "INS_DATA_DataType")] public DateTime INS_DATA { get; set; } If I put nothing in the field I get a localized MSG (MSG being my resource class) for the key=INS_DATA_Required but if I put a bad-formatted date I get the "The value 'foo' is not valid for INS_DATA" default message and not the localized MSG. What am I misssing?

    Read the article

  • jquery validator message styling error in IE08 only when customised using errorPlacement function

    - by John Slaytor
    Going back to the errorplacement solution by Nadia (http://stackoverflow.com/questions/860055/jquery-override-default-validation-error-message-display-css-popup-tooltip-like) I have tried it and it works like a charm in Safari and Firefox but causes IE08 to bypass the jqueryvalidator and go straight to the server side validator. My code is this - as soon as I insert 'error element.... it is unstable in IE08. All help much appreciated <script type="text/javascript"> $(document).ready(function() { $("#sampleform").validate({ rules: { dinername: "required", venue: "required", contact: "required", dinertelephone: "required", venuetime: "required", numberdiners: "required", dineremail: { required: true, email: true}, datepicker: { required: true,date: true} }, messages: { dinername: "Your name?", numberdiners: "How many guests?", dinertelephone: "Your mobile?", venue: "Which restaurant?", venuetime: "Your arrival time?", datepicker: "Your booking date?", dineremail: "Please enter a valid email address", }, errorElement: "div", errorPlacement: function(error, element) { element.before(error); offset = element.offset(); error.css('right', offset.right); error.css('right', offset.right - element.outerHeight()); } }); }); </script> <script type="text/javascript"> $(function() { $("#datepicker") .datepicker({minDate: 0, maxDate: '+6M +0D',dateFormat: 'DD, d M yy',onClose: function() {$(this).valid();} }); }); </script> The relevant webpage is http://www.johnslaytor.com.au/nilgiris/forms/bookingform/bookingform.html

    Read the article

  • Should my validator have access to my entire model?

    - by wb
    As the title states I'm wondering if it's a good idea for my validation class to have access to all properties from my model. Ideally, I would like to do that because some fields require 10+ other fields to verify whether it is valid or not. I could but would rather not have functions with 10+ parameters. Or would that make the model and validator too coupled with one another? Here is a little example of what I mean. This code however does not work because it give an infinite loop! Class User Private m_UserID Private m_Validator Public Sub Class_Initialize() End Sub Public Property Let Validator(value) Set m_Validator = value m_Validator.Initialize(Me) End Property Public Property Get Validator() Validator = m_Validator End Property Public Property Let UserID(value) m_UserID = value End property Public Property Get UserID() UserID = m_Validator.IsUserIDValid() End property End Class Class Validator Private m_User Public Sub Class_Initialize() End Sub Public Sub Initialize(value) Set m_User = value End Sub Public Function IsUserIDValid() IsUserIDValid = m_User.UserID > 13 End Function End Class Dim mike : Set mike = New User mike.UserID = 123456 mike.Validator = New Validator Response.Write mike.UserID If I'm right and it is a good idea, how can I go a head and fix the infinite loop with the get property UserID? Thank you.

    Read the article

  • xhtml validator

    - by lolalola
    Hi, why w3 validator show error? "Line 5, Column 7: end tag for "head" which is not finished </head> Most likely, you nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p> Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the <head> element must contain a <title> child element, lists require appropriate list items (<ul> and <ol> require <li>; <dl> requires <dt> and <dd>), and so on. " My code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> Text... </body> </html>

    Read the article

  • Conflict with @Html.LabelFor and W3C Validator?

    - by Tyler
    I have a model that I am using to present an index of a model from a database and have given a display name to some of the rows that may need spaces in them, (I.e. "weekstarting" in a db would be given a display name of "Week Starting"). So I set the display name for my model like this: [DisplayName("Week Starting")] public DateTime WeekStarting { get; set; } and then in the table headers for my table I use the following line of code to display the field name using its given display name: @Html.LabelFor(x => x.First().WeekStarting) The above all works fine. But I am using the W3C validator and it is giving me the following error for the example I have given: The for attribute of the label element must refer to a form control. Forgive me if it is obvious but what am I doing wrong here? I am not using a form I am simply displaying an index of items in a table. I have tried to look for an answer and saw someone suggest that the form controls being referred to need ids (even though I'm not using a form) but this would not be applicable in this instance because if I tried to set an id in the index it would be duplicated with each item in the index: foreach (var item in Model.Tbms) { <tr><td>@item.value</td><tr>.... would be repeated for each item, and also unsure where I would put the id in any case, the td? } Or is there a better way to label the field header, with my preferred display name in the first place? I guess I could just swap @Html.LabelFor... for Hard code field name but do I have to?

    Read the article

  • Why can't the w3c validator find the Perl's SGML::Parser::OpenSP?

    - by coure06
    I have installed W3C validator locally on Windows, following their instructions. I am getting this error while validating a site: Can't locate loadable object for module SGML::Parser::OpenSP in @INC (@INC contains: C:/www/perl/site/lib C:/www/perl/lib .) at C:/www/validator/httpd/cgi-bin/check line 60 Compilation failed in require at C:/www/validator/httpd/cgi-bin/check line 60. BEGIN failed--compilation aborted at C:/www/validator/httpd/cgi-bin/check line 60. I am using SGML::Parser::OpenSP 0.991 module.

    Read the article

  • Glassfish4 throw exception when I declare validation.xml file on classpath

    - by Rafael Ruiz Tabares
    I've tried to declare a custom validator for @NotNull constraint and Glassfish4 throw this exception when find /META-INF/validation.xml. Project works fine if I omit this file. Exception while dispatching an event java.lang.IllegalStateException: Singleton not set for WebappClassLoader(delegate=true; repositories=WEB-INF/classes/) at org.glassfish.weld.ACLSingletonProvider$ACLSingleton.get(ACLSingletonProvider.java:110) at org.jboss.weld.Container.instance(Container.java:54) at org.jboss.weld.bootstrap.WeldBootstrap.shutdown(WeldBootstrap.java:644) at org.glassfish.weld.WeldDeployer.doBootstrapShutdown(WeldDeployer.java:309) at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:220) at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131) at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:493) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:356) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674) at org.glassfish.admin.rest.resources.admin.CommandResource.executeCommand(CommandResource.java:396) at org.glassfish.admin.rest.resources.admin.CommandResource.execCommandSimpInMultOut(CommandResource.java:234) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:125) at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:91) at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:346) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:341) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:101) at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:224) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:267) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:198) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:946) at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:331) at org.glassfish.admin.rest.adapter.JerseyContainerCommandService$3.service(JerseyContainerCommandService.java:165) at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:181) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) at java.lang.Thread.run(Thread.java:744) ]] [2014-06-09T19:37:52.476+0200] [glassfish 4.0] [SEVERE] [AS-WEB-CORE-00108] [javax.enterprise.web.core] [tid: _ThreadID=32 _ThreadName=admin-listener(1)] [timeMillis: 1402335472476] [levelValue: 1000] [[ ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.jboss.weld.servlet.WeldListener at org.apache.catalina.core.StandardContext.start(StandardContext.java:5864) at com.sun.enterprise.web.WebModule.start(WebModule.java:691) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747) at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2278) at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924) at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139) at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122) at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291) at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:356) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674) at org.glassfish.admin.rest.resources.admin.CommandResource.executeCommand(CommandResource.java:396) at org.glassfish.admin.rest.resources.admin.CommandResource.execCommandSimpInMultOut(CommandResource.java:234) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:125) at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:91) at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:346) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:341) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:101) at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:224) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:267) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:198) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:946) at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:331) at org.glassfish.admin.rest.adapter.JerseyContainerCommandService$3.service(JerseyContainerCommandService.java:165) at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:181) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) at java.lang.Thread.run(Thread.java:744) Caused by: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.jboss.weld.servlet.WeldListener at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:3270) at org.apache.catalina.core.StandardContext.addApplicationListener(StandardContext.java:2476) at com.sun.enterprise.web.TomcatDeploymentConfig.configureApplicationListener(TomcatDeploymentConfig.java:251) at com.sun.enterprise.web.TomcatDeploymentConfig.configureWebModule(TomcatDeploymentConfig.java:110) at com.sun.enterprise.web.WebModuleContextConfig.start(WebModuleContextConfig.java:266) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:486) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:163) at org.apache.catalina.core.StandardContext.start(StandardContext.java:5861) ... 66 more Caused by: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.jboss.weld.servlet.WeldListener at org.apache.catalina.core.StandardContext.createListener(StandardContext.java:3391) at org.apache.catalina.core.StandardContext.loadListener(StandardContext.java:5414) at com.sun.enterprise.web.WebModule.loadListener(WebModule.java:1788) at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:3268) ... 73 more Caused by: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.jboss.weld.servlet.WeldListener at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:329) at com.sun.enterprise.web.WebContainer.createListenerInstance(WebContainer.java:1015) at com.sun.enterprise.web.WebModule.createListenerInstance(WebModule.java:2158) at org.apache.catalina.core.StandardContext.createListener(StandardContext.java:3389) ... 76 more Caused by: java.lang.NullPointerException at org.jboss.weld.bootstrap.WeldBootstrap.getManager(WeldBootstrap.java:435) at org.glassfish.weld.services.JCDIServiceImpl.createManagedObject(JCDIServiceImpl.java:320) at org.glassfish.weld.services.JCDIServiceImpl.createManagedObject(JCDIServiceImpl.java:263) at com.sun.enterprise.container.common.impl.managedbean.ManagedBeanManagerImpl.createManagedBean(ManagedBeanManagerImpl.java:485) at com.sun.enterprise.container.common.impl.managedbean.ManagedBeanManagerImpl.createManagedBean(ManagedBeanManagerImpl.java:439) at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:313) ... 79 more This is constraint xml file <constraint-definition annotation="org.hibernate.validator.constraints.NotNull"> <validated-by include-existing-validators="true"> <value>es.project.validator.customConstraint.NotEmptyValidator</value> </validated-by> </constraint-definition> And validation.xml <validation-config xmlns="http://jboss.org/xml/ns/javax/validation/configuration" xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration validation-configuration-1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <constraint-mapping>META-INF/validation/mapping.xml</constraint-mapping> Project's structure WEB-INF +----\classes +-------\META-INF ------- validation.xml ----------\validation +----------\mapping.xml Validator code import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; import javax.validation.constraints.NotNull; import org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorContext; public class NotEmptyValidator implements ConstraintValidator<NotNull,Object> { @Override public void initialize(NotNull constraintAnnotation) { } @Override public boolean isValid(Object value, ConstraintValidatorContext context) { if(value.toString().isEmpty()){ ........... ........... ........... } return true; } }

    Read the article

  • struts2 StringLengthFieldValidator annotation not working for empty string

    - by dcp
    Let's say I have this annotation for a struts2 validation: @StringLengthFieldValidator(key = "key14", fieldName = "poNumber", minLength = "1", maxLength = "255", message = "poNumber must be between 1 and 255 characters.") public void setPoNumber(String poNumber) { this.poNumber = poNumber; } The behavior I'm seeing is that if I pass a string that is empty to this setter, (ex. setPoNumber("")) the validator doesn't catch the error. Strings that are over 255 are caught fine. Equally strange is if I change minLength to 2 and pass a string of length 1, it will catch the error as well. But empty string does not seem to be caught when minLength = "1". For this reason, I cannot use this validator. I just wondered if I'm doing something wrong. I'm using struts 2.1.8.1. Thanks for any advice.

    Read the article

  • Java HTML parser/validator

    - by at
    We allow people to enter HTML code on our wiki-like site. But only a limited subset of HTML to not affect our styling and not allow malicious javascript code. Is there a good Java library on the server side to ensure that the code entered is valid? We tried creating an XML Schema document to validate against. The only issue there is the libraries we used to validate gave back cryptic error messages. What I want is for the validation library to actually fix the issue (if there was a style="" attribute added to an element, remove it). If fixing it is not easy, at least allow me to report a message to the user with the location of the error (an error code that I can present a nice message from is fine, probably even preferable).

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >