Search Results

Search found 288 results on 12 pages for 'jndi'.

Page 1/12 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • A Cautionary Tale About Multi-Source JNDI Configuration

    - by scott.s.nelson(at)oracle.com
    Here's a bit of fun with WebLogic JDBC configurations.  I ran into this issue after reading that p13nDataSource and cgDataSource-NonXA should not be configured as multi-source. There were some issues changing them to use the basic JDBC connection string and when rolling back to the bad configuration the server went "Boom".  Since one purpose behind this blog is to share lessons learned, I just had to post this. If you write your descriptors manually (as opposed to generating them using the WLS console) and put a comma-separated list of JNDI addresses like this: <jdbc-data-source-params> <jndi-name>weblogic.jdbc.jts.commercePool,contentDataSource, contentVersioningDataSource,portalFrameworkPool</jndi-name> <algorithm-type>Load-Balancing</algorithm-type> <data-source-list>portalDataSource-rac0,portalDataSource-rac1</data-source-list> <failover-request-if-busy>false</failover-request-if-busy> </jdbc-data-source-params> so long as the first address resolves, it will still work. Sort of.  If you call this connection to do an update, only one node of the RAC instance is updated. Other wonderful side-effects include the server refusing to start sometimes. The proper way to list the JNDI sources is one per node, like this: <jdbc-data-source-params> <jndi-name>weblogic.jdbc.jts.commercePool</jndi-name> <jndi-name>contentDataSource</jndi-name> <jndi-name>contentVersioningDataSource</jndi-name> <jndi-name>portalFrameworkPool</jndi-name> <algorithm-type>Load-Balancing</algorithm-type> <data-source-list>portalDataSource-rac0, portalDataSource-rac1, portalDataSource-rac2 </data-source-list> <failover-request-if-busy>false</failover-request-if-busy> </jdbc-data-source-params>(Props to Sandeep Seshan for locating the root cause)

    Read the article

  • problem configure JBoss to work with JNDI(2)

    - by Spiderman
    in continuation to the question from last week: http://stackoverflow.com/questions/2828237/problem-configure-jboss-to-work-with-jndi I'm trying to bind datasource in JBoss and use it in my application. In my struggling, I already managed to avoid the javax.naming.NameNotFoundException by: 1. using in java new InitialContext().lookup(connection); instead of new JndiObjectFactoryBean().setJndiName(connection); 2. changing the connection name from: 'jndi-name' to 'java:jndi-name' Now the problem is that the datasouce that I get from the lookup is null. I created the datsource file: <datasources> <local-tx-datasource> <jndi-name>bilby</jndi-name> <connection-url>jdbc:oracle:myURL</connection-url> <driver-class>oracle.jdbc.OracleDriver </driver-class> <user-name>myUsername</user-name> <password>myPassword</password> <exception-sorter-class- name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name> <metadata> <type-mapping>Oracle9i</type-mapping> </metadata> </local-tx-datasource> </datasources> and put it under \server\default\deploy\oracle-ds.xml I get during runtime the line: 18:37:56,560 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jb oss.jca:service=DataSourceBinding,name=bilby' to JNDI name 'java:bilby' So my question is - why do I get null as my datasource???

    Read the article

  • JNDI classes needed!!

    - by artaxerxe
    I have instaled in my computer a JDK version 1.6. (I'm learning about JNDI) When i run this: Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"); try { // Create the initial context Context ctx = new InitialContext(env); //... i get an error : Caused by: java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory Caused by: java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory Does it means that i need some classes to include in my classpath? I read in the tutorial that versions of jdk recently than v 3 doesn't need to download other classes. Thank advance!

    Read the article

  • Java & Tomcat: SQL JDBC/JNDI Exceptions

    - by user267581
    I am deploying a webapp from eclipse to tomcat. I am having an issue with my application and JNDI lookups. When the app tries to load the JNDI resource I am this stacktrace: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: java.net.ConnectException: Connection refused: connect] at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:101) at javax.naming.InitialContext.lookup(InitialContext.java:396) at org.objectweb.carol.jndi.spi.AbsContext.lookup(AbsContext.java:134) at org.objectweb.carol.jndi.spi.AbsContext.lookup(AbsContext.java:144) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.objectweb.carol.jndi.spi.MultiContext.lookup(MultiContext.java:118) at javax.naming.InitialContext.lookup(InitialContext.java:392) at com.theriabook.daoflex.JDBCConnection.getDataSource(JDBCConnection.java:61) at com.theriabook.daoflex.JDBCConnection.getConnection(JDBCConnection.java:73) at com.aramark.data.UsersDAO.doLogin(UsersDAO.java:751) 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 flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:406) at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183) at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1417) at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:878) at com.farata.remoting.CustomAMFEndpoint.serviceMessage(CustomAMFEndpoint.java:23) at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:121) at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158) at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:49) at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67) at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146) at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:274) at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:377) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.cti.compiler.env.web.CompilerInvocationInterceptor.doFilter(CompilerInvocationInterceptor.java:25) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: java.net.ConnectException: Connection refused: connect at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184) at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322) at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source) at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:97) ... 41 more Caused by: java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:525) at java.net.Socket.connect(Socket.java:475) at java.net.Socket.<init>(Socket.java:372) at java.net.Socket.<init>(Socket.java:186) at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22) at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128) at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595) I am really stumped at this error. I am using a WinXP running on a Virtual Machine (VMWare) from a MAC. Any ideas? I have uninstalled/reinstalled tomcat multiple times.

    Read the article

  • JEE6 Global JNDI Name and Maven Deployment

    - by wobblycogs
    I'm having some problems with the global JNDI names of my EJB resources which is (or at least will) cause my JNDI look ups to fail. The project is being developed on Netbeans and is a standard Maven Web Application. When my application is deployed to GF3.0 the application name is set to something like: com.example_myapp_war_1.0-SNAPSHOT which is all well and good from Netbeans point of view because it ensures the name is unique but it also means all the EJBs get global names such as this: java:global/com.example_myapp_war_1.0-SNAPSHOT/CustomerService This, of course, is going to cause problems because every time the version changes all the global names change (I've tested this by changing the version and the names indeed changed). The name is being generated from the POM file and it's a concatenation of: <groupId>com.example</groupId> <artifactId>myapp</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> Up until now I've got away with just injecting all the resources using @EJB but now I need to access the CustomerService EJB from a JSF Converter so I'm doing a JNDI look up like this: try { Context ctx = new InitialContext(); CustomerService customerService = (CustomerService)ctx.lookup( "java:global/com.example_myapp_war_1.0-SNAPSHOT/CustomerService" ); return customerService.get(submittedValue); } catch( Exception e ) { logger.error( "Failed to convert customer.", e ); return null; } which will clearly break when the application is properly released and the module name changes. So, the million dollar question: how can I set the modle name in maven or how do I recover the module name so that I can programatically build the JNDI name at runtile. I've tried setting it in the web.xml file as suggested by that link but it was ignored. I think I'd rather build the name at runtime as that means there is less scope for screw ups when the application is deployed. Many thanks for any help, I've been tearing my hair out all day on this.

    Read the article

  • problem configure JBoss to work with JNDI

    - by Spiderman
    I am trying to bind connection to the DB using JNDI in my application that runs on JBoss. I did the following: I created the datasource file oracle-ds.xml filled it with the relevant xml elements: <datasources> <local-tx-datasource> <jndi-name>bilby</jndi-name> ... </local-tx-datasource> </datasources> and put it in the folder \server\default\deploy Added the relevant oracle jar file than in my application I performed: JndiObjectFactoryBean factory = new JndiObjectFactoryBean(); factory.setJndiName("bilby"); try{ factory.afterPropertiesSet(); dataSource = factory.getObject(); } catch(NamingException ne) { ne.printStackTrace(); } and this cause the error: javax.naming.NameNotFoundException: bilby not bound then in the output after this error occured I saw the line: 18:37:56,560 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jb oss.jca:service=DataSourceBinding,name=bilby' to JNDI name 'java:bilby' So what is my configuration problem? I think that it may be that JBoss first loads and runs the .war file of my application and only then it loads the oracle-ds.xml that contain my data-source definition. The problem is that they are both located in the same folder. Is there a way to define priority of loading them, or maybe this is not the problem at all. Any idea?

    Read the article

  • InvalidAttributeValueException when using non-ascii characters in JNDI

    - by matdan
    Hi, I have some trouble using JNDI since it accepts only 7-bits encoded parameters. I am trying to change an LDAP entry using JNDI with the following code : Attribute newattr = new BasicAttribute("userpassword", password); ModificationItem[] mods = new ModificationItem[1]; mods[0] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, newattr); context.modifyAttributes("uid=anID,ou=People,o=MyOrganisation,c=com", mods); If my password contains only ascii characters, it works perfectly, but if I use a non-ascii character, like "à", I have this error message : javax.naming.directory.InvalidAttributeValueException: [LDAP: error code 19 - The value is not 7-bit clean: à]; My ldap supports those characters so I guess it comes from JNDI. Does anyone know how to fix that? Am I supposed to convert my parameter? How can I do that easily? Thanks

    Read the article

  • Good learning resources for JNDI implementation (JBoss 5)

    - by iandisme
    I have been working with JavaEE/EJB3 web apps for about half a year now. Until recently, I haven't had to touch a lot of the behind-the-scenes stuff, just the meat of the code. I have been wrestling with JNDI problems, and though I've solved a couple of them, I'm pretty much just doing the whole cargo cult copy-paste routine. It would really help me to better understand JNDI; my understanding of it right now can be summarized as "it's that thing these classes sometimes do to find other classes." My question is, has anyone had success learning JNDI/EJB3/related topics from a book or online content? I've googled for it but the stuff that comes up is old or specific to a certain framework I'm not using. I'm looking for something that's either JBoss-specific or generic enough to be useful anyway.

    Read the article

  • Glassfish v3 / JNDI entry cannot be found problems!

    - by REMP
    I've been having problems trying to call an EJB's method from a Java Application Client. Here is the code. EJB Remote Interface package com.test; import javax.ejb.Remote; @Remote public interface HelloBeanRemote { public String sayHello(); } EJB package com.test; import javax.ejb.Stateless; @Stateless (name="HelloBeanExample" , mappedName="ejb/HelloBean") public class HelloBean implements HelloBeanRemote { @Override public String sayHello(){ return "hola"; } } Main class (another project) import com.test.HelloBeanRemote; import javax.naming.Context; import javax.naming.InitialContext; public class Main { public void runTest()throws Exception{ Context ctx = new InitialContext(); HelloBeanRemote bean = (HelloBeanRemote)ctx.lookup("java:global/Test/HelloBeanExample!com.test.HelloBeanRemote"); System.out.println(bean.sayHello()); } public static void main(String[] args)throws Exception { Main main = new Main(); main.runTest(); } } Well, what is my problem? JNDI entry for this EJB cannot be found! java.lang.NullPointerException at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(SerialContext.java:297) at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:271) at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:430) at javax.naming.InitialContext.lookup(InitialContext.java:392) at testdesktop.Main.runTest(Main.java:22) at testdesktop.Main.main(Main.java:31) Exception in thread "main" javax.naming.NamingException: Lookup failed for 'java:global/Test/HelloBeanExample!com.test.HelloBeanRemote' in SerialContext [Root exception is javax.naming.NamingException: Unable to acquire SerialContextProvider for SerialContext [Root exception is java.lang.NullPointerException]] at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442) at javax.naming.InitialContext.lookup(InitialContext.java:392) at testdesktop.Main.runTest(Main.java:22) at testdesktop.Main.main(Main.java:31) Caused by: javax.naming.NamingException: Unable to acquire SerialContextProvider for SerialContext [Root exception is java.lang.NullPointerException] at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:276) at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:430) ... 3 more Caused by: java.lang.NullPointerException at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(SerialContext.java:297) at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:271) ... 4 more Java Result: 1 I've trying with different JNDI entries but nothing works (I got this entries from NetBeans console): INFO: Portable JNDI names for EJB HelloBeanExample : [java:global/Test/HelloBeanExample, java:global/Test/HelloBeanExample!com.test.HelloBeanRemote] INFO: Glassfish-specific (Non-portable) JNDI names for EJB HelloBeanExample : [ejb/HelloBean, ejb/HelloBean#com.test.HelloBeanRemote] So I tried with the following entries but I got the same exception : java:global/Test/HelloBeanExample java:global/Test/HelloBeanExample!com.test.HelloBeanRemote ejb/HelloBean ejb/HelloBean#com.test.HelloBeanRemote I'm using Netbeans 6.8 and Glassfish v3!

    Read the article

  • EJB3 JNDI Lookup Failure in JEE application client

    - by Hank
    I'm trying to access an EJB3 from a JEE client-application, but keep getting nothing but lookup failures. My JEE Application 'CoreServer' is exposing a number of beans with remote interfaces. I have no problem accessing them from a Web Application deployed on the same Glassfish v3.0.1. Now I'm trying to access it from a client-application: public class Main { public static void main(String[] args) { CampaignControllerRemote bean = null; try { InitialContext ctx = new InitialContext(); bean = (CampaignControllerRemote) ctx.lookup("java:global/CoreServer/CampaignController"); } catch (Exception e) { System.out.println(e.getMessage()); } if (bean != null) { Campaign campaign = bean.get(361); if (campaign != null) { System.out.println("Got "+ campaign); } } } } When I run deploy it to Glassfish and run it from the appclient, I get this error: Lookup failed for 'java:global/CoreServer/CampaignController' in SerialContext targetHost=localhost,targetPort=3700,orb'sInitialHost=localhost,orb'sInitialPort=3700 However, that's exactly the same JNDI-name I use when I lookup the bean from the WebApplication (via SessionContext, not InitialContext - does that matter?). Also, when I deploy 'CoreServer', Glassfish reports: Portable JNDI names for EJB CampaignController : [java:global/CoreServer/CampaignController!mvs.api.CampaignControllerRemote, java:global/CoreServer/CampaignController] Glassfish-specific (Non-portable) JNDI names for EJB CampaignController : [mvs.api.CampaignControllerRemote, mvs.api.CampaignControllerRemote#mvs.api.CampaignControllerRemote] I tried all four names, none worked. Is the appclient unable to access beans with (only) Remote interfaces?

    Read the article

  • Common JNDI resources in Tomcat

    - by Lehane
    Hi, I’m running a couple of servlet applications in Tomcat (5.5). All of the servlets use a common factory resource that is shared out using JNDI. At the moment, I can get everything working by including the factory resource as a GlobalNamingResource in the /conf/server.xml file, and then having each servlet’s META-INF/context.xml file include a ResourceLink to the resource. Snippets from the XML files are included below. NOTE: I’m not that familiar with tomcat, so I’m not saying that this is a good configuration!!! However, I now want to be able install these servlets into multiple tomcat instances automatically using an RPM. The RPM will firstly copy the WARs to the webapps directory, and the jars for the factory into the common/lib directory (which is fine). But it will also need to make sure that the factory resource is included as a resource for all of the servlets. What is the best way add the resource globally? I’m not too keen on writing a script that goes into the server.xml file and adds in the resource that way. Is there any way for me to add in multiple server.xml files so that I can write a new server-app.xml file and it will concatenate my settings to server.xml? Or, better still to add this JNDI resource to all the servlets without using server.xml at all? p.s. Restarting the server will not be an issue, so I don’t mind if the changes don’t get picked up automatically. Thanks Snippet from server.xml <!-- Global JNDI resources --> <GlobalNamingResources> <Resource name="bean/MyFactory" auth="Container" type="com.somewhere.Connection" factory="com.somewhere.MyFactory"/> </GlobalNamingResources> The entire servlet’s META-INF/context.xml file <?xml version="1.0" encoding="UTF-8"?> <Context> <ResourceLink global="bean/MyFactory" name="bean/MyFactory" type="com.somewhere.MyFactory"/> </Context>

    Read the article

  • JMS without JNDI?

    - by dbg
    We are running portlets in WebSphere 6.01, using Java 1.4. We want to send JMS messages to a JBoss 5 queue, running Java 5 (or maybe 6, but it's certainly newer than 1.4). Trying to connect using JNDI is not working, since we have to include the JBoss client jars in the classpath of the portlet, and they are Java 1.5. So I get an unsupported major/minor error when I try to create the InitialContext. Can we connect straight to JBoss without using JNDI? Or is there some way to get around this issue I can't think of?

    Read the article

  • Where can I learn about JNDI strings?

    - by ferrari fan
    How do you know how to form a JNDI string? I know there must be a format and that the divisions must mean something but I haven't been able to find a good resource that explains them. For example: java:comp/env/wm/default. This is supposed to connect to a WorkManager in Websphere with the name of default. But what does the "java", "comp", "env" mean? I know what the wm/default mean because that's the JNDI name put in the WorkManager, but what does the rest mean? Thanks

    Read the article

  • Glassfish: Defining Custom JNDI Names for Session Beans

    - by Adeel Ansari
    Background: Want to use GF3 in development, where as actual SIT, UAT, and production is using WAS. Problem: With the remote session beans everything is good to go, as GF3 gives a non-standard JNDI name, which is same as what WAS suggests, i.e. an absolute class name. Now for the local session beans WAS use the same absolute class name but with the prefix, i.e. ejblocal:. Whereas GF3 doesn't give any non-standard JNDI name for local session beans. GF3 came up with only portable name, java:global/..I need to find a way so I can use the same names for both. I am using EJB 3.0, WAS 7.9, and Glassfish 3. Don't have any xml confiuration for ejbs. Using Spring to inject the bean in Struts2 actions. With remote interfaces both servers are okay and agreed on a single convention, but for locals they differ. Is there any solution for this? Or just sun-ejb-jar.xml will solve it? Thanks.

    Read the article

  • access JRUN jndi environment vaiables from coldfusion (java)

    - by jake
    I want to put some instance specific configuration information in JNDI. I looked at the information here: http://www.adobe.com/support/jrun/working_jrun/jrun4_jndi_and_j2ee_enc/jrun4_jndi_and_j2ee_enc03.html I have added this node to the web.xml: <env-entry> <description>Administrator e-mail address</description> <env-entry-name>adminemail</env-entry-name> <env-entry-value>[email protected]</env-entry-value> <env-entry-type>java.lang.String</env-entry-type> </env-entry> In coldfusion I have tried several different approaches to querying the data: <cfset ctx = createobject("java","javax.naming.InitialContext") > <cfset val = ctx.lookup("java:comp/env") > That lookup returns a jrun.naming.JRunNamingContext. If i preform a lookup on ctx for the specific binding I am adding I get an error. <cfset val = ctx.lookup("java:comp/env/adminemail") > No such binding: adminemail Preforming a listBindings returns an empty jrun.naming.JRunNamingEnumeration. <cfset val = ctx.listBindings("java:comp/env") > I only want to put a string value (probably several) into the ENC (or any JNDI directory at this point).

    Read the article

  • JNDI InvalidnameException for CN 'LastName, FirstName'

    - by user321524
    Hi: I am writing to active directory using JNDI, it is successful for "CN=Yuri Gagarin,OU=Admins,DC=ead,DC=ubc,DC=ca"; but fails for "CN=Gagarin, Yuri,OU=Admins,DC=ead,DC=ubc,DC=ca". I need to store displayName, cn, name in the format 'lastName, FirstName'. What do I need to do to get this going? Thanks very much.

    Read the article

  • Why bind hibernate SessionFactory to a JNDI resource?

    - by jschoen
    In my current adventure of learning hibernate and setting it up to use an appserver's connection pool, most examples and resources out there point you in the direction of binding the SessionFactory to a JNDI resource in your appserver in the process. I wondering what the benefit of this is? Since the you can access a the connection pool with out doing this.

    Read the article

  • Hibernate SessionFactory: how to configure JNDI in Tomcat?

    - by EugeneP
    that's how the session factory should be gotten: protected SessionFactory getSessionFactory() { try { return (SessionFactory) new InitialContext() .lookup("SessionFactory"); } catch (Exception e) { } } Please provide a simple solution for Tomcat6 to be able to get SessionFactory thru simple jndi lookup in Java code. What should be written in what file on the side of Tomcat ?

    Read the article

  • How to set up jndi.properties for DataStore?

    - by FarmBoy
    I'm struggling to set connect a Java program to MySQL using JPA/Hibernate. I'm currently getting the following error when I try to call createEntityManagerFactory(): [main] ERROR org.hibernate.connection.DatasourceConnectionProvider - Could not find datasource: java:jdbc/myDataDS javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:75) Googling seems to indicate that I need a jndi.properties file in META-INF in my classpath, but I can't seem to find any information about what that file should contain in my case.

    Read the article

  • jndi binding on jboss4.2.3 and ejb3

    - by broschb
    I am trying to deploy a stateless ejb on jboss 4.2.3 using ejb3 annotations. Everything builds and deploys correctly, and I do not get any errors when jboss starts up. However the ejb is not getting bound to any JNDI location for lookup when I look at the bindings in jboss. Below is what I have for my ejb. Remote @Remote public interface TestWebService { public String TestWebMethod(String param1, String param2); } Stateless EJB @Stateless @RemoteBinding(jndiBinding="TestWeb") @Remote(TestWebService.class) public class TestWebServiceBean implements TestWebService{ public String TestWebMethod(String param1, String param2) { System.out.println("HELLO "+param1+" "+param2); return "Welcome!!"; } } I have tried not having the @Remote and @RemoteBinding and it doesn't make a difference. I have also added and ejb-jar.xml file (which should not be needed with ejb3) and that does not appear to make a difference. Below is the output I see in the jboss log on startup. installing MBean: jboss.j2ee:ear=ejb_web_service_ear-0.0.1- SNAPSHOT.ear,jar=ejb_web_service-0.0.1-SNAPSHOT.jar,name=TestWebServiceBean,service=EJB3 with dependencies: 21:56:00,633 INFO [EJBContainer] STARTED EJB: com.tomax.ejb.TestWebServiceBean ejbName: TestWebServiceBean

    Read the article

  • How to configure the roles in my tomcat application to work with JNDI(WIN AUTH)

    - by Itay Levin
    Hi, I'm trying to change the authentication mode of my application from JDBC-REALM to JNDI-REALM. I configured the following section inside the Server.xml <Realm className="org.apache.catalina.realm.JNDIRealm" debug="99" connectionURL="ldap://****:389/DC=onsetinc,DC=com??sAMccountName?sub?(objectClass=*)" connectionName="[email protected]" connectionPassword="password" userBase="CN=Users" referrals="follow" userSearch="(sAMAccountName={0})" userSubtree="true" roleBase="CN=Users" roleName="name" roleSubtree="true" roleSearch="(member={1})"/> I have also configured the web.xml under my appfolder to contain the following: <security-role> <role-name>Admin</role-name> </security-role> <security-role> <role-name>WaterlooUsers</role-name> </security-role> <security-constraint> <web-resource-collection> <web-resource-name>Tube</web-resource-name> <url-pattern>/ComposeMessage.jsp</url-pattern> <url-pattern>/PageStatus.jsp</url-pattern> <url-pattern>/UserStatus.jsp</url-pattern> <url-pattern>/SearchEC.jsp</url-pattern> <url-pattern>/SearchEC2.jsp</url-pattern> <url-pattern>/SearchMessageStatisticsEC.jsp</url-pattern> <url-pattern>/SearchMessageStatus.jsp</url-pattern> <url-pattern>/SearchMessageStatisticsPager.jsp</url-pattern> <url-pattern>/SearchPageStatus.jsp</url-pattern> </web-resource-collection> <auth-constraint> <role-name>WaterlooUsers</role-name> </auth-constraint> </security-constraint> In my Active directory i have created a new group called WaterlooUsers It's distinguish name is : distinguishedName: CN=WaterlooUsers,CN=Users,DC=onsetinc,DC=com It has a property member which contains the following user: member: CN=Itay Levin,CN=Users,DC=onsetinc,DC=com (which is my user) My record on the active directory looks like that: sAMAccountName: itayL distinguishedName: CN=Itay Levin,CN=Users,DC=onsetinc,DC=com memberOf: CN=WaterlooUsers,CN=Users,DC=onsetinc,DC=com and when i get the popup for user/password i enter the username "ItayL" in the authentication message box (and my password) I have 2 questions: How do i configure correctly the roles parameters correctly in the Realm section in the server.xml to enable me to both authenticate and authorize both this group of users WaterlooUsers and also assign them to the appropriate role so that they can see all the relevant pages in my website. - currently it seems that all the Users in my domain are authenticated to the site but get the http-403 Error and can't access any of the pages in the site. I also want to be able to create 2 different set of roles in my site - which can both have access to the same pages - but will see different things on the page. (for instance adding some administrative ability to the admin) Hope it was clear enough and not too long. Thanks in advance, Itay

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >