java-ee

How to secure a web service with ssl

谁说我不能喝 提交于 2019-12-12 21:09:02
问题 I an building a Java EE application with Netbeans 7.3.2 using Javafx as a client to be served by web services from the EJB. I want to add SSL to secure the web services communication with the client over the network. I tried to add security to the web services but getting the following errors SEVERE: WSS1601: Security Requirements not met - Transport binding configured in policy but incoming message was not SSL enabled SEVERE: WSITPVD0035: Error in Verifying Security in Inbound Message. com

EJB 3.1 Problems with JNDI Stand-Alone Application with GlassFish 4

◇◆丶佛笑我妖孽 提交于 2019-12-12 20:35:17
问题 I'm having a problem with the JNDI section of a stand-alone test application. I have the gf-client.jar and the jndi-properties.jar file on the class path. I made sure that the latest version was deployed on the glassfish server before running the client as well. Stand-Alone Application: public class Main { /** * @param args the command line arguments */ public static void main(String[] args) throws NamingException { Context context = new InitialContext(); TestBeanRemote bean = (TestBeanRemote

JSF a4j:commandButton not working when 'disabled' is set

余生颓废 提交于 2019-12-12 20:25:49
问题 When I include a 'disabled' attribute on an a4j:commandButton, the button's action is not performed. Taking the 'disabled' attribute out causes it to work properly. I am not doing any special validation (that I'm aware of) and am not seeing any validation error messages. Here is part of my page: <t:dataTable id="myTable" var="region" value="#{MyPageBackingBean.regions}" width="100%"> ... <a4j:commandButton value="Update" action="#{region.doUpdate}" oncomplete="alert('done');" disabled="#{

Struts2: Malformed OGNL expression

倾然丶 夕夏残阳落幕 提交于 2019-12-12 20:00:20
问题 In my JSPs, I'm using a plugin named TagEdit, It has to have an input text field with " name='tag[]' " like below: <s:form theme="simple" action="myActionn" method="post"> <s:textfield theme="simple" name="tag[]" value="" cssClass="tag"/> <sj:submit targets="actionMessageResult"/> </s:form> But when I submit it, struts2 throws this exception: WARNING: Error setting expression 'tag[]' with value '[Ljava.lang.String;@6c2a78' ognl.ExpressionSyntaxException: Malformed OGNL expression: tag[] [ognl

EJB3 stateful concurrent calls from different clients

流过昼夜 提交于 2019-12-12 19:15:47
问题 I have a rich client swing application calling a remote stateful ejb. I'm using JBoss 6.0. I have deployed the client in two different machines, i.e, different ip address, jvms, etc. The stateful has the following code: @Stateful public class MyStateful implements MyStatefulRemote{ public void test(){ System.out.println(this); System.out.println(Thread.currentThread()); System.out.println(Thread.currentThread().getThreadGroup()); // cpu intensive task String value = ""; for (int j = 0; j <

How to define Remote EJBs Beans in Spring using annotation-based configuration (ie: JavaConfig)

半城伤御伤魂 提交于 2019-12-12 19:13:17
问题 I'm trying to figure out the best way to define Remote EJB 3 beans in Spring 4.x using JavaConfig (annotation-based configuration). I've looked at the Spring Docs for <jee:remote-slsb> and have hacked together a functional configuration, but it is terrible: @Bean public LoginManager getLoginManager(){ SimpleRemoteStatelessSessionProxyFactoryBean factory = new SimpleRemoteStatelessSessionProxyFactoryBean(); String beanName = "jndi.ejb3.LoginManager"; factory.setJndiName(beanName); factory

Serialize the whole class as a String field instead of a JSON Object

寵の児 提交于 2019-12-12 18:43:26
问题 I have an object that uses a class instance as a wrapper for the String type. How would I serialize my class into a JSON object using JAX-RS and Java EE 6 by using only the toString() method without creating a JSON object for the class and each fields? Class to be serialized: public class Text { private String content; protected Text( String content ) { this.content = content; } public static Text from( String content ) { return new Text( "The text content"); } // This is a method that is

JAX-WS servlet filter exceptions

不羁的心 提交于 2019-12-12 18:23:09
问题 I have a client/server application that communicates via SOAP. The server-side application is a Java EE app that exposes web services using JAX-WS. I have a servlet filter setup to perform certain checks before a service is invoked. This is all working pretty well, except for exception handling. If I throw an exception from the filter, it gets returned to the client as a generic server exception. I need to find a way to propagate a custom exception containing a specific message, so the client

JPA: How to count child records without loading a lazy loaded set

大憨熊 提交于 2019-12-12 18:19:56
问题 I'm writing a J2EE/JPA/Spring 3 application, trying to stay pure JPA 2.0. I want to get a count of child objects without having to load them, as it's obviously an expensive operation. For example here's a simplified example Organisation - OrgID - OrgName Employee - EmployeeID - OrgID (key to Organisation table) - EmployeeName On a jsp page I want to show the list of all organisations and a count of the number of employees without loading the employees themselves. If it can be a single

Giving security priviliege to a scheduler in Java EE 6

旧城冷巷雨未停 提交于 2019-12-12 18:11:46
问题 I'm building a web application in Java EE 6 which is deployed to JBoss AS 7.1 I am using security at beans level (using @RolesAllowed({ "useradmin", "usernormal" }) annotation) and at the front end level (securing xthtm pages int the web.xml). The authentication is done in JBoss, using its user management or LDAP (just a config change in the standalone.xml). The whole security framework is working perfectly, even too well if dare say... Problem I also have a scheduler using the Java EE