java-ee

WildFly management - list/detect REST endpoints deployed in WildFly

℡╲_俬逩灬. 提交于 2020-01-01 08:54:59
问题 Is there a way (e.g. from a WildFly management console) to list all REST endpoints deployed in WildFly? Or to list them in a log while a server is starting? 回答1: Using the RegistryStatsResource With RESTEasy (that is shipped with WildFly), you could add the following to your web.xml : <context-param> <param-name>resteasy.resources</param-name> <param-value>org.jboss.resteasy.plugins.stats.RegistryStatsResource</param-value> </context-param> And then request the following URL: http://[hostname

WildFly management - list/detect REST endpoints deployed in WildFly

ε祈祈猫儿з 提交于 2020-01-01 08:54:03
问题 Is there a way (e.g. from a WildFly management console) to list all REST endpoints deployed in WildFly? Or to list them in a log while a server is starting? 回答1: Using the RegistryStatsResource With RESTEasy (that is shipped with WildFly), you could add the following to your web.xml : <context-param> <param-name>resteasy.resources</param-name> <param-value>org.jboss.resteasy.plugins.stats.RegistryStatsResource</param-value> </context-param> And then request the following URL: http://[hostname

Why throwing an EJBException is a “recommended” practice?

こ雲淡風輕ζ 提交于 2020-01-01 08:43:52
问题 I keep getting this "suggestion" from many fellow developers over and over again. In my experience I've found that EJBExceptions are well-suited for "end of the world" from the bean instance perspective (like when something is so wrong that the bean instance cannot recover by itself). If an instance can recover, I think it's better to throw an application exception. Here is the pattern that I meet over and over again: private SomeResource resource; ejbCreate: resource = allocateResource(...);

How to set a parameter for a Java Web application

一个人想着一个人 提交于 2020-01-01 08:35:11
问题 I have a web app in Java, which uses some external program (invokes a command line tool). I want to make the path of the command line program configurable, so that I can change it without re-building my application. Questions: 1) Which exactly parameter should I use (out of those available in web.xml), if it is set only once (at deployment) and thereafter never changes? 2) How can I access this parameter inside my Java code? Thanks in advance Dmitri 回答1: web.xml <?xml version="1.0" encoding=

JDBC, JNDI Problem with tomcat 6.0.26

拈花ヽ惹草 提交于 2020-01-01 06:56:10
问题 Greetings, I am developing a webapp that requires setting up a DataSource with JNDI using Enterprise JDBC Classes.I am using the Netbeans 6.9 bundled tomcat (6.0.26 app) server with mysql 5.xx.The issue really is that I can still see the database values from a relation being displayed in my jsp page whereas during the tomcat initialization it says something like this: . . SEVERE: Servlet.service() for servlet jsp threw exception java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp

Under what circumstances does Java performance degrade with more memory?

微笑、不失礼 提交于 2020-01-01 06:11:24
问题 We're load testing a Java 1.6 application in our DEV environment. The JVM heap allocation is 2Gb, -Xms2048m -Xmx2048m. Under load testing, the app runs smooth, never uses more than 1.25Gb of heap, and garbage collection is totally normal. In our UAT environment, we run the load test with the same parameters, the only difference is the JVM, it's allocated 4Gb, -Xms4096m -Xmx4096m, otherwise, the hardware is exactly the same with DEV. But during load testing, the performance is horrendous, the

Under what circumstances does Java performance degrade with more memory?

99封情书 提交于 2020-01-01 06:11:01
问题 We're load testing a Java 1.6 application in our DEV environment. The JVM heap allocation is 2Gb, -Xms2048m -Xmx2048m. Under load testing, the app runs smooth, never uses more than 1.25Gb of heap, and garbage collection is totally normal. In our UAT environment, we run the load test with the same parameters, the only difference is the JVM, it's allocated 4Gb, -Xms4096m -Xmx4096m, otherwise, the hardware is exactly the same with DEV. But during load testing, the performance is horrendous, the

Is it possible to use container-managed authentication with password salting?

夙愿已清 提交于 2020-01-01 05:42:06
问题 I know how to set up vanilla container-managed security that uses form authentication and uses digested passwords (say, SHA-256). Something like this: web.xml <login-config> <auth-method>FORM</auth-method> <realm-name>jdbc</realm-name> <form-login-config> <form-login-page>/login.jsf</form-login-page> <form-error-page>/login-error.jsf</form-error-page> </form-login-config> </login-config> login.xhtml <form action="j_security_check"> <p><label> Username:<br/> <input type="text" name="j_username

How do I obtain a new stateful session bean in a servlet thread?

我的梦境 提交于 2020-01-01 05:35:07
问题 I'm experimenting with EJB3 I would like to inject a stateful session bean into a servlet, so that each user that hits the servlet would obtain a new bean. Obviously, I can't let the bean be an instance variable for the servlet, as that will be shared. And apparantly injecting local variables isn't allowed. I can use the new operator to create a bean, but that doesn't seem the right approach. Is there a right way to do this? It seems like what I'm trying to do is fairly straightforward, after

Gradle: Could not find method provided()

血红的双手。 提交于 2020-01-01 05:15:30
问题 Which is preferred, provided or provided group and where is this documented? thufir@doge:~/NetBeansProjects/gradleEAR$ thufir@doge:~/NetBeansProjects/gradleEAR$ gradle clean FAILURE: Build failed with an exception. * Where: Build file '/home/thufir/NetBeansProjects/gradleEAR/build.gradle' line: 40 * What went wrong: A problem occurred evaluating root project 'gradleEAR'. > Could not find method provided() for arguments [javax:javaee-api:7.0] on object of type org.gradle.api.internal.artifacts