URGENT: Can't connect to a MDB from a standalone application

Hi, I hope somebody can help me. I'm trying to send messages to a MDB from a standalone client, but I have problems when looking up JMS queues and connection factories. The code is the following:
try {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.PROVIDER_URL, "ormi://192.168.64.173:3101/PruebaAS");
env.put(Context.SECURITY_PRINCIPAL,"admin");
env.put(Context.SECURITY_CREDENTIALS, "admin");
jndiContext = new InitialContext(env);
catch (NamingException e) {
System.out.println("Can't create JNDI API" +
"Context:" + e.toString());
System.exit(1);
* Look up connection factory and queue. If either does
not exist, exit.
try {
queue = (Queue)
jndiContext.lookup("java:comp/resource/ojms/Queues/queue2");
catch (NamingException e) {
System.out.println("JNDI API lookup failed." +
e.toString());
System.exit(1);
When program tries to look up the queue, I get the message: "JNDI API lookup failed.javax.naming.NamingException: Disconnected: Unknown command: 7"
What's the meaning of "unknown command:7?? I have deployed the MDB to an Oracle 9iAS 9.0.2 using enterprise manager, and create queues in an Oracle 9i 9.2.0 Server.
Please, I need some help. Thanks in advance.

I'm no expert, but I did get something like this working. One gotcha is that you need to have an instance of the database driver, since the Oracle queues use the database. Try something like this before you attempt the JNDI lookup:
Class.forName("oracle.jdbc.driver.OracleDriver");
If necessary, replace "oracle.jdbc.driver.OracleDriver" with the appropriate driver for your environment. Good luck.

Similar Messages

  • How can I connect to a database from ipaq with cldc??

    how can I connect to a database from ipaq with cldc??

    Hi Again
    There is a library by Mimer which allows you do connect to a Mimer SQL Server, don't know must about it, but here is a link.
    http://developer.mimer.com/
    If that doesn't suit you, I suspect that you will have to use some sort of proxy solution. Either by creating a servlet to accept the sql string you want to send, or by creating your own custom proxy server running J2EE. The servlet or the proxy server must be able to receive an SQL String, do the query to the actual database and return the results in some sort of format to the mobile device. Maybe just a space delimited string.
    Hope this helps
    -Daur

  • How can i connect my bookmarks links from Firefox, to favorites (location) start button then favorites?

    ''dupe of https://support.mozilla.org/en-US/questions/915455''
    How can i connect my bookmarks links from Firefox, to favorites (location) start button then favorites?

    *Plain old favorites: https://addons.mozilla.org/firefox/addon/plainoldfavorites/

  • Can't connect to DFS shares from machines not part of the domain

    I'm not sure if this is by design, but we can't connect to DFS shares from machines that are not joined to the domain.  We can't even map a drive using credentials of a domain account.
    Is that how DFS is supposed to work? 

    Hi RJO22,
    I did some research on this topic, and got a conclusion:
    Clients that belong to a workgroup can only access the DFS namespace if the name resolution mechanism that is in place can locally resolve the domain name
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/c3214a4c-8088-446c-ba4d-643d5baf87cc/how-to-access-dfs-namespace-from-a-standalone-windows-2003-server
    Regards,
    Alex Zhao
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Can't connect to airplay speakers from iTunes

    I suddenly can't connect to airplay speakers from iTunes on my new Macbook Pro - they are visible but cannot be selected. I can connect to them from other Macs and iPads. Can anyone help, pls? I have set the whole network up several times, rebooted system ie.

    I had this happen to me on the odd occasion but now have it sorted. If I'm going to use my Airport Epress(s) I first make sure that my PC is connecting to the AE before I even turn on iTunes.
    A problem I was having was that my PC was connecting to my wireless router by default (specifically when my laptop was turned off) and not to the AE. As a consequence when iTunes started it greyed out the remote speakers and sometimes the button was not even showing up.
    Now that I ensure my PC is talking to the AE everytime I do not have a problem.
    I do have one annoying thing with the AE setup though, if I'm playing music over the AE and I unplug any USB device (printer, USB Key, External drive etc) the wireless connection is broken and I have to start iTunes. I suspect it is a hardware issue relating to my particular HP PC as I have just reformatted and reinstalled Windows XP and it still happens. I can live with it.

  • Can`t connect to business catalyst from within Dw. How to fix??

    Can`t connect to business catalyst from within Dw says there is a server error but internet connection good. Need to publish asap please help !! Was working fine earlier in the day but now refuses. Have tried Muse as well but it can`t reach Bc as well........

    Business Catalyst System Status
    BC Status
    System Updates Forum
    Nancy O.

  • Can I connect Azure SQL Database from Project Siena ?

    Can I connect Azure SQL Database from Project Siena ?
    I want to connect Azure SQL Database of Office 365 SharePoint's Access App from Project Siena.
    Access App's Database is Azure SQL Database.
    and can connect to Excel/PowerBI/etc.
    Access App's Database can connect from specific location / any locations.
    Access App's Database can allow read-only connection / read-write connection.
    I want to create Windows App connected to Access App's Database.
    Regards,
    Yoshihiro Kawabata.

    Hi Yoshihiro,
    Could you share more with us about the high level scenario for what you are trying to accomplish offline? We can discuss further at
    [email protected]
    Once we are done, we will definitely share our findings with the community.
    Thanks!

  • I can't connect to iTunes store from my new iPad 3

    How can I connect to iTunes store from my new iPad 3

    It's still isn't connecting to iTunes Store.  but I'll continue to wait on their servers

  • Publishing message to Topic from a standalone application.

    Hi,
    I have a standalone Java program which will publish a message to the TOPIC. I have found the code to publish to the topic. Please anyone of you can tell me, if I can do it from the standalone application and if yes then how, please provide a code example if possible. We need to specify JNDI's, so tell me where we configure these JNDIs and how would my standalone program would connect to it.

    [http://www.google.com/search?q=jms+publish+standalone+example|http://www.google.com/search?q=jms+publish+standalone+example]
    Edited by: jtahlborn on Sep 4, 2008 9:07 PM

  • How can i connect and share files from my mac book pro to my windows PC?

    (I have a tp-link wifi router which is connected to mac and from the same router pc is connected via pan cable)

    Hello Chandan Mj,
    After reviewing your post, I have located an article that can help with file sharing between Mac and Windows computers:
    OS X Mavericks: Set up a Windows computer to share files with Mac users
    Thank you for contributing to Apple Support Communities.
    Cheers,
    BobbyD

  • Can't connect to wireless network from my e2000 router

    My network was working fine, then my router turned off spontaneously. The power wasn't lost, everything else in the power strip was still functioning. I got it working again but now I can't connect to the wifi network on any of my devices. I've tried using a Wii, an iPhone 5 and a Mac running OSX 10.7.5
    The wired connection works fine. I can see the network on my list, but when I try to access it it reads "Could not join 'network'. A connection timeout occoured." 
    Any ideas? Anyone else have this issue and fix it? Is it time to go out and buy a new router?

    Yes, reset is fine. I do believe firmware upgrade can fix a lot of things.
    I usually use 1, 3, 6, 9, 11 wireless channels for better wireless coverage.
    I use inssider software to determine the best wireless channel to use.
    I make sure to that cordless phones, microwave ovens and other wireless transmitters are at least 10 meters away from the router. I also updated my wireless devices as much as possible. I think that is the key to my stable network.

  • I can't connect to MySQL database from The JSP Standard Tag Library

    Hi All !
    I have a problem, please help me anybody !
    I don't connect to MySQL database from jsp page using JSTL tag but from servlet all work correctly. I set my path and put �mysql-connector-java-3.1.13-bin.jar� in ENVIRONMENT WinXP(classpath=C:\Java\jdk1.5.0_10\jre\lib\ext\mysql-connector-java-3.1.13-bin.jar) and in War project folder �WEB-INF/lib� and in [TomcatServer]\common\lib.
    I have in folder�WEB-INF/lib� following files:
    antlr.jar
    commons-beanutils.jar
    commons-collections.jar
    commons-digester.jar
    commons-fileupload.jar
    commons-logging.jar
    commons-validator.jar
    jakarta-oro.jar
    jsf-api.jar
    jsf-impl.jar
    jstl.jar
    mysql-connector-java-3.1.13-bin.jar
    standard.jar
    struts.jar
    I'm using:
    NetBeans 5.5 Build200610171010 (bundled Tomcat 5.5.17)
    Ent.Pack 20061020 Visual Wb Pack 061103
    OS WinXP SP2
    Java 1.5.0_10
    MySQL 5.0.18-nt
    1:<%@page contentType="text/html"%>
    2:<%@page pageEncoding="UTF-8"%>
    8: <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    9: <%@taglib uri="http://java.sun.com/jstl/sql" prefix="sql"%>
    10:
    11: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    12: "http://www.w3.org/TR/html4/loose.dtd">
    13:
    14: <sql:setDataSource var="ds"
    15: driver="com.mysql.jdbc.Driver"
    16: url="jdbc:mysql://localhost:3306/test"
    17: user="root"
    18: password="xxxx"/>
    19:
    20:
    21:<sql:query sql="select name, age from People" var="res"
    22: dataSource="${ds}"/>
    I have received report on mistake when entered code at the top:
    �/index.jsp [21;0] According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions�
    I used instead of (dataSource="${ds}")->(dataSource="ds") but this did not work.
    After build and run I have received
    =========================================START=================================
    HTTP Status 500
    type Exception report:
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: /index.jsp(21,0) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    root cause
    org.apache.jasper.JasperException: /index.jsp(21,0) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
    org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:955)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:710)
    org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
    org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
    org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
    org.apache.jasper.compiler.Validator.validate(Validator.java:1489)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:166)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
    Apache Tomcat/5.5.17
    =======================================END================================
    Error: "According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions" - but according to documentation such parameter possible.
    BUT WHEN JOINING With DATABASE FROM SERVLET ALL WORK FINE.
    I read this doc - [http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html], this applicable if I Tomcat Admin, but i'am not Admin
    I simply user, i.e. I want to place its database on virtual host (Tomcat+(JSP-JSTL)+MySQL).
    There is idea how can resolve this problem
    Thank you in advance ;)

    For all how have similar problem.
    Decision instead of these ways
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    it is necessary to indicate these
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

  • How can I connect to Oracle database from Iplanet webserver running on a Linux box and a database running on a Solaris box?

    Hi - I'm new to this group and wonders whether you guys can help me.
    I'm trying to connect to my Oracle9i database via a Java servlet but
    got the following error message in the web browser:
    Internal error: exception thrown from the servlet service function
    (uri=/servlet/HelloWWW6): java.lang.NullPointerException, Stack:
    java.lang.NullPointerException
    at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:1743)
    at oracle.jdbc.oci8.OCIEnv.getEnvHandle(OCIEnv.java:69)
    at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:452)
    at oracle.jdbc.driver.OracleConnection.(OracleConnection.java:287)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance
    (OracleDriver.java:442)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:321)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:172)
    at HelloWWW6.doGet(HelloWWW6.java:40)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    com.iplanet.server.http.servlet.NSServletRunner.invokeServletService
    (NSServletRunner.java:897)
    at com.iplanet.server.http.servlet.NSServletRunner.Service
    (NSServletRunner.java:464)
    My class path is:
    Java VM
    classpath: /u01/iplanet/servers/plugins/servlets/examples/legacy/beans
    .10/SDKBeans10.jar:/usr/local/javamail-1.2/mail.jar:/usr/local/jaf-
    1.0.1/activation.jar:/u02/app/oracle/product/9i/lib:/u02/app/oracle/pr
    oduct/9i/jdbc/lib:/u02/app/oracle/product/9i/jdbc/lib/classes12.zip:/u
    02/app/oracle/product/9i/jdbc/lib/nls_charset12.zip:/u01/iplanet/serve
    rs/bin/https/jar/NSServletLayer.jar:/u01/iplanet/servers/bin/https/jar
    /NSJavaUtil.jar:/u01/iplanet/servers/bin/https/jar/NSJavaMiscUtil.jar:
    /u01/iplanet/servers/bin/https/jar/servlet.jar:/u01/iplanet/servers/bi
    n/https/jar/servlet-2.3-filters-
    api.jar:/u01/iplanet/servers/bin/https/jar/jsp092.jar:/u01/iplanet/ser
    vers/bin/https/jar/jaxp.jar:/u01/iplanet/servers/bin/https/jar/crimson
    .jar:/u01/iplanet/servers/bin/https/jar/xalan.jar:/u01/iplanet/servers
    /bin/https/jar/jspengine.jar:
    My LD_LIBRARY_PATH is:
    /u02/app/oracle/product/9i/lib:/u02/app/oracle/product/9i/jdbc/lib:/u0
    2/app/oracle/product/9i/jdbc/lib/classes12.zip:/u02/app/oracle/product
    /9i/jdbc/lib/nls_charset12.zip
    Can anyone help? This is currently driving me nuts. I was able to
    connect when I changed it to an application.
    I am using the Iplanet Webserver 6.0 on a Linux 7.2 platform. Like I
    said, sqlplus works fine, standard java application works fine but
    when I change it to a servlet (which means it now goes through the
    webserver, I get this error message)
    Does anyone know what the source code is trying to do at
    OCIDBAccess.java:1743 ?
    Thanks guys!

    Tony, could you please explain me better the procedure that you wrote?
    What are the boxes? My situation is similar:
    | ServerSocket (1) |
    | (192.168.1.100, 5555) |
    |
    |
    |
    |
    | Proxy |
    | Someone wants to connect to the ServerSocket (1) |
    That is not true. You CAN do it but you need a box
    outside the firewall with proper IP address to help
    you. I am not sure if Sergio still wants the answer
    today after more than a year from the original post (I
    did not see the post until today when I try to search
    for something else). Anyway, if such a box is
    available (I call it 2nd box), you could first
    establish a socket between the two boxes by HTTP
    tunneling (I assume it is a http proxy). You have to
    initiate the socket from the 1st box. Then start
    another server socket on the 2nd box, forwarding the
    traffic it gets from outside back to the 1st box using
    the established channel. That is it.
    Tony

  • Can't connect to my Macook from my Mac Mini

    Hi,
    I’m having a problem with file sharing in OSX 10.6.4
    I can’t connect from the Mini to the Macbook and vice-versa.
    I’m not sure why, tried to look for a discussion that would solve, but found nothing.
    Basically, I can see the macbook/MAc Mini in the sharing section of the left bar, click on it, and the wheel spins forever...
    Then click on connect as, and after a while I get a message saying:
    There was an error connecting to the server “nameserver”. Check the server name or IP address, and then try again.
    So then I do “connect to Server” from the finder, and I put the address of the server into it.
    I get the same message I got before.
    I’m on a wireless network, that uses no password protection, but it uses mac address identification.
    Help is welcome.
    Thanx.
    Luca

    None able to help m e on this?
    I think there's something in the preferences of my accounts that is creating the problem.
    Is there a way to reset File Sharing preferences for a machine?
    Thanx
    Luca

  • Suddenly can't connect to healthcare.gov from this iPad only

    Can't login to healthcare .gov from this iPad anymore but can use my wife's iPad with same wifi connection.

    Do you have Cookies disabled on your iPad?
    See Settings > Safari > Block Cookies.

Maybe you are looking for