java-ee

Join data from 2 Oracle tables located in different database on the same server using JDBC

前提是你 提交于 2019-12-13 08:53:54
问题 I have one simple table in one Oracle database that needs to be joined with a group of tables in another Oracle database. They reside on the same server (different ports). I am using JDBC and want to keep it simple. I could connect to both DBs and join the result sets in Java. But I am wondering if there is a better/easier way. I cannot easily use new tools or frameworks since I work in the rigid corporate environment, so want to know if it can be accomplished with just JDBC. 回答1: No way to

Update select one menu from another page [duplicate]

守給你的承諾、 提交于 2019-12-13 08:49:34
问题 This question already has answers here : How to find out client ID of component for ajax update/render? Cannot find component with expression “foo” referenced from “bar” (5 answers) Closed 4 years ago . I need to update a select menu of one another JSF page. I've tried all ways and always occurs the component not found error This my xhtml page: <?xml version='1.0' encoding='ISO-8859-1' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1

How to present a list of categories stored in database in JSF correctly

ぃ、小莉子 提交于 2019-12-13 08:36:59
问题 I am making an application where I am going to register questions. Each question has a relationship with one or more categories so I need a way in the register question form to select which categories it belongs to. I am thinking of using one of the selectMany... components from JSF for the task. I could retrieve the list of all categories in the database (only 9) and then bind that list to a f:selectItems component. Then the itemValue of each selectItem must be the id of the category. I will

A child container failed during start

穿精又带淫゛_ 提交于 2019-12-13 08:29:34
问题 I am getting below error; SEVERE: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SimpleJDBCRealms]] at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source) at java.util.concurrent.FutureTask.get(Unknown Source) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123) at org.apache.catalina.core

IntelliJ not updating Glassfish Deployment

妖精的绣舞 提交于 2019-12-13 08:10:52
问题 IntelliJ is acting odd with its redeployment settings. In the "updating applications" tab it has on the bottom for debugging: , I have tried to use all of the update options in order to update my application (update classes, update classes resources, restart), and NONE work to update my server. I have even closed and rebooted IntelliJ and the updates still don't appear. The update is a simple alert message that is triggered when the index.html is loaded. It works when I load the html manually

OSGi: javax.annotation conflict: Java SE vs Java EE

微笑、不失礼 提交于 2019-12-13 07:35:47
问题 In a Java SE OSGi (Apache Felix) environment, I'm trying to integrate CDI using PAX CDI and Weld 2.2.6.Final. I'm currently getting the following error: ERROR: Bundle org.jboss.weld.osgi-bundle [45] Error starting file:///someDir/org/jboss/weld/weld-osgi-bundle/2.2.6.Final/weld-osgi-bundle-2.2.6.Final.jar (org.osgi.framework.BundleException: Uses constraint violation. Unable to resolve bundle revision org.jboss.weld.osgi-bundle [45.0] because it is exposed to package 'javax.annotation' from

Initialization parameters for EJB

ぃ、小莉子 提交于 2019-12-13 07:32:43
问题 I have Singleton enterprise bean, which starts immediately after deploy. I packed EJB into jar and want to distribute it. I set several fields of Singleton like private final String initParam = "value"; . How can I expose those init parameters to administrator who will be deploy my jar onto his own GlassFish server? 回答1: You can use Environment Entries, these should fit your needs. Such parameters must be described in ejb-jar.xml: <enterprise-beans> <session> <ejb-name>YourBean</ejb-name>

Observable pattern in Remote EJB

孤人 提交于 2019-12-13 07:29:51
问题 I have 2 applications. One 'main' and a second one with a Remote EJB. The first application calls the Remote EJB in the second one. Now I want to implement the Observable pattern. But it doesn't seem to work cross-application. So I want my Observable inside the second application, and my Observers in the first. When I try it, it doesn't seem to work. It only works if I make the Observable and Observers in the same application. I got another solution, but I think it's dirty. I could use a MDB

Disable logging of Exception in Bean

戏子无情 提交于 2019-12-13 07:23:46
问题 I'm using Wildfly 10 and JAX-RS (resteasy) and have a Bean being injected in another Bean: @Path("foo") public class FooResource { @Inject BarBean bar; ... } Then I'm calling a method on bar that throws a RuntimeException. I'm handling this Exception in FooResource , but Wildfly has interceptors that print the stack trace to the log. I don't want this to happen. Is there any way to disable this behavior? 回答1: I could only reproduce this when the @Inject ed bean was a EJB (with Wildfly-9). You

Must close browser to get authentication data in PostConstruct method

纵饮孤独 提交于 2019-12-13 07:22:47
问题 I am trying to cache the authentication information in a SessionScoped managed bean. When I open a browser and login into the server (the browser asks me for username/password) the first time, it works as it should. The trouble comes when I restart the webapp or the server (it is a development setup). Then, accessing the webapp from one of the browser where I had previously logged in, causes that in my @PostConstruct method, FacesContext.getCurrentInstance().getExternalContext()