Java connect to lite (Resource Manager) and db (drivermanager)

Hello, I have a rather strange problem that I would like to ask for your help.
12:21

I want to create a simple java application that connects to oracle db 11g to perform sql queries
and also in oracle 10 lite. my code is as follows:

ResourceManager rm = null;
String url=username+"/"+password+"@jdbc:oracle:thin:@//"+serverhost+":"+serverport+"/" + serverservice;
Try
{
Initialize Resource Manager
ResourceManager.initialize (url);

Retrieve an instance of ResourceManager
RM = ResourceManager.getInstance ();



with 11g I try to connect using:
(if I managed to connect I want to perform queries in the mobileadmin schema (oracle repository of lite))


String url="jdbc:oracle:thin:@//"+server+":"+port+"/" + service;
DriverManager.registerDriver ((Driver) Class.forName ("oracle.jdbc.OracleDriver") .newInstance ());

/ * //ive tried it too
String url = "JDBC: thin: @(DESCRIPTION =" +) "
"(ADDRESS_LIST =" +) "
"(ADDRESS = (PROTOCOL = TCP)"+) "
"(HOST = \"servername")" +
"(PORT=1521)" + "
")" +
")" +
"(CONNECT_DATA =" +) "
"(Service_name=service)" + "
"(SERVER=DEDICATED)" + "
")" +
")";

*/


c = DriverManager.GetConnection (url, username, password);


both of them make my program freeze for 3-4 minutes and then I get a:
java.sql.SQLException: IO exception: the network adapter could not establish the connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:189)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:231)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:345)
to oracle.jdbc.driver.OracleConnection. < init > (OracleConnection.java:428)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:515)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:345)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
to servermanager. ServerManagerView.ConnectToServer_and_ViewUsers_and_Disconnect (ServerManagerView.java:658)
to servermanager. ServerManagerView.jButton1MouseClicked (ServerManagerView.java:625)
to servermanager. ServerManagerView.access$ 400 (ServerManagerView.java:43)
to servermanager. ServerManagerView$ 4.mouseClicked(ServerManagerView.java:245)
at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
at java.awt.Component.processMouseEvent(Component.java:6266)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6028)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2475)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


It's the same for both. the strange thing is that, if I replace the server host name "localhost" and I run in
the same machine as the server, it connects and works perfectly without changing anything else at all. My Network (I think is configured correctly, because I can connect
oracle 11 g and oracle DB lite developer sql, mobile web page manager, Toad, etc.)

because my server uses dynamic ip I have created also a microsoft loopback adapter as the documentation says:
http://download.Oracle.com/docs/CD/B28359_01/install.111/b32006/reqs.htm#insertedID6

But even with or without the loopback adapter, I get the same behavior. does anyone know how can I encounter this problem?

Thank you for your time

Published by: user2955130 on October 12, 2009 02:45

OK, that makes no sense. If you can connect with SQL Developer from a remote machine, I don't see why your code does not work.

Humor me and run the following code:

import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;

import java.text.DateFormat;

import java.util.Calendar;
import java.util.Date;

public class JDBCTest {

    private static Connection con = null;

    public static void main(String[] args) {

        String MOBILE_SCHEMA   = "mobileadmin";
        String MOBILE_PASSWORD = "yourpassword";
        String JDBC_URL        = "jdbc:oracle:thin:@127.0.0.1:1521:XE";

        try {
            DriverManager.registerDriver((Driver)(Class.forName("oracle.jdbc.OracleDriver").newInstance()));
            try {
                System.out.println(getTime() + "Get JDBC Connection " + JDBC_URL);
                con = DriverManager.getConnection(JDBC_URL, MOBILE_SCHEMA, MOBILE_PASSWORD);
                System.out.println(getTime() + "Established Connection");
                con.close();
                System.out.println(getTime() + "Connection closed!");
            } catch (SQLException sqle) {
                sqle.printStackTrace();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private static String getTime() {
        Calendar c = Calendar.getInstance();
        Date date = c.getTime();
        DateFormat dateFormat = DateFormat.getTimeInstance(DateFormat.LONG);
        String format = dateFormat.format(date);
        return format + " | ";
    }
}

Basically the same thing as you, just remove the resource... Manager but your stack trace does not mention that.

Tags: Database

Similar Questions

  • Problems of peripheral connection to the Desktop Manager and Apploader.exe blackBerry Smartphones

    Just got a new BB8900 last Friday. On Monday, I met a Reload software: 552 error code and after checking online forums for options on how to fix I finally had to reinstall the operating system and reinstall the new applications, which are not checked by the resettlement process. Because I was afraid to become again this error when I rebooted the machine, I immediately made backups every hour I was reconfigure the device and adding my apps.

    Today I was going to do another backup for good measure, and once I have connected my Blackberry to the computer with Desktop Manager running, Desktop Manager crashed and gave me the following error message:

    Signature of the problem:
    Problem event name: APPCRASH
    Application name: DesktopMgr.exe
    Application version: 5.0.0.11
    Application timestamp: 4a4bd539
    Fault Module name: DesktopMgr.exe
    Fault Module Version: 5.0.0.11
    Timestamp of Module error: 4a4bd539
    Exception code: c0000005
    Exception offset: 000d68f5
    The system version: 6.0.6001.2.1.0.768.3
    Locale ID: 1033
    Additional information 1: c4a7
    More information 2: 473b2e845affd1758ca8e66121386d63
    3 more information: 83e8
    Additional information 4: 72466a8a5092651f7fe609f9ec3f3489

    I then tried the APPLOADER. EXE program location in program files/common files/research in motion/apploader. I had used this program yesterday to try to remove applications 1 by 1 with the hope that a single request was causing the error 552. Now for some reason any program as a problem to note the following in the error log file:

    Read 1010fffc location caused an access violation.

    I've looked through several forums and have not found a solution. What I can tell you is the following:

    (1) the phone works well, but I'm afraid by restarting the phone and another 552 error (there were two deleted apps that will be entirely deleted on reboot). Hope everything is fine but I got two of these 552 errors within 24 and the second came without any warning. If I get this error there is no way to make my backup since I can't connect to DM without it crashing.

    (2) it doesn't seem to be a timing issue, but I deleted the Intellisync folder anyway and it does not solve the problem.

    (3) have rebooted my machine without change to the problem.

    (4) have reinstalled DM Version 5 (this time without Roxio Media software) without change to the problem.

    (5) because now I get an error when connecting to DM and trying to run apploader.exe, there seems to be a setting on my phone which may cause problems (I don't know what it can be, but the APPLOADER program finds a violation of place then maybe the Blackberry software is confused about where to find my Apps?)

    (6) the BlackBerry Device Manager works fine and takes note of my device and the serial number it is necessary.

    After my last backup yesterday I probably only installed 3-4 other apps that I had lost and organized/moved files on the phone. So get this problem if shortly after that everything worked fine is staggering.

    Another update: it seemed to me I found the problem.  While RIM support recommended I do a reset, I pushed the rest of the phone feature seems to work very well.  I opted to start removing the one phone applications and then try to connect to the Desktop Manager.

    Once I removed the ZDNet Tech News For the IT professional and rebooted the phone, I was able to connect and make a backup. I'm sure this app works very well for almost everyone, but for some reason (maybe it is in conflict with another application on my phone), Desktop Manager does not do that and close. Initially, I reinstalled again and was able to make a new backup but an hour later Desktop Manager stops again (perhaps by doing an update on the news it creates a conflict with the Desktop Manager).

    Indeed summary of learning since my problem seems to be quite uniqueCurve 8900)

    (1) if the Director of bureau stops and you have tried other solutions on the forums such as deleting the folder Intellisync and reinstalling Desktop Manager, try to remove applications 1 by 1 and restart the phone before trying to connect again to Desktop Manager.

    (2) If you have had this problem, frequently make backups and keep track of what you add to your phone in case there is a problem you know the latest apps to remove (in my case, I couldn't go to my last backup since DM would be closed with the conflict of the app).

    (3) only consider a wipe of the device if you have exhausted your apps withdrawal tests.  Apps that came on your phone which notes the seller in the section about the application that RIM should be good.  Also while on AppWorld apps are offered by BlackBerry, there is no certainty that they will work on your phone.

  • Question about Lab Manager and ESX Resource Pools

    Hello world

    I was wondering if I can get feedback from some of the members of the community.  We used Lab Manager very strongly in our support organizations and it has proved to be a valuable tool.  Recently, we collaborated with the Department of technical training and started hosting online seminars and classes for them using Lab Manager.  Last week we had a fairly large class of users (approx. 45), each duty deploy 2 rather Beefy VMs that were very intensive resources (Jboss, SQL, Mail to name a few).  My colleague and I went through a lot of trials and planning to ensure that our infrastructure can handle the load while allowing our users to date at the same speed and reliability, so that they are used.

    Our Lab Manager ESX server pools made up of the following:

    5 HP DL380 G5 servers with 2 x Quad Core 2.8 GHZ processors (8 cores each) with 32 GB of RAM each

    2 HP DL580 G5 servers with 4 x Quad Core 2.8 GHZ processors (16 cores each) with 128 GB of RAM each

    When the class is running and everyone has made their 2 machines, we noticed for some reason, he was all on ESX2 and 3 deployment (380 s).  Then came the ESX alarms, use of 90% of memory, then more than 100% bringing the disk page.  The CPU usage was at a all time high.

    I look at the 2 580 s and there are about 4 virtual machines deployed on them.

    So my question is...

    How does he know where to launch a Virtual Lab Manager machine?  There's no sense 2 servers have been brought to the red zone, and almost overloaded when the 2 most powerful servers in my farm are nearly dormant.  I noticed sometimes in the past, but not this bad.  Normally, we have about 45-50 computers deployed at some point and it seems to spread them out properly.

    This group of training has access to the same LUN and ESX server with Betclick as any other organization that we have.

    We have decided hosting several sessions of training may be greater than this one and would like to know that the virtual machines will be distributed properly.

    I would like to know your opinion on this

    First to answer your question, then make guess what happens.

    As indicated in response Ilya, LM distributed VMs differently with active DRS resource pools and pools of resources without active DRS.

    LM place VMs when the DRS is not used.

    When DRS is used, we use the DRS admission control to select the host to place virtual machines.

    DRS is turned off, LM uses its own placement routine:

    For each virtual machine, LM filter all managed servers that cannot run the virtual machine. A complete list of patterns are:

    • The managed server has not enough memory or quota for virtual machine to run the virtual machine.

    • The host is not connected to the data store that is the virtual machine.

    • The virtual machine has active state (suspended) and the CPU of the server managed by the waking state has been captured is not compatible with the managed server currently considered.

    • The virtual machine has been a guest on 64-bit and the managed server is not 64-bit capable.

    • The virtual machine has more processors than the managed server.

    • The managed server is not accessible or is set to "prohibit deployments." Not reachable may mean that the lm-agent or its not to ping queries is not answer (this is visible in the list of managed server page).

    Once we have the complete list of eligible servers, we place the virtual machines on the host including the smallest (MemoryReservation % + CPUReservation %). By default, we reserve not CPU on LM VMs, this internship will be largely due to the memory on the host computers if you have not changed the settings of reservation of CPU on your virtual machines.

    For closed deploy to the PF3, force us all virtual machines to go on the same host, so if any virtual machines have any special data store / CPU type specification, all virtual machines is forced to go on this host. If there are conflicting requirements between different virtual machines in the same configuration, deployment will fail. Closed VMs also have another condition to check that is rarely achieved in practice: number of closed networks available on the managed server. By default, this is 20 and you will need more than 20 different configurations closed running on a managed server before you who will strike.  (LM4 allows Cross fencing host, so this does not apply in LM4).

    To make a guess blind because of your distribution problem - if you use the saved state and fencing, it's probably the type of processor.  Processor type can be checked on the host properties page.

    If you not are not I would check that the images can deploy on the 580 s by disabling the 380s and trying to deploy them.

    If you use DRS (which you're not), it could be due to deployment of virtual machines too fast for the algorithm of control for the entrance of VC.  An easy solution for this is to extinguish the DRS on the cluster manager of laboratory.

    We tested load internal repeatedly, the product QA in different laboratories, we run (LM has been used in VMworld Labs for the past couple years and internal systems of training and demonstration for our Organization implemented SE), so no need to worry about this.  I assure you that the first 'real' performance problem you will encounter will be almost certainly due to an overload of your storage array (too many IOPS / s)... and for that you have to distribute content in data warehouses and use techniques of creating paths to balance the load.

    Kind regards

    Steven

    Another thread on this: http://communities.vmware.com/message/1258902.

  • I looked in the addons Manager and I seem to have 5 versions of java installed console, do I have all or can I disable all, but later?

    I see 5 versions of the java console addons, 6.0.04, 6.0.07, 6.0.10 6.0.12 Manager and 6.0.14.Do I need all these or should I disable all, but later?

    If properly uninstalled plugins for Adobe Reader and Foxit Reader should also uninstalled in the process.

    Be careful with the Windows registry, unless you know what you're doing.

    • Always back up the registry to another source; not the current hard drive.
    • Use a program that will offer to back up the registry keys that you delete.
    • Always have a boot disk (CD/DVD, USB key) just in case you make a mistake.

    You can use Windows search to locate the plugin files and delete them if they are on your hard drive and leave the single registry. Find and delete the following files while Firefox is completely closed. After you delete the files, launch Firefox, look at your plugins, addons > Plugins, to see if the two plugins are gone.

    • The Adobe Reader plugin name: nppdf32.dll
    • Foxit Reader plugin name: npFoxitReaderPlugin.dll

    A few links for you to watch:

    1. Foxit Reader:

    2. Adobe Reader:
  • We are trying to install FSRM (File Server Resource Manager) in windows server 2 k 3 R2 SP2. After installation, its error message that gives as no network device connected. Suggest me!

    Original title: problem in installing FSRM

    We are trying to install FSRM (File Server Resource Manager) in windows server 2 k 3 R2 SP2. After installation, open the FSRM in "All programs", its error message that gives as no network device connected.  Suggest me!

    Hello

    Your question of Windows 7 is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the TechNet Windows 7 networking forum.

    http://social.technet.Microsoft.com/forums/en-us/w7itpronetworking/threads

  • Can not get to start remote access connection manager and the connections don't work Internet

    Original title: wired & wireless connections does not.

    I can not get the remote access connection manager to start and so no internet connection is not working, also I can't open the system restore to go back on this machine. What is this?

    I am running a Dell Studio 1735 PP31L w model number / Edition Vista Home premium.

    Hi Rick,

    1. what happens when you try to start the remote access connection manager? You receive messages or error codes?

    2. you receive error codes or restore messages when you perform the system?

    You can check the status of the following services and make sure that the services are started.

    a. Click Start and type Services in start search and press ENTER.

    b. in the services with the right button on the phone and then click Properties.

    c. under the general tab, select automatic next to startup type.

    d. under the general tab, click Start under the service status and then click apply and then click OK.

    e. Repeat steps c & d to the remote access connection manager and Remote Access Auto Connection Manager service.

    Hope this information is useful.

  • I get the error "on the volume C: default transaction resource manager encountered an error during startup and its metadata has been reset. The data contains the error code. »

    original title: NTFS problem
    Every 5 seconds, I get a warning (event ID 136) that says: "on the volume C: default transaction resource manager encountered an error during startup and its metadata has been reset. The data contains the error code. »

    Immediately followed by an error (event ID 137) that says "on the C: volume default transaction resource manager encountered a one-time error and could not start. The data contains the error code. »

    I am running windows 7 ultimate in any way to solve this problem?

    Hello

    This problem occurs if the Windows file system transaction log is damaged. The Windows file system uses the transaction log to retrieve the system transactions when a file error occurs. The system of common log (CLFS) transaction logs may be left in an inconsistent state. When the CLFS transaction logs are in an inconsistent state.
    To resolve this problem, delete the files .blf and .regtrans-ms in the folder % Windir%\System32\SMI\Store\Machine.
    After you restart the computer, the registry regenerates the deleted files. These regenerated files are in a consistent state.
    1. click on Start , type cmd in the Search box, and then click cmd in the list of programs .

    2. click on run as administratorand then click continue.
    If you are prompted for an administrator password or for confirmation, type the password, or click allow.

    3. at a command prompt, type the following command and press ENTER:
    fsutil resource setautoreset true c:\
    Note
    these steps assume that Windows is installed in the default location, drive C. If this is not the case, adjust the drive letter of the path of the folder to match your configuration.

    4 restart the computer.

    I hope this helps.

  • How can I reinstall the Task Manager and monitor resource for Win 7?

    I saw a lot of similar questions to mine and problems are resolved for the most part because the person is running in mode 'tiny' in the Task Manager.  And, while the problem of the poster has been resolved, I must still be able to find an answer that actually answered the question: how to reinstall a task manager and resource monitor?

    I don't want to seem rude or obnoxious, but that's all I really need to know. Is it possible to reinstall the Task Manager and resource monitor and how - what is done?

    For a more easy, please take the following response,

    I am running Windows 7

    Parts of the the Task Manager and resource monitor will not run correctly (it isn't tiny mode, everything seems as it should be, they are just not all the work)

    I did a lot of research and analysis and virus check

    I do not have a file to restore good system (whatever the reason)

    I decided that I have to reinstall the program

    So my question is simple: how to reinstall a task manager and resource monitor?  I can't find a download for it on the Microsoft.com site file; Maybe it's there, but I'm not.

    Please don't bother spending time trying to figure what's wrong with my system, you will lose your time (this is the part where I'm really NOT trying to be rude, but I tell you the truth).  I did the analysis, controls, etc. etc.  I just need to reinstall.

    So please, could someone just tell me how to reinstall only the Task Manager and resource monitor.  I don't want to have to reinstall the whole system.  It seems to me that it is not necessary; It's only two programs.  It is possible and if so, how?

    I thank very you much for any help.  I hope that was clear, so no one loses time on it unnecessarily.

    You are welcome.

    There is no download for them because they are part of the full operating system.

    See you soon.

  • THE TASK MANAGER AND RESOURCE MONITOR

    WHEN I OPEN THE TASK UNDER PERFORMANCE MANAGER AND PRESS RESOURCE MONITOR DOES NOT OPEN

    Hello

    You are welcome.
    Let us know if face you any problems with Windows in the future.

  • Treo 800w not found in Device Manager and does not connect to ActiveSync

    I just got my Treo 800w and I have ActiveSync it once.  After that, I had a lot of trouble trying to get activesync to say that it was connected to the computer.  After doing some research on Google and help forums looking around, I discovered that the Treo should appear in my device manager when you are connected to the computer.  I went to my device manager and of course, it wasn't there.  After a lot of time trying to make it work, I found that the best thing to do is remove the battery and plug it in again.  Then the computer will find again.

    However, I also learned what was causing my problem and I don't know if it's a windows or a problem of palm, but it is a question.  If you connect a Treo 800w on a WinXP (I don't have Vista so I don't know if this problem exists) and even if you touch it connected the power button on all Windows POPs a message saying a USB device has malfunctioned and will cease to recognize the device.  I then told my wife (the main user of the Treo) to never touch the power button and even less the Treo at all while it is plugged into the computer.

    If this question has already been posted... I'm sorry that I'm not looking for it...

    If you read my entire post it says I already found the solution.  Try all the things you listed didn't work for my problem.  I write only because I believe that it is a bug/problem with palm or windows and the device.  Take the battery, put the battery back in, and reconnect the unit is the only thing that works.

    I also tried to uninstall ActiveSync, reboot, install ActiveSync and the battery... it works too, but it's much faster to just remove the battery then put it back and reconnect the device.

    To answer your other question on ActiveSync Yes, I've got 4.5.

    Message is about: Treo 800w (Sprint)

  • Command line and Resource Manager

    When you use the command line to compile a Robohelp project, is it possible to update the resources shared within the project before generation?

    For example, you have Project1 and uses snippet1 in this project. However, snippet1 has been changed in the Resource Manager (just say, for the sake of argument, that snippet1 is also used in Project2, and you changed the extract it and it synchronized to the Resource Manager). When you do a regular command line compilation, the extract is not updated.

    Is it possible to synchronize the excerpts and images from the resource manager in the project before proceeding with compiling from command line (other than opening the project and sync manually)? After all, if I have to open the project, there is no reason for the compilation command line since I was already there and can just compile the project.

    Thank you!

    I found a way around this!

    RoboHelp does not care if the files are updated through the application or through Windows Explorer (such as copying the latest file in the project folder).

    I created a simple batch file copies and replace any file that is older than the file that is located in the resource manager. This allows RoboHelp pull into the updated files in a command-line compilation. There is always a way!

    However, I found something problematic with the command line compilation. I started a new thread to ask about it.

    http://forums.Adobe.com/thread/1011261

  • Error message 0 x 80004005 Unspecified error trying to connect to either network drives and printers network on the same network or network drives that are on the same workgroup.

    Essentially, this problem started last Friday and I tried all possible combinations and the thing that I know so far about how to solve this problem and I terribly need a solution because I use this laptop in a University to take notes and print them out / store them on the network. Right now I can ping both servers (one is a print server and the other server network file storage), but in both cases, when I try to connect to them using windows Explorer by the name of \\server name\share or \\printserver\ (the other usually allows me to see a table of printers that are in different locations and I choose who I connected to my laptop). The other method, I have tried to use, which works normally and does not now to map the network drive storage is the net use command, if I try this method, I will get a "system error 1231 has occurred the network location cannot be reached". The third method (which is more commonly used I think) is the ability to connect a network drive in Windows Explorer, usually if I use the third method, I get a response from the storage server file asking for user credentials, now I get the same error message as when I try to connect with the first method of.

    The biggest mystery of this all is that this happens regardless if I'm on the wired or wireless, and in both scenarios, I have access to the internet available, but as mentioned above, no access to storage or a network printer.

    * Use at your own risk, but it worked in my case (ensure you know / remember passwords field before doing so).

    If (since) you are using Windows 7 and you suddenly have problems connecting to a resource of the area (especially after a password reset):

    1) go to:->-> advanced user accounts manage user accounts-> manage passwords

    (2) If you see Windows credentials, delete them all.

  • Configure the resource manager

    Hello everyone,

    I try to activate the resource manager in the workspace Business Configuration in order to to use in my projects.

    The State of the configuration is to inactivate. After putting and clicked OK, the status is always to inactivate and my changes have not been taken into account.

    You have a solution please?

    Thank you in advance!

    Thomas

    Try different types of browsers (IE or FF or CHROME), one of them works generally. If this is not the case, try to connect until system administrator (again try all 3 types of browser).

  • Impossible to connect to the smtp server and send an email using javamail.

    Hi all

    I am struggling with sending e-mail with javamail api.

    I've visited a few forums but not be able to solve the problem then post here.

    Details of the situation are:

    1 SMTP - to which we are able to connect with telnet and able to send emails that work even between the firewall.

    2 tried to disable IPV6 from my windows machine 7 after reading something - java tries to connect to smtp with IPV6 and it should be disabled so that javamail work.

    3 has tried to run the same code to a linux environment. in this environment, we are also able to connect to the smtp with telnet server and send mail

    the code I have tried is below.

    import java.util.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    
    public class SendEmail
    {
    public static void main(String [] args){
    String to = "[email protected]";//change accordingly
    String from = "[email protected]";//change accordingly
    String host = "smtp.somthing.com";//or IP address
    
    //Get the session object
    Properties properties = System.getProperties();
    properties.setProperty("mail.debug", "true");
    properties.setProperty("mail.smtp.host", host);
    properties.put("mail.smtp.starttls.enable", "false");
    //properties.put("mail.smtp.port", "25"); //commented as its by default takes 25
    Session session = Session.getDefaultInstance(properties);
    
    ////compose the message
    try{
    MimeMessage message = new MimeMessage(session);
    message.setFrom(new InternetAddress(from));
    message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));
    message.setSubject("Ping");
    message.setText("Hello, this is example of sending email  ");
    
    // Send message
    Transport.send(message);
    System.out.println("message sent successfully....");
    
    }catch (MessagingException mex) {mex.printStackTrace();}
    }
    }
    

    I get the errors are

    DEBUG: JavaMail version 1.4.7
    DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
    DEBUG: Tables of loaded providers
    DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle]}
    DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]}
    DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
    DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]
    DEBUG SMTP: useEhlo true, useAuth false
    DEBUG SMTP: trying to connect to host "smtp.something.com", port 25, isSSL false
    Exception in thread "main" java.lang.RuntimeException: javax.mail.MessagingException: Could not connect to SMTP host: smtp.something.com, port: 25;
      nested exception is:
        java.net.ConnectException: Connection timed out: connect
        at emailer.SendMail.main(SendMail.java:64)
    Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.something.com, port: 25;
      nested exception is:
        java.net.ConnectException: Connection timed out: connect
        at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1961)
        at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)
        at javax.mail.Service.connect(Service.java:295)
        at javax.mail.Service.connect(Service.java:176)
        at emailer.SendMail.main(SendMail.java:58)
    Caused by: java.net.ConnectException: Connection timed out: connect
        at java.net.DualStackPlainSocketImpl.connect0(Native Method)
        at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
        at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
        at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:321)
        at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:237)
        at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1927)
        ... 4 more
    

    someone had a problem like this?

    suggestions are welcome...

    The server I used was not accessible from the telnet command or java code.
    However when I telnet to the server it was implicitly redirected to another server that I failed to notice.

    My sincere apologies to all
    I'll take more precautions before posting and check the facts in more detail.

  • limit of cpu resource manager problem

    Hello world

    I'm testing the resource limit of resource manager. in all the documents I read, after you create groups of consumers, if I gave a resource limit in terms of resources, it is said, this group of consumers won't be able to consume more cpu than that. for ex, 2 consumer group I have one of them gave 90% of cpu and the other (let's call it test_group) 5%, but when I connect with a user who is located in the test_group consumer group. After the execution of some sql/plsql, I noticed that it uses all the cpu.

    EDIT: to the fifth message there is all the code samples and the test results with screenshots.

    for ex in this page: http://pic.dhe.ibm.com/infocenter/mdm/v10r0m0/index.jsp?topic=%2Fcom.ibm.mdmhs.smpl.gd.doc%2Fr_oracle_db_resource_manager_working_example.html

    There is a code example that explain the plan. It is said REPORTING_GROUP is not being able to occupy more than 5% of CPU times in total. I used this code, but reporting_group always be able to consume all the cpu. I tested this code (also I have created a new group and the plan of Enterprise manager) on windows 7 64-bit, intel i7 cpu with 4 core and on the same machine, using the virtual machine oralinux. as database, Enterprise edition 11.2.0.1

    also resources plan is active and working, active session limit or cancel hen size for example, works when I tested it, but CPU limit is not. for testing I used the plsql code.

    create or replace function sf_test(p number) return number as
      x number;
    begin
      select 1 into x from sh.sales where prod_id = p and rownum = 1;
      return 1;
    exception
      when no_data_found then
        return 0;
    end;
    /
    
    
    declare
      x number;
    begin
      for i in 1..50 loop
        for i in 1..10000 loop
          x := sf_Test(i);
        end loop;
      end loop;
    end;
    
    

    I created four session of the Report1 user (in the link I mentioned before) and run this code plsql, at most 5% of cpu if they had but my CPU is overloaded almost every time.

    I missed something here or I got all wrong concept?

    PS: setting resource_limit is true and resouce_plan is the plan that I created. as I said before the plan is active and functional, I know, but may not limit the cpu. I would appreciate it if you help. Thank you very much.

    Looks like the resource manager behave correctly.

    If the session manager are not ask for 95 percent of the CPU resources, what remains will be the users of the report.  Oracle will not starve the UC report sessions if there are a bunch of CPU idle.

    If there are 8 Virtual cores and a bunch of single threaded sessions, you need at least 8 sessions before Manager the Manager could use 95% of the available CPU.  Most likely, you would need 9 or 10.

    If you have only a 6-wire Manager, these discussions could consume at least 6/8 = 75% of the available CPU but probably more than 67% (to pick a number that facilitates the calculation).  There is 33% of the CPU for the report.  There are 4 sessions of report in your screenshot with a little more than 2 cores available and each one seems to spend slightly more than 50% of their time on the CPU, which looks all right.

    Justin

Maybe you are looking for

  • If I set up call forwarding on my Skype Premium plan with online number will be I charged or covered?

    Hi it's very confused, I tried to watch several posts on this topic and have not found a clear answer. I have a Skype Premium Plan that covers Unlimited United States and Canada and a number of Skype online. Now my question is IF I set up on my cell

  • 3 error at startup

    Dear Sir I am getting error every time when I start the laptop System3_.exe missing file. Please suggest the necessary action. I already tried to remove the boot options & registery

  • mobile broadband configuration with the sim card

    Hi, I have a X 220 C "nine" i5: find it difficult to connect to my mobile broadband provider so I made a location profile, set up mobile broadband as follows: in "config for wwan mobile": serviceprovider: base, / name of the APN accespoint: oke/usern

  • Purple problem

    I have problems intermittent purple status on certain built-in and external tests. Usually they clear just a few minutes after going purple. Tests that go purple include:xxx. Conn (where xxx is the host bigbrother himself lives... the bbdisplay hosts

  • How to retrieve data by using nested loops?

    The problem seems to be that he never gets inside the loop in line 13. I don't know if this line of code is correct, because it gives me error in module custom script before it happens inside the loop. I put a plain text inside the loop and it is nev