jndi

Logback can't find all applications running on weblogic using insertFromJNDI

回眸只為那壹抹淺笑 提交于 2019-12-12 06:17:42
问题 I'm having a real struggle finding out whats wrong. I have a weblogic 10.3.5.0 server where I have deployed three apps. One yui app and two custom java-apps. These are located on a test server. The apps are working fine when you use them, but only yui is logging (logback 1.1.2). I have a identical app deployed locally where everything works as intended. I use inserFromJNDI in logback.xml and it loads: <?xml version="1.0" encoding="UTF-8"?> <configuration scan="true"> <insertFromJNDI env-entry

How to test DAO with DataSource in Java Web Application?

五迷三道 提交于 2019-12-12 05:25:52
问题 I'm doing my project using Tomcat 7 , JSP , Servlets , Log4j and MySQL . I've googled this question for hours with no proper answer. How can I test my DAO's using DataSource and JUnit ? I found this article recently, but don't know how to configure it for my purposes and don't sure if it's a good way of doing it. I'm having the following DAO hierarchy: And I'm obtaining the DataSource in AbstractRepository in the following way: ... protected final DataSource ds; ... public AbstractRepository(

JDBC error when connecting Tomcat 5.5 to SQL 2008: What am I missing?

邮差的信 提交于 2019-12-12 04:39:54
问题 I'm attempting to connect a Tomcat 5.5 instance on my workstation (running with Eclipse) to a SQL Express instance on my workstation, and I'm having some connection issues. I'm getting this exception: Cannot create JDBC driver of class '' for connect URL 'null' Here's my META-INF/context.xml: <Context> <Resource name="jdbc/SQLDB" auth="Container" type="javax.sql.DataSource" username="AppUser" password="password" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc

NameNotFoundException in Container Managed EntityManager

江枫思渺然 提交于 2019-12-12 03:38:42
问题 I am trying to use Container Managed EntityManager, however I am getting NameNotFoundException. I have tried adding entries in web.xml but in vain. @Stateless @Path("/mypath") public class EmployeeService { @EJB private EmployeeDAO employeeDAO; @GET @Path("/myresults") @Produces(MediaType.APPLICATION_JSON) public Employee getValues() { Employee emp = new Employee(); try { emp = employeeDAO.getEmployees(); // exception here } catch (Exception ex) { ex.printStackTrace(); } return emp; }

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

Cannot lookup EJB bean from remote server

限于喜欢 提交于 2019-12-11 23:56:30
问题 I have Jboss 7 server and SSL is enabled for remote connection and JNDI property as below java.naming.security.principal=admin, server=10.10.10.10 java.naming.security.credentials=1111 java.naming.provider.url=remote://10.10.10.10:4447 java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false jboss.naming.client.remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=true

How to use JNDI with the tc server and postgresql in STS? (Unable to create initial connections of pool.)

核能气质少年 提交于 2019-12-11 22:13:50
问题 I want to use JPA/JNDI, as my experience with Netbeans and Glassfish has been that I could configure database settings at the server and so I'd be able to publish to different servers without changing anything in the code or configuration. I don't really get what's wrong and paste my configuration here in the hope that you can help me with some advice. I successfully tried to get a database connection with this persistence unit: <persistence-unit name="primefaces-showcase" transaction-type=

Configuring a JTA datasource for JBoss 8 (WildFly)

蓝咒 提交于 2019-12-11 20:42:38
问题 So, I read several times that if you use a Java EE container, you do not need to add environment params to an InitialContext in order to be able to use JNDI. So I tried this: @Bean public DataSource dataSource() { JndiDataSourceLookup jndiDataSourceLookup = new JndiDataSourceLookup(); return jndiDataSourceLookup.getDataSource("java:global/ExpensesDataSource"); } However, retrieving a datasource using JNDI like this gives me a NoInitialContextException , telling me to specify the environment

How can I bind lookup with a String

十年热恋 提交于 2019-12-11 19:03:18
问题 My Program is package client; import homeif.HelloWorldHome; import remoteif.HelloWorld; import javax.naming.Context; import javax.naming.InitialContext; import javax.rmi.PortableRemoteObject; import java.awt.image.LookupOp; import java.util.Properties; public class HelloClient { public static void main(String args[]) { try { Context initialContext = new InitialContext(); Object object = initialContext.lookup("myHelloWorld"); HelloWorldHome home = (HelloWorldHome) PortableRemoteObject.narrow

Java JNDI API User cannot authenticate to ADs with multi-forests setup

做~自己de王妃 提交于 2019-12-11 17:48:25
问题 In my testing env, I have setup two active directory forests A and B, each has one domain controller and the forests have two way trust setup. I have users - userA in forestA and userB in forestB. I have used adfind.exe to test if both userA and userB can authenticate by hitting the forestA endpoint, like .\AdFind.exe -h -u userA@forestA.com -up .\AdFind.exe -h -u userB@forestA.com -up Both users can authenticate through forestA as expected, as they have two way trust setup. However, userB