java-ee-5

@Cache annotation usage error

白昼怎懂夜的黑 提交于 2019-12-12 09:35:17
问题 I added the following annotation to enable cache to one of my EJB3 entities, to test caching with ehCache, where I use Hibernate as the persistence provider: .... import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; @Entity @Table(name = "F") @Cache(usage=CacheConcurrencyStrategy.READ_WRITE) @NamedQueries({ @NamedQuery(name = "F.findAll", query = "SELECT f FROM F f")}) public class F implements Serializable { ..... } I added the following to

“Not Found (404)” error in restlet

◇◆丶佛笑我妖孽 提交于 2019-12-11 23:27:18
问题 i am new to restlet framework. i have created a small java ee application but it give me an error "Not Found (404)" public class MailServerApplication extends Application { @Override public Restlet createInboundRoot() { Router router = new Router(getContext()); router.attach("http://localhost:8084/accounts/{accountId}/mails/{mailId}", MailServerResource.class); return router; } } //////////////////////////////// public class MailServerResource extends ServerResource { @Override protected

Can't execute embedded Glassfish App at Apple platform

岁酱吖の 提交于 2019-12-11 09:42:30
问题 I'm having a problem running an JEE5 application at GF 3.1 Embedded at Apple computers... (the same environment works at Linux and Windows). The server starts ok, but when loading the APP the server returns a SEVERE message... My deployment is basically the glassfish-embedded-web-3.1.jar file, the configured domain with app inside, and a start class. The output can be seen here: http://pastebin.com/ypeV3jm3; and the lines 44 and 48 show the error messages. At linux/windows platform (where it

Jsf DataModel vs Java List problem ( no row available exception )

假如想象 提交于 2019-12-10 16:22:53
问题 In JSF 1.2 One was listing Items using Java List : private List<Customer> customerItems = null; , but in JSF 2.0 JSf DataModel (ListDataModel) is the way to go. (I am using JSF 2.0) private DataModel customerItems = null; public abstract DataModel createPageDataModel(); However, I still don't get how to efficiently work with it. Rather say, I can't even implement a simple and mandatory case which is, navigation. I have a <h:datatable value="#{customerController}" var="customer"> that gets its

JSF Datamodel & JPA parent to leaves navigation. How to?

夙愿已清 提交于 2019-12-10 12:08:04
问题 My web application is a CRUD web application based on JSF 2.0 / JPA using Java EE 5 and JDK 1.6. Running on Glassfish 3.1. The IDE is Netbeans 7.0. (I do not use EJB, nor CDI). THE PROBLEM What I can achieve now is perform CRUD on my entities. Which is fine. For each entity I have: List.xhtml (LIsting all Datamodel items for that entity in datatable) Create.xhtml (A form to create a new item) View.xhtml (a form to view an item) Edit.xhtml (a form to edit an item) Structure entities package:

Interface between two related JPA entities

ぐ巨炮叔叔 提交于 2019-12-09 22:17:42
问题 The scenario is as below (tables shown) Delivery table ------ id channelId type 10 100 fax 20 200 email Fax table ---- id number 100 1234567 101 1234598 Email table ----- id email 200 a@a.com 201 b@b.com basically a one to one relationship between the delivery and the channel entity but since each concrete channel(fax, email) has different members I want to create a generic interface (channel) between the two entities and use it for the @OneToOne relationship. Seems to me a simple scenario

java.lang.NoClassDefFoundError: HttpSessionListener

天大地大妈咪最大 提交于 2019-12-06 12:27:58
I am trying to deploy a war that i didnt write and i am getting this error in my logs: java.lang.NoClassDefFoundError: HttpSessionListener i know that HttpSessionListener lives in servlet-api.jar which is found in the lib dir of tomcat(my app server). I tried including servlet-api.jar in the war's WEB-INF/lib folder, but the logs yelled at me for doing that: INFO: validateJarFile(/home/test/apache-tomcat-6.0.18/webapps/test/WEB-INF/lib/servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class the internets claim that you dont have to

EJB3 and manual hierarchy persistence

我只是一个虾纸丫 提交于 2019-12-04 14:46:02
问题 I have a legacy database, which I am using EJB3 to model. The database is in quite a poor shape, and we have certain unusual restrictions on how we insert into the DB. Now I want to model the database in a hierarchy that fits in with the DB strucuture, but I want to be able to manually insert each entity individually without the persistence manager trying to persist the entities children. I am trying something like the following (boilerplate left out): @Entity @Table(name = "PARENT_TABLE")

Real world comparisons of Glassfish and JBoss 5?

女生的网名这么多〃 提交于 2019-12-04 08:04:00
问题 Does anyone have experiences with both in the real world? How do they compare in terms of performance (memory usage, speed, etc)? Stability? Does JBoss Seam work well on Glassfish? 回答1: A number of things from my own experience: GlassFish has much better administration console (JBoss has three consoles, each of them far from being ideal). Hot deployment is more reliable on GlassFish JMS works better on GlassFish - this applies to GF vs. JBoss 4.X. As far as I see the JMS implementation was

how to implement a cache in ejb 3.0?

孤者浪人 提交于 2019-12-03 16:37:43
I have a customer who's stuck in an EJB 3.0 environment. No @Singleton, no bean-managed concurrency :-( Considering thread management and synchronization is forbidden by the ejb specification, how to implement a cache? In essence, I want an non-synchronized object cache for some costly operations. The restriction of using static field and synchronization is stated in EJB 3.0 spec chapter 21.1.2. It also explains why. • An enterprise bean must not use read/write static fields. Using read-only static fields is allowed. Therefore, it is recommended that all static fields in the enterprise bean class