Problem using datasource in netbeans to get connection

The method initialContext.lookup("java:comp/env/myDatabase");
generated the following exception
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:247)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at enterprise.Test2.getMyDatabase2(Test2.java:54)
at enterprise.Test2.doTest(Test2.java:36)
at enterprise.Test2.main(Test2.java:46)
How do i resolve this

I t could be the right forum , since javamail uses DataSource.
It could be you need to say
javax.swing.Activation.DataSource at the variable declaration not simply import and assume.
There are various "DataSource" classes in java.
Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initialAs it is, it appears to be the server configuration file/application web.xml or a JNDI association/environment has not been constructed to point to the classes to load.
Edited by: nicephotog on Oct 30, 2008 10:57 AM

Similar Messages

  • Problem using DataSource for JDBC applications

    import javax.sql.*;
    import java.sql.*;
    import java.io.*;
    import java.text.*;
    import javax.naming.*;
    public class CreateMovieTables {
         //static String driver="COM.cloudscape.core.JDBCDriver";
         //static String url="jdbc:cloudscape:";
         String leadActor,title,leadActress,type,dateOfRelease;
         Connection connection;
         Statement statement;
         DataSource dataSource;
         public void initialize() throws SQLException,NamingException{
              //Class.forName(driver);
              Context initialContext = new InitialContext();
              //connection = DriverManager.getConnection(url + "Movies;create=true");
              dataSource = (DataSource) initialContext.lookup("jdbc/Cloudscape");
              connection = dataSource.getConnection();
    the code goes on
    when i start the j2ee sdk server, the cloudscape server the message i get when i run the program is...
    No local string for datasource.wrongclient
    java.sql.SQLException:
    at com.sun.enterprise.resource.JdbcDataSource.getConnection(JdbcDataSource.java:40)
    at CreateMovieTables.initialize(CreateMovieTables.java:23)
    at CreateMovieTables.main(CreateMovieTables.java:86)
    can anyone please suggest as to where i may be going wrong
    thanx
    -NDK

    I don't agree that a User or System DSN is needed - that's a Windows idiom.
    I haven't used the J2EE SDK to set up a data source, but I know that when I do it in Tomcat I've got to put a <resource-ref> tag in the web.xml that identifies the JNDI lookup string, and then the JDBC driver/URL/username/password details under a <Resource> tag in the context.xml to tell the data source how to create the JDBC connection.
    My <resource-ref> name is "jdbc/APIPrototype". My JNDI lookup string looks like "java:comp/env/jdbc/DataSourceName".
    You've got to do more than just put the JNDI lookup string in the Context lookup. Your error message sounds like the server is saying you've haven't done that set-up work.
    Just a guess - perhaps it's something else, but I couldn't tell from your note. - MOD

  • BrowserLab problems - used to work, can no longer connect now

    I was using Browser Lab thru Dreamweaver CS5.5 (v11.5, build 5344) with no problems whatsoever until recently. For no apparent reason, it stopped working. Now when I try to connect, I just get that "preparing for preview..." progress bar that never goes away.
    I've gone over all the other threads in this forum concerning this problem, and I would seem to meet all of Adobe's criteria for successfully running this tool; and none of the fixes that worked for others are working for me.
    Dreamweaver is up to date. My Adobe ID is up to date. I have cleared browser cookies and caches, restarted everything that can be restarted, etc. etc. etc. All to no avail.
    I have noticed a couple weird things: after the tool failed in DW, I attempted to access it by first connecting to BrowserLab in my browser (no problem), then going back to DW and previewing; that actually worked but ONLY two or three times, out of well over a dozen attempts.
    The other thing I noticed is that in my extensions manager, there is no BrowserLab extension listed. I don't know if that's normal or not; obviously, it's installed, since I have the BL panel available in DW.
    I am losing my mind over this... any help/solution would be *very* appreciated. I'm trying to get a job out the door by tomorrow, I have come to rely on BL for IE testing since acquiring DW CS5.5, so this is putting me in an exceptionally bad situation.

    Hi Mark,
    Fair enough, I guess it should come as no surprise that you're very busy and I  certainly can empathize with that. I let my frustration get the better of me and I may have been, well, starting to panic a bit.. perhaps it's time to re-read that Hitchhiker's Guide
    In any case, I do greatly appreciate your reply, thank you very much. And your particular response about my 'license status' gave me the first good laugh I've had all day. Right you are.
    To the point, then:
    1. I'm running Mac OS 10.6.8
    2. BL version no. is: 1.6.0.971M.273042
    3. It's not an error message, just the endless "preparing for preview..." progress bar. It only goes away if I cancel the preview. I've not yet seen any error message, even though I've let that bar 'spin' for a *long* time. Here:
    4. As requested:
    5. Yes, that option has been there ever since I installed the BL extension back in the summer:
    Like I said this all worked just fine... until it didn't. I'm at a loss to explain what could've changed. I spent literally hours trying to figure this out w/o success. The only "change" I'm aware of at this point, is  that I changed my Adobe ID password since originally installing the BL extension in DW; but I've updated that at the CS Live site already, and the problem persists. And anyway, I really can't imagine that would account for the missing extension weirdness, and it also seems to me that if that were the problem, I wouldn't have been able to access BL the way I described in my first post (please let me repeat that that method only worked about 2 or 3 times out of a good 15-20 attempts; I've had no success getting it to work again).
    So.. a good puzzle here? I do hope you enjoy them... I have not been having fun w/ this
    Thanks again for your reply Mark, and I will patiently (but eagerly) await your answer.
    Best regards,
    Tom

  • My new Ipad2 got connected to my home Wi-Fi and to the network and for 2 days everything was alright. Then I encounteed a problem. Though my Ipad2 was getting connected to Wi-Fi, could'nt access network. How to enable Data Roaming?.

    My new Ipad2 got connected to my home wi-fi and to the network. For 2 days evrything qored well. Then though Ipad2 was connected to wi-fi, it did not open the web page/s. The dialogue box read, `Data Roaming is turned off. You can enable Data Roaming in the Network Section of General Settings' When I tried it, there is no item of Data Roaming displayed in the Network Section of General Settings. It shows only two settings. 1. VPN and 2. Wi-Fi.  How to correct this issue? Help is needed to resolve this issue. I am from India and Apple do not have any local service providers.Pl. help me.

    Sounds like the WiFi is connected, but cannot reach the Internet and is trying to use 3G, but you are in a roaming area so you get the dialog.
    The first thing to try is turning the Wi-Fi off and back on again in Settings.  Or simply turn the iPad off and back on again.  If that doesn't work double-check that other devices are able to use the same WiFi network successfuly, or try the iPad on another WiFi network.

  • Problems using airplay from my RMBP getting the music from a network drive.

    Hello, I really need some help here. First I'll tell you how everything is set up: At home I have my RMBP, my Apple TV, and a network hard drive connected to a wireless network (provided by an Airport Express). As I have a lot of songs and my RMBP is only 256GB, I keep my iTunes library in the network drive. The Apple TV is connected directly to a Receiver using an optical cable.
    the problem: when I play music from the drive and I activate airplay on iTunes, it works fine until it stops streaming to the apple TV. On iTunes everything seems to be okay but it doesn't sound. Although there is no music coming out of any speaker, itunes is playing. I haven't been able to find a solution to this situation because I don't have this problem when I stream music from another library I created in my RMBP's hard drive. this happens even when I'm using the computer, so it does not have to do with the computer not being active...
    any ideas?
    thanks!
    Frank

    There could be other reasons but I'd look at your network first. Having content on a network drive will cause more traffic on your network than if itwere on an internal or external drive. This shouldn't normally be a problem but can be on boderline networks.
    The following article(s) may help you.
    Troubleshooting Wi-Fi networks and connections

  • Major problems using DV cam with external drive connected. HELP

    I am running Final Cut Pro 5.0.4 and Quicktime Pro 7.0.4 and I want to use one of my external Firewire drives as my scratch disk, and when I connect my Canon GL2 FCP either crashes if it is open, or hangs when trying tro start uo if external hard drives are connected. As I need to use an external to capture to I really need to resolve this A.S.A.P.
    Thanks in advance for your reading and replying to my post,
    Sebastian

    firewire external hd is a perfectly acceptable medium for capturing footage. it works pretty flawlessly and has little issues or problems
    This type of blanket statement really can't be supported in my view.
    There are issues with single bus firewire captures.
    And many cams, including Canons, don't play well with firewire hard drives on the same bus.
    Glad it works for you, but that's doesn't mean it works for everyone.
    You might want to take a peak at this:
    http://www.adamwilt.com/Tidbits.html#FireWireFrustrations

  • Problems using on board USB JUSB2&JUSB3 connections

    Hi, I'm a user of a MS-6380 LE mb.
    I've tried to use both of JUSB2 or JUBS3 for an external connection from a Conceptronic CMULTIFP2 fornt panel, but only 1 USB plug works (instead of the 2 connected).
    I've checked the wires and they are OK.
    Could anyone give me an idea of what's happening ?
    Many thanks.

    Well, you only need one "interface" for two "connections". One of the connections work but not the other. That gives me the idea the "interface" works, but not one of the "connections".
                                                                   ----------------------- USB works
    Motherboard/Interface -----------------< Conceptronic/Connections
                                                                   ----------------------- USB don't work
    Is it always the same "connection" that doesn't work?
    If you have many many USB-devices, the motherboard may have a problem powering some USB-devices but that is not so likely.
    As I understand it, you have the same problem whether using JUSB2 or -3?

  • Does any one have problems using facetime. I can't connect with any of my contacts

    I am having trouble connecting with my contacts on facetime and am wondering what I may be doing wrong.  Any sugestions???

    Did you try the general tips in these articles? iOS: Using FaceTime and iOS: Troubleshooting FaceTime

  • Problem using "Classic", it keeps trying to connect to a server

    Whenever I startup Classic it almost finishes and than an error comes up that says "Connection failed. Cannot find network server address or i.p. May not be correct i.p........" Or something to that affect.
    The offending mac is running OS 9.2 and Panther. It has a cable modem for the internet which works fine when booted in 9 or X.
    Help please.

    Open the folder "System Folder" on your hard disk and then the Servers folder inside; once this folder has appeared, move everything inside to the desktop. Start Classic again.
    (11668)

  • Get Connection Error

    Dear Friends,
    I asked questions about my problem according to get connection with JDBC Driver (you can see my questions with username pourty in the
    question list) and JDev Team guided me that I can use the following statements to get connection but unfortunately when I tested the follwing statement I got the same exception (java.sql.SQLException: No suitable driver)
    DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver ());
    Connection conn = DriverManager.getConnection("jdbc racle:kprb:");
    Could anyone please help me that what should I do?
    any suggestion would be appreciated.
    Thanking in advance
    Amirali Pourteymour
    null

    I am getting the same problem, and if I do a search on 'no suitable driver' in this forum there are about 8 different questions each saying that when they run as an application they can connect to Oracle fine, but when they try to when it is running as an Applet, EJB or other similar methods then it doesn't work.
    I have done a full installation, and I have tried using the sample jdbcApplet.java that comes with the default install of JDeveloper but this also doesn't connect because of unsuitable driver.
    "jdbc:oracle:thin:****/****@*****:1721:******";
    The rest of that code is identical.
    Thanks very much in advance for you assistance,
    Spencer
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by John@Oracle JDeveloper Team:
    Amirali, Here is some answers from the
    FAQ which will help.
    Please see the second item (Q123) for more
    details - if things are not working, then
    I believe you have an incomplete installation.
    Q37: DriverManager.getConnection gives the Error: "No suitable driver"
    Make sure that the driver is registered and that you use a connection URL consistent with your JDBC driver. See Using Oracle's JDBC Drivers for the correct values.
    Q123: Problem
    Some people have run the OUI to install 8i, then written some simple Java code and tried to run it, only to be surprised that their Java code didnt work.
    Basically, this is because they have not completed their install.
    To be very explicit, running OUI to install Oracle 8i is sufficient IF and ONLY IF you are not using any client side Java and are only interested in a
    server Oracle installation. However, if you want to run Java on the client side, there are extra steps to be completed - these steps are listed in the 8i doc.
    Some common pitfalls and their solutions are also summarized below.
    Solution
    Testing your installation - do "Hello World"
    We provide a set of samples in $ORACLE_HOME/javavm/demo/demo.tar (or demo.zip for WinNT). These samples have been extensively tested and
    do compile and run fine for a "typical" install of Oracle 8i. Please treat these samples just like a seasoned C/C++ programmer would treat a "Hello
    World" program - a vital test of the installation. Dont go any further until you at least get these three samples to run.
    $ORACLE_HOME/javavm/demo/examples/jsp/helloworld
    $ORACLE_HOME/javavm/demo/examples/corba/basic/helloworld
    $ORACLE_HOME/javavm/demo/examples/ejb/basic/helloworld
    If you cant get these 3 samples to compile and run cleanly in your environment, then you know there is something wrong with your environment.
    Similarly, if these work fine, but your code still doesnt run, then you at least know that the installation is ok and that the samples work, so the problem
    has to be with your build environment or your code. Note: It is important that you be able to run these examples using the supplied Makefiles (or batch
    files on NT) when verifying your installation.
    Once these samples have been shown to work in your installation, you can then use the development environment of your choice, or even to manually
    building from the command line if you so choose. Please verify that the simple straightforward samples do work, before trying to do anything
    more complex.
    The following method (below) is copied from:
    <OracleHome>\ORA81\javavm\demo\examples\jsp\basic_kprb\Employee.java
    public static String getEmpName (int enum) throws SQLException
    String name = null;
    Connection conn = null;
    Statement stmt = null;
    try
    // load the kprb driver
    DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver ());
    conn = DriverManager.getConnection ("jdbc :oracle:kprb:");
    // create a statement
    stmt = conn.createStatement();
    // find the name of the employee with the given employee number
    ResultSet rset = stmt.executeQuery(
    "SELECT ENAME FROM EMPLOYEE WHERE ENUM = " + enum);
    // retrieve and print the results
    while (rset.next())
    name = rset.getString (1);
    finally
    // don't forget to close the statement
    stmt.close();
    // return the name of the employee who has the given employee number
    return name;
    John@Oracle JDeveloper Team http://technet.oracle.com <HR></BLOCKQUOTE>
    null

  • Having problem using internet via wifi

    i m facing a problem using wifi... whenever i connect 2 any wifi network and start the browser it always shows" no internet connection".... can anybody help me regarding the issue????

    Hi sunny786pandit
    Welcome to BlackBerry Support Forums
    Please go through those Article :
     How to connect to a Wi-Fi network using a BlackBerry smartphone       and 
    KB13368 : Services that are available over a Wi-Fi connection
    I hope it helps.
    Prince
    Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.
    Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.

  • HT201401 I need to restore my iPhone. When I connect to my pc in iTunes it asks me to unlock the phone using my password.  Problem is that I can't get to the password lock screen to do so. I can only get either the iTunes screen or the Emergency Call scre

    I need to restore my iPhone.  Once in iTunes, I get an error message asking me to use my passowrd to unlock phone. The problem is that I can't get to the password lock screen. All I can get is the iTunes screen or the emergency call only screen.

    yes did you buy it of somebody or a well known company such as apple or carphone warehouse?
    and i mean the phone would have been activated in the first place with the sim card you get given when you first get the phone.
    trying to activate the phone with another sim card that you did not get when you brought the phone may result in you not being able to activate it
    no worries

  • My iphone is lost. Find my iphone is enabled. Problem is how can anyone who found my iPhone gets connected to wifi, when I had already put my passcode on my phone? In this way, how can I track my phone using Find my iPhone?

    Hello all,
                   My iPhone 4 has been lost recently. I had turned my Find my iPhone enabled and my passcode was also on. Now that I lost my phone, the person who find my phone cannot be tracked in my assumption. Because, he can never get connected to other wifi when unknown passcode is there. So, please tell me any suggestions that helps me find my iPhone or track it.
    Regards,
    Manish Dangi
    Nepal.

    If you can go to https://www.icloud.com/#find - sign in and then click on your device
    If who ever has your phones - tries to unlock it while connected in any manner - you will be able to see the location on the icloud site
    Also take the steps in this article
    If your iPhone, iPad, or iPod touch is lost or stolen - Apple Support

  • How to use datasources to connect to database ?

    I have the following Problem
    I have two identical databases, one is the development database, the other one the production database.
    Now I need to find a way, how I can deploy an bc4j-application in local mode that way, that if the application is deployed to server 1 it connects to database 1 and if deployed to server 2 it connects to database 2.
    JDBC connection strings do not work as the connection is deployed with the application. So the application always connects to the same database.
    I thought datasources might be the solution. So I tried to define a datasource MyDS in the data-sources.xml file and specified it in the Configuration Wizard as the connection to use.
    But unfortunately this does not work and i do not know why:
    If I try to connect using the tester and using this datasource I get the following exception:
    Level #3: javax.naming.noInitialContextException
    Can anyone help me, what this means? How can I get around this using the BC4J Framework? Is there any "HowTo" Document which describes using datasources with BC4J?

    Frank,
    I've sorted this stuff out to some extent. Have a look at this thread:
    re:? How: multiple myAppWar.ear to use OC4J's data-sources.xml pooling?
    If this isn't all you need, then search on data-source.xml
    and read other threads also I may have posted helps on
    other threads so if you search on data-source.xml and my handle (curt504) it brings up all the threads that I posted to.
    Not to say I've solved all your problems, but I solved mine anyway. :)
    Good luck,
    curt

  • Problems using connection pooling

    I'm having problems configuring connection pooling in oc4j. Have specified my datasource/connection pool in my data-sources.xml. I always get the following error when I try to access it with an instance of OracleConnectionPoolDataSource within my apps. The app server dosen't seem to create the connections when started 'cos its not displayed within Oracle dba studio. Can anyone tell what I need to do pls.
    regards!
    dyzke
    //-- error displayed
    Exception in thread "main" java.sql.SQLException: Io exception: The Network Adap
    ter could not establish the connection
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:260)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va:365)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java
    :111)
    // -- extract
    <data-source
              class="com.evermind.sql.DriverManagerDataSource"
    name="MYDS"
              location="jdbc/XXX"      
    xa-location="jdbc/xa/OracleXADS"
              ejb-location="jdbc/OracleDS"
    pooled-location="xxx/xxxx"
              max-connections="10"
              min-connections="3"                    
              connection-driver="oracle.jdbc.driver.OracleDriver"
              username="admin"
              password="admin"
              url="jdbc:oracle:thin:@localhost:xxx"
              inactivity-timeout="30"
         />

    see my answer in the other newsgroup.
    please don't cross post.
    "M. Hammer" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    We have problems using connection pooling in a WLS 5.1.x - Cluster. Is it
    possible to use CP in such a cluster at all ? The problem is, connections
    will be opened and never been closed. How can I configure a cluster forCP?
    >
    I have a WLS-Cluster with 2 instances and my webApp uses connectionpooling.
    By the way I get a connection on Instance 1, Instance 2 gets a connection
    also, but never releases it.
    In my opinion, the reference to the connection in the partner-instancewill
    be lost.
    How do I have to configure my cluster to work well with that stuff ?
    Thank a lot,
    Markus.

Maybe you are looking for

  • How to see the TR'S in query

    Dear All, I would like to see  what are the TR's generated against the query and TR request details,Please advise how to see the details

  • Problem with website db

    I have dedicated server. the following is the status: # Begin of O R A C L E status section # Kernel Parameters Shared memory: SHMMAX= 3294967296 SHMMNI= 4096 SHMALL= 2097152 Semaphore values: SEMMSL, SEMMNS, SEMOPM, SEMMNI: 1250 32000 100 256 Databa

  • GOA Distribution error

    Hi, There is a user who has created a Global Outline Agreement in SRM and has distributed the contract in SRM, however, the GOA is not transferred to the backend. When i check the GOA in SRM, it shows the status as "Distribution Incorrect". What coul

  • Prints come out wrong size

    I have 32 bit Vista Ultimate, an HP 7410 printer, and Adobe Photoshop Elements 6.0 with all the updates. When I print a single print, it comes out the size it is supposed to be. However if I use the "Print Multiple Photos" Option using the same pictu

  • OAF page: problem with insert data

    Hi, I have created a table with 1 sequence value. I am able to add a sequence value in that table when I click on Apply  button in the page. But I am not able to insert other attribute values in the table. InsertEOImpl.java package PD08.oracle.apps.f