jndi

NoInitialContextException

北慕城南 提交于 2019-12-08 11:39:28
问题 I have a problem. I want to connect to database using JDBC, I have Tomcat server. For this I use connection pool. According to Internet tutorials I've written: context.xml: <?xml version="1.0" encoding="UTF-8"?> <Context antiJARLocking="true" path="/Server" docBase="dbcp" debug="5" reloadable="true" crossContext="true"> <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource" removeAbandoned="true" removeAbandonedTimeout="30" maxActive="100" maxIdle="30" maxWait="10000"

How to get the Client ip address in an EJB3 Interceptor?

陌路散爱 提交于 2019-12-08 11:01:55
问题 Often it's useful for Auditing or security purposes to get the IP Address of the client making a remote EJB3 Call. This information is not readily available in the Context of an EJB3 Bean. Here's a hack to be able to achieve this in JBoss 4.x. 回答1: There is an answer on this page https://community.jboss.org/wiki/HowToGetTheClientIpAddressInAnEJB3Interceptor?_sscc=t Basically it uses the thread name to obtain the ip address as each call is launched in its own thread... 来源: https:/

Correct way to lookup local EJB in websphere - Getting ClassCastException

匆匆过客 提交于 2019-12-08 10:52:08
问题 I have an EJB which is exposed by both local and remote interfaces package com.sam.enqueue; import javax.ejb.Local; import javax.ejb.Remote; import javax.ejb.Singleton; @Singleton @Local(SamEnqueueLocal.class) @Remote(SamEnqueueRemote.class) public class SamEnqueue implements SamEnqueueRemote, SamEnqueueLocal { } // remote interface package com.sam.enqueue; import javax.ejb.Remote; @Remote public interface SamEnqueueRemote { } // local interface package com.sam.enqueue; @Local public

how to correctly configure jndi data source in tomcat 8

只愿长相守 提交于 2019-12-08 10:15:48
问题 I try to configure a jsbc data source for my app within -tomcat_home-\conf\Catalina\localhost My app is "reportExport".war so i created reportExport.xml with this content: <Context> <Resource name="jdbc/mssql" auth="Container" type="javax.sql.DataSource" username="user" password="pass" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://localhost:52015;databaseName=rewe;integratedSecurity=false;" maxActive="20" maxIdle="10" validationQuery="select 1" /> <

Target DataSource dynamically in Weblogic, JMX or another options

China☆狼群 提交于 2019-12-08 10:00:45
问题 As i mentioned in title ;we need to target datasources to their related wepapp on weblogic. After some googling i could find handling datasources defined before and deployed .war apps on the server . But i want to match them. I edited the tutorials below i linked ,according to my need . But the last and important part is matching datasource with my applications . Is there any alternative way or a tutorial you can point me ? Getting datasource properties Finding available .war file on path and

javax.naming.NameNotFoundException: Name [jdbc/mydb] is not bound in this Context

匆匆过客 提交于 2019-12-08 09:14:21
问题 I know this question has been asked several times. I found some links here and here as an example of what I found. But I try their solutions and my problem is not solved yet... So I copy what I have: A J2EE project in Eclipse. I built a new .war to install in an application server I created a Tomcat 7 Server in Eclipse and added my .war to it to deploy it locally So phisically in my project I have a .war project and the Servers project that auto-creates when you create a new Server in Eclipse

Acessing Remote/Local Session Beans

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 08:02:13
问题 I'm trying to connect to a session bean. I tried many different ways that I found with Google, but I always get the same error because my JNDI lookup always returns NULL. Here's the error: java.lang.NullPointerException at org.apache.jsp.index_jsp._jspService(index_jsp.java:85) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)

Tomcat: use FTP connection via JNDI [closed]

吃可爱长大的小学妹 提交于 2019-12-08 07:55:12
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I need to access an FTP server from my Web Application which runs on Tomcat 6. I want to use JNDI to do this. How can I configure this FTP connection in Tomcat using JNDI? What do I have to write into web.xml and context.xml to configure the resource? And how can I then access this connection from the Java

camel - get jndi registry

和自甴很熟 提交于 2019-12-08 07:41:10
问题 I'm using apache camel, and I will be needing the jndi registry so that I can bind an object to it. How do I retrieve a JNDI registry from a RouteBuilder class? Can I also bind using xml? Thanks! 回答1: I was able to do it not within the RouteBuilder but before adding context to the camelMain . JndiRegistry registry = new JndiRegistry(); ... registry.bind("myAntFilter", filter); DefaultCamelContext context = new DefaultCamelContext(registry); camelMain.getCamelContexts().add(context); It is

EJB3 Client Lookup

和自甴很熟 提交于 2019-12-08 07:37:30
问题 I am trying to invoke a EJB from a standalone Java client, getting the below error. Lookup code String localJNDIName = "ejbremote:gcmsnew/gcmsutilbeans.jar/CustomerSurveyManageQstBean#com.smbcgroup.gcms.utility.bl.survey.CustomerSurveyManageQstRemote"; InitialContext ic = new InitialContext(); GCMSBaseRemote bean = (GCMSBaseRemote)ic.lookup(localJNDIName); Exception javax.naming.ConfigurationException: NamingManager.getURLContext cannot find the factory for this scheme: ejbremote at com.ibm