java-ee-6

Lazy loading exception when using JSF Converter (refering to a collection)

廉价感情. 提交于 2019-12-05 18:34:26
This is my first post after many research on this problem. This example is running under Jboss 7.1 with seam 3.1 (solder + persistence + faces) with seam managed persistence context I'm facing a problem, the classical failed to lazily initialize a collection, no session or session was closed: org.hibernate.LazyInitializationException: failed to lazily initialize a collection, no session or session was closed when using a converter on Entity beans. The aim is to stay 100% Object oriented, by reusing the JPA model. in beans.xml, org.jboss.seam.transaction.TransactionInterceptor is activated

EJB 3.1 | Error calling remote session bean via JNDI

风格不统一 提交于 2019-12-05 18:25:48
I'm trying to call a simple stateless session bean from a Java SE (Simple class). Here's my bean import javax.ejb.Stateless; /** * * @author MMRUser */ @Stateless public class CapitalBean implements CapitalBeanRemote { public String greetingsEjb(String name) { return "Hello " + name; } } Remote interface import javax.ejb.Remote; /** * * @author MMRUser */ @Remote public interface CapitalBeanRemote { public String greetingsEjb(String name); } From my client side I used stand-alone java class to call the session bean using JNDI as follows import ejb.CapitalBeanRemote; import javax.naming.Context

How will I send messages to Activemq

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 17:42:08
I never work on JMS . Recently I downloaded Activemq and changed port no from 61616 to 61617 in all conf/activemq-*.xml files.I run the following command from command prompt and open console page on browser. C:\Users\Infratab Bangalore\Desktop\Queueing\apache-activemq-5.8.0\bin>activemq Now I want to send messages from java code using JMS to Activemq .For this I wrote the following code. And run my code using Apache Tomcat server.it's not working This code is implemented in Eclipse. package PackageName; import java.io.IOException; import javax.jms.Connection; import javax.jms.ConnectionFactory

@javax.persistence.Column( updatable=false )

痴心易碎 提交于 2019-12-05 14:10:21
If I define a field as non-updatable, does that mean that the field can't be updated at all, ever? What I'd like to do is prevent the field from getting updated when I save an entire entity object, but still be able to write queries that explicitly update this field. Is this possible? I'm using Hibernate and MySQL, but I'd prefer to write portable code. As documented , setting updatable=false affects only SQL UPDATE statements generated by persistence provider: Whether the column is included in SQL UPDATE statements generated by the persistence provider. You are still able to write such an SQL

Disable @WebFilter (embedded in dependency jar)

▼魔方 西西 提交于 2019-12-05 14:06:30
Is there a way to disable a embedded Servlet Filter? My project has a dependency jar that contains (inside the jar) a @WebFilter mapped to "/*" . I need the jar (it has a lot of commons class of my company), but this new project does not need this WebFilter, actually this new project will not work because this Filter checks user authentication and the new project has no "loggedUser". It's like a website Thanks web.xml takes precedence over annotations for precisely this reason. Simply declare the offending filter in web.xml the good old way and set its <filter-mapping> to something bogus, eg:

Rest Filter : registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime

柔情痞子 提交于 2019-12-05 13:41:50
I am getting an error : A provider com.xyx.in.astra.aqr.security.application.requestFilter.UniversalSessionManagerFilter registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider com.xyx.in.astra.aqr.security.application.requestFilter.UniversalSessionManagerFilter will be ignored. NOTE : 1) This UniversalSessionManagerFilter filter is in external jar file which is in the server classpath 2) I am using @Provider annotation on the filter and @Priority annotation to define priority 3) This is

jax-b xml inverse reference with many to many relationship

江枫思渺然 提交于 2019-12-05 13:34:17
I have a few many to many relationships in my data model. I have been trying to use JAX=B to get XML representations of the data models, however I have read that for one to many relationships an: @XmlInverseReference is needed for the inverse side of the mapping. I believe this is for using different fetch types (ie. LAZY and EAGER). I am unsure of exactly how this annotation works. Does it use back pointers to ensure that data is not fetched when it is specified on certain fields? I also do not know if I need to annotate my many to many relationship with the above annotation or not. Here is

Controlling CDI Startup inside EJB 3.1

半腔热情 提交于 2019-12-05 09:55:10
I'm new in here and also new to the CDI world, and the first task I got in my job was to find out a way to controlled CDI uploading. We are using both EJB 3.1 and CDI 1.0 , and because they are controlled by different containers, we can control when and in what order the EJB Managed Beans will be up by using @Startup and @Singleton annotations. But the @Inject CDI bean I have declared in my class is coming as null since the CDI Container hasn't started yet. I have been trying for several days now to look up for solutions and the one I found here did not worked (still came as null). We are

What is the difference between mappedName and lookup attributes of @Resource annotation in EJB?

会有一股神秘感。 提交于 2019-12-05 07:32:47
I'm confused between two attributes of @Resource annotation. Java Documentations says : mappedName : A product specific name that this resource should be mapped to. The name of this resource, as defined by the name element or defaulted, is a name that is local to the application component using the resource. (It's a name in the JNDI java:comp/env namespace.) Many application servers provide a way to map these local names to names of resources known to the application server. This mapped name is often a global JNDI name, but may be a name of any form. lookup : The name of the resource that the

@RequestScoped CDI injection into @MessageDriven bean

Deadly 提交于 2019-12-05 06:33:25
If I have a request scoped CDI bean injected into a @MessageDriven EJB using JMS, as below, can I assume that any given Foo instance will only be used by a single onMessage invocation at a time? In other words, in the below example, can I safely use member variables in the Foo object to store state across subroutines, analogously to a JSF @RequestScoped managed bean? Note that it's ok if the same Foo object gets recycled sequentially from one onMessage call to the next, as long as each MessageDrivenBean instance has its own Foo instance such that two requests processing concurrently would be