jndi

How to configure JNDI Realm with Tomcat 7 for PKI User Certificate Authentication?

依然范特西╮ 提交于 2019-12-08 06:52:58
问题 List, I have actually searched extensively on this topic and either a) I don't know how to configure something and/or b) I don't quite understand what a JNDI Realm actually is supposed to do. I am using Tomcat 7.0.32 with jdk 1.7.0_15. Here is what I want to do. I work with customers that use PKI User Certificates. The user certificates have a cn like "Joe Smith". What I need to be able to do is look up this CN in LDAP and get the users id, which may be something like "jsmith23", and populate

How to Create Data Source without Pooling in Tomcat

≯℡__Kan透↙ 提交于 2019-12-08 06:32:53
问题 I use JNDI context to create datasource for JDBC drivers in Tomcat's context.xml file like this, <Resource name="db/test" type="javax.sql.DataSource" driverClassName="com.test.jdbc.Driver" url="jdbc:fastdb://localhost:3306/session_db?autoReconnect=true&connectTimeout=5000&socketTimeout=5000" zeroDateTimeBehavior="convertToNull" username="dbuser" password="password" maxActive="100" maxWait="2" removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true" /> By default, Tomcat will use

Spring Boot - JNDI value lookup

≡放荡痞女 提交于 2019-12-08 06:17:34
问题 @SpringBootApplication public class SampleTomcatJndiApplication { public static void main(String[] args) { SpringApplication.run(SampleTomcatJndiApplication.class, args); } @Bean public TomcatEmbeddedServletContainerFactory tomcatFactory() { return new TomcatEmbeddedServletContainerFactory() { @Override protected TomcatEmbeddedServletContainer getTomcatEmbeddedServletContainer( Tomcat tomcat) { tomcat.enableNaming(); return super.getTomcatEmbeddedServletContainer(tomcat); } @Override

could not load class persistentBag

泪湿孤枕 提交于 2019-12-08 03:49:17
问题 I have a class below and I load this object from the DB but when I call this method through with JNDI address, give some error about kullainiciGrups attribute which is a java.util.List , if this attribute removed, it works without exception. Stack trace is below the code block; What do you think about this persistenceBag exception? Thanks. package enlil.domain; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; import java.util.List; import javax.persistence

Connecting JMS to MQ using MQClient java and MQExplorer error JMSWMQ2013

青春壹個敷衍的年華 提交于 2019-12-08 03:43:31
问题 I am using MQexplorer to handle queue manager, and when I connect to MQ using JMS with JNDI lookup, using qcf.createQueueConnection(); I am getting JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager error. All posts/blogs mention about this error, but they say to remove CHAUTH for queuemanager and so on... How do I work this out using MQExplorer? Please help me on this! I am using MQ client(with JNDI on LDAP) connection which can connect remote machine

EJB lookup from Play application

一笑奈何 提交于 2019-12-08 03:41:56
问题 I have a Play application (I am using Play 2.1.0) from which I would like to invoke EJBs running on a GlassFish server. Therefore, I have tried adding gf-client.jar as a dependency in my Play application and getting a reference to the EJBs the same way I would do in a standalone application: Hashtable<String, String> properties = new Hashtable<String, String>(); properties.put("java.naming.factory.initial", "com.sun.enterprise.naming.impl.SerialInitContextFactory"); properties.put("java

JPA Desktop application

半世苍凉 提交于 2019-12-08 02:37:56
问题 I am developing a Java SWING application using JPA, I got much experience with JPA with Java EE, But in this case i want to modify 'persistence.xml' values in running time. this can be done in Java EE using JNDI on application server, but in swing application I didn't found any solution for that note: persistence.xml contains following properties <properties> <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/adlbprod?zeroDateTimeBehavior=convertToNull"/> <property

Java DNSLookup get DNS attributes

筅森魡賤 提交于 2019-12-08 02:08:26
问题 I'm quite new to the network DNS records and need a program that can run lookup to get 3 main DNS records of a domain (A,MX,NS). I have been looking for a java solution here an there and my final class is as below: However, I will always get a NameException and can't find the reason for it. [EDIT]: The problem seem to be with our internet, because using other wifi, the program run just fine. Many thanks, import javax.naming.directory.Attributes; import javax.naming.directory.DirContext;

Can I use JPA by specifing the database during runtime?

眉间皱痕 提交于 2019-12-08 00:29:25
问题 I use MySQL on my production server, where every customer has its own database and its own database user to connect to his database. Each database has the exact same structure. Customers (and therefore databases) are added during the lifetime of the server. Currently I establish a MySQL database connection with the class java.sql.DriverManager , which works just fine. The databases url, user, password and driver name are stored in several properties-files. The servlet reads the properties

How connect to WildFly 10.1.0.Final ActiveMQ Artemis using JNDI and Spring?

僤鯓⒐⒋嵵緔 提交于 2019-12-07 19:14:16
问题 I have WildFly 10.1.0.Final, this have Artemis 1.1.0 Whats the correct way of configure jndi.properties?: java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory java.naming.provider.url=http-remoting://127.0.0.1:8080 jboss.naming.client.ejb.context=false This worket with WildFly 9.0.0.Final that have HornetQ: java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory java.naming.provider.url=http-remoting://127.0.0.1:8080 jboss.naming