Tag: java ee

JavaFx:在应用程序执行不同方法时,与消息异步更新UI标签

我正在尝试使用应用程序的各种状态消息异步更新JavaFx GUI中的标签。 例如 我的Application中的按钮“更新”调用控制器中的方法updateSettings()。 现在我尝试以下列方式更新UI上的标签。 @FXML private void updateSettings() { label.text(“message1”); //some action lable.text(“action done”); label.text(“calling method.. wait for some time”) // call to time consuming method – timeConsumingMethod(); label.text label.text(“operation completely successfully”); } private void timeConsumingMethod() { label.text(“message2”); //some actions label.text(“message3”); //more time consuming actions label.text(“time consuming method is done with success”); } 我希望在流程执行时这些消息应该显示在标签中,以向用户显示应用程序中正在进行的各种活动。 […]

Quartz – 在一周和几天的某一天每两周安排一次工作

我需要创建Job,它将: 2012年12月20日开始 endDate = 12/31/2017 将在周日和周一每两周举行一次 下午5点开火。 这个cron表达式有效吗? Date start = 12/20/2012; Date endDate = 12/31/2017; SimpleTrigger trigger = newTrigger() .withIdentity(“trigger3”, “group1”) .startAt(startDate) .withSchedule(cronSchedule(“* * 17 0 0/2 *,SUN,MON”).build()) .endAt(endDate) .build; 请指教。

Java EE服务器上的动态角色

我想在专用的应用程序中管理用户和角色。 例如,该应用程序的用户(“customerX boss”)可以创建新角色“customerX employee”。 如果员工访问Java EE应用程序服务器(GlassFish 3),他应该获得“customerX employee”角色。 这听起来很简单,但Java EE不支持它,因为组在启动时映射到角色,而应用程序中的角色是静态的。 在Java EE(6)环境中在运行时管理用户角色的最佳方法是什么?

在我的spring项目中,ServletDispatcher无法强制转换为Javax.servlet.Servletexception

在启动tomcat服务器时,我得到一个例外 SEVERE: Servlet /MavenWeb threw load() exception java.lang.ClassCastException: org.springframework.web.servlet.DispatcherServlet cannot be cast to javax.servlet.Servlet 我正在使用spring3,但我的lib文件夹中有jar spring2-5-6,我从pom.xml中删除它但仍然出现在lib文件夹中 – 虽然我不确定这是否是一个问题。 我正在使用Eclipse IDE。 谢谢!! org.hibernate.javax.persistence hibernate-jpa-2.1-api 1.0.0.Draft-6 compile org.hibernate hibernate-annotations 3.5.6-Final compile org.springframework spring-beans 3.1.2.RELEASE compile org.springframework spring-context 3.1.2.RELEASE compile org.springframework spring-web 3.1.2.RELEASE compile org.springframework spring-tx 3.1.2.RELEASE compile org.springframework spring-webmvc 3.1.2.RELEASE compile javax.servlet javax.servlet-api 3.1-b01 compile org.springframework spring-webflow […]

没有定义名为’transactionManager’的bean

我已经配置了两个持久性单元,实体管理器设置如下: 然后我将事务管理器配置为 我最初只配置了一个,它被称为“transactionManager”。 Addint一个额外的持久单元似乎会产生错误。 有一点我不明白,如果我配置了两个持久单元(每个单独的数据库),我是否还需要为每个数据源配置一个单独的实体管理器和一个事务管理器? 我得到的错误如下所示:(我搜索了所有文件,我找不到任何有“transactionManager”参考的地方) org.springframework.ws.soap.client.SoapFaultClientException: No bean named ‘transactionManager’ is defined at org.springframework.ws.soap.client.core.SoapFaultMessageResolver.resolveFault(SoapFaultMessageResolver.java:37) at org.springframework.ws.client.core.WebServiceTemplate.handleFault(WebServiceTemplate.java:774) at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:600) at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:537) at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:384) at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:378) at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:370) at com.ws.client.SoapTest.testFail(SoapTest.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83) at […]

是什么导致org.hibernate.PropertyAccessException:setter中发生exception

是什么导致这个例外,我无法找到答案。 Request processing failed; nested exception is javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: Exception occurred inside setter of my.Class 根本原因: javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: Exception occurred inside setter of my.Class 码: @ManyToMany(fetch = FetchType.EAGER) public void setTags(Set tags) { this.tags.clear(); for (Tag tag : tags) { addTag(tag); } } public boolean addTag(final Tag tag) { if (tags.contains(tag)) { return false; } […]

如何正确地将JSP放在WEB-INF文件夹中?

我的问题是如何以正确的方式将所有JSP文件放在WEB-INF/JSP/中? 是否有任何配置,因为我知道的结构是: WEB-INF / JSP –> all jsp is reside in that folder / CLASSES — all classes is reside that folder / LIB –> library file reside in that folder 如何根据规格正确设置。 请帮我解决这个问题。

例外:com.sun.jersey.spi.inject.Errors $ ErrorMessagesException

我正在使用Jersey API进行Web服务。 我正在从客户端向服务器发送多部分数据。 Web服务开始执行时,我遇到exception。 @POST @Path(“uploadphoto”) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(“text/plain”) public String uploadNotices(@FormDataParam(“file”) InputStream uploadedInputStream, @FormDataParam(“file”) FormDataContentDisposition fileDetail) { String uploadedFileLocation = “d:/” + fileDetail.getFileName(); // save it try { writeToFile(uploadedInputStream, uploadedFileLocation); } catch(Exception e) { return “no”; } return “yes”; } // save uploaded file to new location private void writeToFile(InputStream uploadedInputStream, String uploadedFileLocation) throws Exception […]

在Datatable JSF中显示Set集合中的对象不起作用

任何原因如Set objects = new HashSet(); 不应该在JSF Datatable中工作? 它适用于List。

Java EE 6:目标无法访问,标识符’helloBean’已解析为null

我想尝试一个简单的JSF 2教程示例。 我在Eclipse中使用动态Web项目并发布到Glassfish 3服务器(运行 – >在服务器上运行)。 第一个index.xhtml页面正确加载,但是当我必须访问托管bean时,会显示以下错误: /index.xhtml @14,48 value=”#{helloBean.name}”: Target Unreachable, identifier ‘helloBean’ resolved to null 我已经看过关于这个主题的各种其他讨论,但是解决方案对我来说似乎永远不会起作用(例如,添加beans.xml,根据命名约定给托管bean命名等)。 任何帮助,将不胜感激。 这是我目前正在使用的代码: 的index.xhtml JSF 2.0 Hello World JSF 2.0 Hello World Example – hello.xhtml response.xhtml: JSF 2.0 Hello World JSF 2.0 Hello World Example – welcome.xhtml Welcome #{helloBean.name} 管理豆: package java.hello1; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import java.io.Serializable; […]