Questions tagged [javax]

Pointless catch-all tag. Do not use. For removal.

Pointless catch-all tag. Do not use. For removal.

176 questions
48
votes
4 answers

javax.validation to validate list of values?

is there a way to use javax.validation to validate a variable of type string called colour that needs to have these values only(red, blue, green, pink) using annotations? i have seen @size(min=1, max=25) and @notnull but is there something like…
Jono
  • 17,341
  • 48
  • 135
  • 217
26
votes
1 answer

Websocket ServerEndpoint instance by subprotocol

Based on this question I'd like to create a server endpoint instance based on the negotiated subprotocol to handle various protocol messages differently. Unfortunately ServerEndpointConfig.Configurator.getEndpointInstance [docs] wouldn't let me…
Ben
  • 807
  • 1
  • 8
  • 22
15
votes
1 answer

Why Swagger created a systemId field in example?

I have a REST POST function that has the following header: @POST @Consumes(value = { MediaType.APPLICATION_JSON + ";charset=utf-8" }) @Produces(value = { MediaType.APPLICATION_JSON + ";charset=utf-8" }) @ApiOperation(value = "Create a document…
Gangnus
  • 24,044
  • 16
  • 90
  • 149
13
votes
2 answers

javax validation greater or less than from other property

with respect to javax.validation @NotNull(message = "From can't be null") @Min(value = 1, message = "From must be greater than zero") private Long from; @NotNull(message = "To can't be null") @Min(value = 1, message = "To must be greater…
Shahid Ghafoor
  • 2,991
  • 17
  • 68
  • 123
9
votes
3 answers

javax validation size trim whitespace

I need to validate a field in POJO, it must be min length = 2, ignoring leading and trailing whitespaces class User { @NotBlank @Size(min = 2) private String name; } it not works for " A" How it should be?
Romper
  • 2,009
  • 3
  • 24
  • 43
8
votes
2 answers

Disable not null checks in Kotlin

class User(val name: String) I know that in constructor will be added this check Intrinsics.checkParameterIsNotNull(name) To make sure that name do not store null. Is there a way to instrument to not generate such checks? Maybe an annotation? We…
Combo
  • 855
  • 2
  • 11
  • 22
8
votes
1 answer

NoClassDefFoundError: javax/ws/rs/client/ClientBuilder

I'm trying to creat a very simple Rest Client. I,m using: Netbeans 8 maven project dependecies: javax.ws.rs javax.ws.rs-api
7
votes
2 answers

How to properly report an error to client through WebSockets

How do I properly close a websocket and and provide a clean, informative response to the client when an internal error occurs on my server? In my current case, the client must provide a parameter when it connects, and I am trying to handle incorrect…
Saturn5
  • 108
  • 1
  • 7
6
votes
2 answers

SpringBoot Keycloak NoSuchMethodError: javax.ws.rs.core.UriBuilder.resolveTemplates

I probably have an issue with my POM in my SpringBoot App. Currently I am trying to access my Keycloak Server with the "admin-client-keycloak" But on the call: Response response = getInstance().realm(REALM).users().create(user); I get…
Gregor Sklorz
  • 1,645
  • 2
  • 19
  • 27
5
votes
1 answer

javax Validator recursive validation by default

I have two classes where one is nested in the other. I'd like to deserialize and validate incoming JSON against this structure of mine. I have a javax Validator obtained by Validator validator =…
LIvanov
  • 1,126
  • 12
  • 30
5
votes
3 answers

Kotlin and javax.validation.constraints.NotNull

Kotlin compiler inserts @Nullable and @NotNull from org.jetbrains.annotations, is it possible to insert also javax.validation.constraints.NotNull ?
Romper
  • 2,009
  • 3
  • 24
  • 43
5
votes
2 answers

SAXNotRecognizedException While Unmarshalling XML Input Stream

I'm running into this exception while trying to unmarshall an input stream of XML data. This is apparently a problem with the Xerces library, but I'm having a hard time figuring out a solution to this. I'm running a Java EE program with…
gdawgrancid
  • 640
  • 3
  • 15
  • 37
5
votes
2 answers

Entity class has no primary key specified

I have an entity class which inherits from four level of inheritance in which the top level parent defines the primary key (@Id) and I'm having trouble figuring out what I did wrong as I get this error: Entity class [class D] has no primary key…
5
votes
2 answers

ClassNotFoundException: how to find dependency conflict in Java

In a test WebSocket application using Atmosphere servlet I'm getting the following exception: SEVERE: Servlet.service() for servlet AtmosphereServlet threw exception java.lang.ClassNotFoundException: javax.servlet.AsyncContext at…
Alexey
  • 1,521
  • 1
  • 13
  • 24
4
votes
2 answers

ScriptEngine JavaScript Doesn't Support Includes?

I've got some code like the following. ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName("nashorn"); engine.eval("[1, 2, 3].includes(1)"); But that throws the following…
Coat
  • 697
  • 7
  • 18
1
2 3
11 12