java-ee

How do I create an EAR file with an ant build including certain files?

穿精又带淫゛_ 提交于 2019-12-17 22:16:46
问题 I'm using eclipse to build an ear file using ant. I'm using oc4j, and I want to make sure that orion-application.xml is included in the build. What I'm currently using but does not work is: <target name="ear" depends=""> <echo>Building the ear file</echo> <copy todir="${build.dir}/META-INF"> <fileset dir="${conf.dir}" includes="orion-application.xml"/> </copy> <ear destfile="${dist.dir}/${ant.project.name}.ear" appxml="${conf.dir}/application.xml"> <fileset dir="${dist.dir}" includes="*.jar,*

How to catch and wrap exceptions thrown by JTA when a container-managed-tx EJB commits?

隐身守侯 提交于 2019-12-17 22:09:44
问题 I'm struggling with a problem with an EJB3 class that manages a non-trivial data model. I have constraint validation exceptions being thrown when my container-managed transactional methods commit. I want to prevent them from being wrapped in EJBException , instead throwing a sane application exception that callers can handle. To wrap it in a suitable application exception, I must be able to catch it. Most of the time a simple try/catch does the job because the validation exception is thrown

JavaFX primaryStage remove windows borders? [duplicate]

隐身守侯 提交于 2019-12-17 21:53:51
问题 This question already has an answer here : JavaFX: Undecorated Window (1 answer) Closed 5 years ago . I am making JavaFX destop application. I want to remove the default windows border and also I want to customize the 3 standard icons of minimize , maximize and close. The original motivation of this kind of looks or customization is new Kaspersky 2012 User Interface.... I want to design something like that... :) 回答1: This example might be a good starting point. All window decoration is

What's the difference between ActivationSpec and ConnectionFactory?

时光怂恿深爱的人放手 提交于 2019-12-17 21:51:50
问题 My understanding is that: MD B s (Message Driven Beans) connect via Activation Specification. MD P s (Message Driven POJO) connect via Connection Factory. This diagram from IBM is helpful: To me, this explanation from IBM does not shed much light on the difference: Connection factory -- used by the application to get connections to the messaging bus. Queue -- used by the application to send and receive messages. Activation specification -- used by the application's message-driven bean to

Java Web Application: How to implement caching techniques?

前提是你 提交于 2019-12-17 21:48:31
问题 I am developing a Java web application that bases it behavior through large XML configuration files that are loaded from a web service. As these files are not actually required until a particular section of the application is accessed, they are loaded lazily. When one of these files are required, a query is sent to the webservice to retrieve the corresponding file. As some of the configuration files are likely to be used much, much more often than others I'd like to setup some kind of caching

Auto generate data schema from JPA annotated entity classes

孤人 提交于 2019-12-17 21:46:58
问题 I'm using JPA (Hibernate's implementation) to annotate entity classes to persist to a relational database (MySQL or SQL Server). Is there an easy way to auto generate the database schema (table creation scripts) from the annotated classes? I'm still in the prototyping phase and anticipate frequent schema changes. I would like to be able to specify and change the data model from the annotated code. Grails is similar in that it generates the database from the domain classes. 回答1: You can use

An internal error occurred during: “Updating Maven Project”. java.lang.NullPointerException

自作多情 提交于 2019-12-17 21:43:43
问题 I'm developing a Java EE web project. When I try to add a dependency, this error message appears. I use Eclipse Kepler. An internal error occurred during: "Updating Maven Project". java.lang.NullPointerException Could you help me? Thank you. 回答1: I solved mine by deleting the .settings folder and .project file in the project and then reimporting the project. 回答2: For me worked the answer I found on CodeRanch, by user Maneesh Godbole : Close eclipse. Navigate to your "workspace" folder Ensure

EclipseLink “create-or-extend-tables” not working: “…unknown column…”

自闭症网瘾萝莉.ら 提交于 2019-12-17 21:23:52
问题 I am using EclipseLink 2.4.1 with Glassfish and a MySQL database for persisting entities. I added a field to an entity, and when I try to persist this entity it says the new field is 'unknown'. How are we supposed to use the new 'create-or-extend-tables' feature? I would have thought it would create a new column for this field. Some relevant information is below, let me know if you want more. Thanks in advance! Stack Trace ... Caused by: Exception [EclipseLink-4002] (Eclipse Persistence

eclipse vs tomcat deployment - exported war (partially) fails while the project runs in eclipse

冷暖自知 提交于 2019-12-17 21:08:19
问题 I have a webapp in eclipse juno - when I hit Run on server runs fine - either inside eclipse's browser (I am on windows) or in FF. Right click > export war > dump this into $CATALINA_HOME/webapps > all is working fine (got unpacked alright) EXCEPT my custom tags - I had a WEB-INF\functions.tld file which is apparently not read. The only difference between the auto-generated eclipse server.xml (in Servers project) and the default Tomcat server.xml was the line : <Context docBase="ted2012" path

How to define the stream Result annotation?

和自甴很熟 提交于 2019-12-17 20:59:26
问题 I need to export the excel sheet, so calling action class method through Ajax call from dialog window. I have excel icon when I click the icon calling method and processing the backend data and finally going to execute the below code and return to result set to download the excel sheet. jQuery Ajax calling: function callajax() { jQuery.ajax({ url : '<s:url action="part" method="export"/>', Result set method: @Result(name="success",type=StreamResult.class,value="",params={"inputName",