FAQ Database Discussion Community


WSDL doesn't contain complex types definition

java-ee,soap,jax-ws,java-ee-6
I'm currently developing a jax-ws service in javaEE. Everything is working correctly, I was able to generate soapUI tests. But when I access the wsdl in the url it doesn't show the complex type definitions. Sample code as follows: @WebService public interface AccountWs { @WebMethod ActionStatus createCustomer(@WebParam(name = "customer") CustomerDto...

AWS Java SDK on JBoss AS7 - module.xml entries

maven,amazon-web-services,jboss,jboss7.x,java-ee-6
I am having problems using the new AmazonAWS SDK in a JBoss AS 7.1 (EE6) project I am just using the S3 library, so in accordance with the new release (1.9.7) I am only using the s3, core, kms jars -aws-java-sdk-core-1.9.17.jar -aws-java-sdk-s3-1.9.17.jar -aws-java-sdk-kms-1.9.17.jar So I have created 3 separate module.xml...

java ResourceBundle.getBundle() undeterministic

java,classloader,java-ee-6
I have a very, very strange situation happening on our Java EE app running on WebSphere. EAR --someJar.jar ----config/propfile.properties --WAR ----WEB-INF ------classes --------config/propfile.properties When the application start up, ResourceBundle.getBundle("config/propfile.properties") seems to read someProperty from the WAR/WEB-INF/classes/config/propfile.properties. However, after the app is up and running, ResourceBundle.getBundle("config/propfile.properties") seems to read someProperty from...

Flyway migration on deployment: Illegal call to close() detected

java,deployment,java-ee-6,glassfish-3,flyway
We're building a Java EE 6 .ear application running on GlassFish (3.1.2.2b5) and use Flyway (3.2.1) to manage our database schema. This happens on deployment of the .ear - There's an article on the web called "Easy Database Migrations using Flyway, Java EE 6 and GlassFish" which nicely outlines how...

Precedence of EJB Deployment Descriptors

java-ee-6,ejb-3.1,websphere-8,deployment-descriptor
If I have an EJB packaged in a WAR because it is exposed as a REST web service, according to this link, I need to have the ejb-*.xml files at the root of the WEB-INF directory. My current environment is Websphere 8.5 and EJB 3.1 If I later add multiple...

JAX-RS @FormParam one time for all methods

java,web-services,java-ee,jax-rs,java-ee-6
I am developing Java "JAX-RS" Web Services for books and contents. There will be 100s of URLs something similar ... https://api.example.com/v1.3/book1/chapter/1 https://api.example.com/v1.3/book1/chapter/2 ... https://api.example.com/v1.3/book1/chapterN To fetch the chapter content user needed to POST authToken, which I validate in server and return content or error. The sample code ... @Path("/book1") public...

EjbConetxt setRollbackOnly vs ApplicationException rollback true

java,transactions,java-ee-6
I have a method which throws an application exception with rollback true. I wonder if I have to explicitly call ejbContext.setRollbackOnly() or not? The docs here says that we need not call the EjbContext's setRollbackOnly when the exception is marked as rollback=true. In my case I catch a ApplicationException whose...

Spring Security with Java EE 6 Restful Service

spring,java-ee,spring-security,java-ee-6,spring-security-oauth2
I have created a JavaEE 6 Restful service and now willing to integrate it with SpringSecurity. But, I really don't want to use SpringMVC and keep the library dependencies as least as possible. But, whenever I create a web.xml file and include a filter into that <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class> org.springframework.web.filter.DelegatingFilterProxy...

What are the techniques to manage “session” or invocation context for Stateless EJBs during Remote calls?

session,java-ee,ejb,rmi,java-ee-6
I am writing an application that uses RMI to invoke EJBs. The EJBs are Stateless; the business requirements do not require conversational state with the client. One of the parameters to the EJB method calls is a "User" object used to determine if the user associated with the call has...

@Specializes for EJB

ejb,cdi,java-ee-6
I'm trying to specialize an EJB. I have package com.foo.core; @Stateless public class MyFacade { } and package com.foo.extension; @Specializes @Stateless public class MyFacade extends com.foo.core.MyFacade { } In my opinion, this should work, because the meaning of @Specializes is, that CDI should forget about the core-class and instead use...

Why when i call my class into a javabean the java reflection dosn't work?

java,java-ee,reflection,javabeans,java-ee-6
I try to show all my packages names with java reflection and it work perfectly when i test with a main method: The methode to get all packages names whitch is in a class named test1.java: public Set<String> findAllPackages(String packagebase) { List<ClassLoader> classLoadersList = new LinkedList<ClassLoader>(); classLoadersList.add(ClasspathHelper.contextClassLoader()); classLoadersList.add(ClasspathHelper.staticClassLoader()); Reflections reflections...

Database manipulation in Java EE

java,java-ee-6,java-ee-7
I know the usual way of connecting Java application to to the database using the following code: Class.forName("com.mysql.jdbc.Driver"); DriverManager .getConnection("jdbc:mysql://localhost/......."); How about in Java EE? Is there a new approach in database manipulation or should I use the same code above?...

404 Error while deploying simple web-app in JBoss AS 6 and JBoss AS 7?

rest,jboss,ejb,jboss7.x,java-ee-6
I followed this blog for injecting EJB in REST layer. Here is the code that I tried deploying in JBOSS AS 6 and 7 using Eclipse: REST: package com.example.rest; import javax.ejb.EJB; import javax.ejb.Stateless; import javax.ws.rs.GET; import javax.ws.rs.Path; @Stateless @Path("current") public class ServiceFacade { @EJB ServiceImpl service; @GET public String getDate(){...

@ResourceDependency with string query

jsf,resources,java-ee-6,jsf-2.2,mojarra
I want to implement cache busting via string query with the file version, but I also want to use @ResourceDependency. So this is what I have: @ResourceDependency(name = "scrypt.js?v=version", library = "mylib", target = "head") I know mojarra had trouble with string queries before for the <f:outputScript>, but this has...

Implementing WebSocket in Java Swing Application

java,websocket,java-ee-6,java-ee-7
I created a small java swing application and I want to use WebSocket for the transferring of data from the server to the client. Can someone give me a step by step instructions on how to do it? I'm using JBoss application server.

Spring Security with Java EE Restful Service

spring,rest,spring-security,java-ee-6,spring-security-oauth2
I have created a Java EE 6 restfull service and tried to integrate that with Spring Security. But, all the time I get different weird exceptions. Which doesn't make any sense or may be make sense but at least not for me. Direction structure of my application is something like...

Spring dependency injection using setter method?

java,spring,java-ee-6
I have below classes. public class SomeBeanClass implements SomeInterface{ private IAccountHistory acctHistory; public void setAccountHistory(IAccountHistory acctHistory) { this.acctHistory = acctHistory; } } public interface IAccountHistory{ //some methods } public class AccountHistory implements IAccountHistory{ //some logic } Spring configuration: <bean name="someBean" class="com.mypack.SomeBeanClass"> <property name="AccountHistory"> <bean class="com.mypack.AccountHistory"/> </property> </bean> In above spring...

(Jboss 5) Annotated Message Driven beans not detected/deployed in War file

java-ee,jboss,java-ee-6,jboss5.x
Got the following annotated mdb which works when deployed as a jar(even without the ejb.jar.xml) into Jboss but doesn't work when deployed within a war, mdbs seem to be ignored.I have an existing project which is a war and would like to just inject as is today as the mdb...