java-ee

status update not working

你。 提交于 2019-12-12 03:35:31
问题 When I am clicking the Speak Out(p:commandButton) to submit a status, I am getting the following exception. The exception is caused by commentList() function by the line Query query = em.createQuery( "SELECT c FROM Comment c WHERE c.statusId=" + statusId, Comment.class); 1)Home.xhtml <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"

Deploying java applications (Tomcat/Glassfish)

人走茶凉 提交于 2019-12-12 03:34:28
问题 We are currently working on a project for college which we would like to implement as a logic module and UI module. We have little experience deploying web applications, however we came up with the following alternatives: Deploy it as a single WAR project (which would solve the problem we have about communicating the UI with the backend of our application). Deploy two WAR projects in the same server using webservices for communication between the projects. (We have a prototype using this

Works without maven profile, bug with

﹥>﹥吖頭↗ 提交于 2019-12-12 03:34:10
问题 Here is my problem, So here is my profile in pom.xml : <profiles> <profile> <id>dev</id> <activation> <property> <name>environment</name> <value>dev</value> </property> </activation> </profile> <profile> <id>prod</id> <activation> <property> <name>environment</name> <value>prod</value> </property> </activation> </profile> </profiles> When I use this context.xml, my application works perfectly : <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans"

tomcat and extracted files

一个人想着一个人 提交于 2019-12-12 03:32:39
问题 I am using ubuntu with packaged tomcate7 . I used .war file to upload the website. the web is working fine. This is not my website but its there: :/var/lib/tomcat7/webapps/ROOT$ ls index.html META-INF I find my site files (those in .war) at /var/cache/tomcat7/Catalina/localhost/_/org/apache/jsp/ /var/cache/tomcat7/Catalina/localhost/_/WEB-INF/classes/ I do not find any of my .css or .js files with a system wide search like find / -name '*.css' -ls where are they?! Is there an easy way to just

How to disable Timer service in Wildfly 10?

佐手、 提交于 2019-12-12 03:29:53
问题 In my Java EE application I have a @Singleton with several @Schedule d methods. When I deploy the app on Wildfly, the Timer service starts executing these methods, which is correct. Since during development I test my app on a secondary server, I'd like to disable the Timer service on that instance of Wildfly, to prevent the execution of those methods. Problem is… I can't find any setting to do this. How can I disable the Timer service in Wildfly 10? 回答1: Try to remove block timer-service in

JSON output of JavaEE Entity with TomEE server

心不动则不痛 提交于 2019-12-12 03:28:40
问题 I try to make output of my Entity Flight, which have OneToOne relationship with my other Entity Airplane. Before I add airplaneDetail field in my Flight Entity the result was perfect, but I after that I get empty result and Eclipse start throwing exceptions in gson. My Flight class : @Entity @NamedQueries({ @NamedQuery(name = "Flight.getAll", query = "SELECT f FROM Flight f"), }) @NamedQuery(name = "Flight.getByDestination", query = "SELECT f FROM Flight f WHERE f.destinationFrom=

how to look up an EJB in a test class but interfaces are in other maven project?

好久不见. 提交于 2019-12-12 03:25:38
问题 I work on the test of a EJB project with TestNG and by using JBoss-Embedded-EJB and I have my interfaces on another separated project and implementations sound on the project on the which I make the tests and the Entities are of their part on another project. So i have tree projects: oap-Entities oap-Interfaces (contains all my interfaces) oap-Impli (contains all the implementations of oap-interfaces project) All these projects are mavenzed. I try to use jboss-embedded for testing by TestNG

Change the upload directory path for an ice:inputFile component

允我心安 提交于 2019-12-12 03:15:11
问题 I've noticed that the ice:inputFile component will only upload files to the directory $TOMCAT_HOME/webapps/MyAppName/upload/. I want this directory to be dependent on the user initials for the current user (i.e. user with initials abc wants to upload a file, the file goes to $TOMCAT_HOME/webapps/MyAppName/upload/abc/). How can I dynamically set this attribute? 回答1: As indicated in the reference guide http://www.icefaces.org/docs/v1_8_2/htmlguide/devguide/references5.html web.xml file: To

How to create a CLI like Spring Shell in Java EE application without spring framework?

こ雲淡風輕ζ 提交于 2019-12-12 03:08:26
问题 I used Spring shell in my project, which works very well. Now we have a Java EE project on the JBoss application server. I would like to have a good CLI, just like the Spring shell. How can this be done? 回答1: As far as I understand your request, Spring Shell is not meant for this. Spring Shell is somewhat tied to running in an actual terminal, leveraging JLine. Another implementation could be written (similar to the "running in IDE" approach) that scans for MethodTargets and runs them, taking

Execute service method periodically

强颜欢笑 提交于 2019-12-12 02:55:41
问题 So, I have a service: @Stateless public void SomeService { public void someAction() { ... } } And I have a config file timer.properties which contains following string: refresh.interval=1234 The question is to find how to automatically execute someAction() every 1234 seconds? I tried @Schedule , but it works only with constants. The application must read value from config (already implemented with @Startup.. @PostConstruct bean method) and set this value as execution interval for someMethod()