Studio Creator, Socket Connection to External Device

I am porting an existing & successful project from Netbeans 3.6 into Studio Creator to take advantage of some of the tools in the IDE for this application. The project requires opening a socket connection from the Server PC to an external Device (PLC) that is a Client on a static IP & a dedicated fixed port.
I am struggling to get past some security settings specific to AccessControlExceptions. Here is the code method being used to test:
public String button1_action() {
// Call methods to open connection, init streams, send command, and close connection.
try {
// Open Socket up and accept client connection
ipSocketObject = new ServerSocket(port);
bfSocket = ipSocketObject.accept();
// Establish Streams
is = new BufferedReader(new InputStreamReader(bfSocket.getInputStream()));
os = new PrintWriter(bfSocket.getOutputStream(), true);
System.out.println("Got to here...");
// Clear the msCounter #13002
os.println("r13002=0");
pattern = "13002";
do{ret=is.readLine();} while ((ret.indexOf(pattern)) ==-1);
is.close();
os.close();
bfSocket.close();
ipSocketObject.close();
} catch (IOException e) {
e.printStackTrace();
return null;
The Socket Connection is established, but the command string is not processed before Studio Creator generates a AccessControlException Fault. I have experiemented putting in a SocketPermission statement with out success.
Is anyone aware of some sample code I might be able to review for opening socket connections to clients in a Studio Creator Application? Please excuse this request if too rudimentary- I am an Industrial Controls guy by trade... :)

Sorry I know of no such application at this time, and unfortunately have not done socket work myself for many moons....
What JDK was your previous application written under? I googled for AccessControlException and socket and seems that sometimes accounts for some issues... you can also search for that combination in the forum advanced search and might find something there.... one more long shot suggestion based upon your statement "the command string is not processed".... could it be that you need to flush the stream...?
Sorry I don't have more to offer...
v

Similar Messages

  • Connect to external device using ip address in lan

    Hi,
    I have a external device in lan ,
    ,want to connect this external device using ip address.

    Dhaval.Yoganandi wrote:
    hi ejb,
    may be he wants to connect with the 172.16.0.20 via public network ?And ?
    That has nothing to do with anything. Whether the resource is on the local network or accesible through the internet only is not relevent here at all. This forum is for Java network programming. If a resouce is not available because you are not connected physically to a network that is a network problem. That is not a Java progamming problem.
    Okay?
    There's alot of rubbish posted in this forum about "public networks" and what not and not one lick of it is related to Java programming. Yes if you connect through more routers to something there is a better chance that somewhere along the way that you will hit a firewall or other similar issue. But these are all network issues. Not networking programming issues. And not resolvable directly in Java any way you want to think about it.

  • I cannot connect an external device on my hp envy x2

    i cannot connect an external device on my hp envy x2. My phone, an external hard drive, a printer, an external dvd drive all doesnt show on the laptop.

    Hello dginther,
    Welcome to the HP Forums!
    I understand wireless is not working properly. If the issue just began occurring, I would perform a system restore. I want you to bring the computer back to the earliest restore point possible, in an attempt to dodge whatever caused the issue. Here is a document on how to perform a System Restore: System Restore
    Next, please try the steps in this HP document: Troubleshooting Your Wireless Network and Internet Connection (Windows 8)
    These steps should be enough to resolve the issue. If not, you can try a manual reinstall of the driver:
    1. Go into Device Manager, then Network adapters.
    2. Right-click on the wireless driver, and select "Uninstall".
    3. Restart the computer. This will force the driver to reinstall itself.
    Please let me know the results of your troubleshooting. Thanks!
    Mario
    I worked on behalf of HP.

  • Cloudscape & Java Studio Creator - Need Connection URL for toursDB

    Has anyone been able to create a data source and connect to the bundled demo databases in the default Cloudscape installation (sample or toursDB) with Java Studio Creator on MacOS X.
    I have Cloudscape running ok and I have Java Studio Creator running and I added the "derby.jar" and "derbytools.jar" files to the jar list in Java Studio creator but I'm not sure what the connection URL should be to connect to the example databases.

    Well, I think I now to having everything working!! I was able to connect to one of the sample Clouldscape databases (bundled with the Cloudscape 10.0 distribution in SJCS) - I had to do the following
    --- 1 --- After downloading a Java tool called DbVisualizer Free 4.1.1 and reviewing its documentation I was able to discover how to set an essential Java System Property for it as well as Sun Java Studio Creator on MacOS X. The property was derby.storage.fileSyncTransactionLog=true. This was needed to work around an Apple Java VM problem by bypassing code that uses write sync (rws) mode. The info for this is on the Apache site at: http://www.ibm.com/Search?q=Cloudscape+failures+on+Mac&v=14?=en&cc=zz&Search.x=47&Search.y=10 and the info for setting system properties on "double clickable Java Apps" on MacOS X can be found at: http://www.dbvis.com/products/dbvis/doc/4.1.1/doc/ug/admin/admin.html
    --- 2 --- Using the tool in *1* above I then actually got it to connect to an existing sample bundled Cloudscape database using the following connection URL jdbc:derby:/pathToTheDatabaseDirectory (needed to add the path to the URL) and the userID and Password as user1,user1 for reasons stated in the following forum link http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?forum=370&thread=66046. I also used the driver class org.apache.derby.jdbc.EmbeddedDriver.
    --- 3 --- Finally, using the config info I used in *2* above I then used the following settings in Sun Java Studio Creator
    DataSource Settings Panel Fields set as follows (for Cloudscape 10.0 installation)
    DisplayName ---> Cloudscape
    JDBC Driver Jar Files ---> derby.jar
    Driver Class Name ---> org.apache.derby.jdbc.EmbeddedDriver
    URL Template ---> jdbc:derby:
    And then......Add Data Source panel fields set as follows
    ---DataSourceName --> datasource1
    ---ServerType____ Cloudscape
    ---HostName ---> left this blank
    UserID -> user1
    ---Password ---> user1
    ---DatabaseURL ---> jdbc:derby:/Applications/IBM/Cloudscape_10.0/derbyDB
    ---DriverClass ---> org.apache.derby.jdbc.EmbeddedDriver
    thanks for your help. I had been able to connect to Cloudscape programmatically (which your blog documents well), but getting the Sun Java Studio Creator (SJSC) IDE configured for Cloudscape wasn't obvious. Hopefully the above info in *1* and *3* will help anyone using the SJSC IDE on MacOS X. The DbVisualizer Free 4.1.1 is a slick tool I discovered along the way as well.

  • Cloudscae & Java Studio Creator - Need Connection URL for toursDB

    Has anyone been able to create a data source and connect to the bundled demo databases in the default Cloudscape installation (sample or toursDB) with Java Studio Creator on MacOS X.
    I have Cloudscape running ok and I have Java Studio Creator running and I added the "derby.jar" and "derbytools.jar" files to the jar list in Java Studio creator but I'm not sure what the connection URL should be to connect to the example databases.

    1. load up the embedded driver.
    2. use jdbc:derby:toursDB as the database URL.

  • Socket Connections on Blackberry device

    Hi,
    I have an j2me application that i am testing on a Blackberry 7100t device. The application works fine on a number of other Nokia/Sony devices but seems to have problems with connections on this device.
    It connects to the server fine but seems to continuously bring up an Egg timer when running the app and shows contant communication in the top corner. Is there any way to stop this happening because this constant delay prevents you from using the rest of the app properly?
    Thanks,
    Chris.

    If you use stream sockets your connection will survive for long periods of time. I have an application that connects to a mainframe by sockets and to Oracle using OCI (which uses sockets) that stays up for a week at a time, only stopping when the mainframe goes down for weekly maintenance. It recovers when the mainframe restarts by attempting to reconnect once a minute.
    This said, you still should deal with the inevitable situation where the connection is lost due to network problems or aproblemon your server.

  • Cannot connect locate external devices

    I started a project at school. They have final cut pro. They also have external tape deck to capture footage. I saved the project to my external hard drive and used it on a couple of computers at school. I have final cut express on my macbook. When I open the program it says it cannot locate external device apple firewire NTCS 720x480. I click on continue and it opens. I can open projects that I started on my laptop which I have but cannot open the project I started at school. I get "general error (41) Can any one help?

    FCP has some features that FCE does not.
    Also, not all FCP and FCE versions can interchange.
    Your system is protesting over a clash.
    Al

  • TCP/IP connection with external device

    Hi,
    I need establish TCP/IP connection to my hardware device which has ip(10.102.20.90) and port no as 9012 by setting static ip.
    Since i am new to this protocol i am bit worried about how to make communication between my pc to hardware. Here my labwindow code act as clinet and hardware as server. after establishing successful connection i need to read the data coming out from that port.
    Please help me in making this communication happens.
    i am working on Labwindow 9.0 version.
    Solved!
    Go to Solution.

    A good starting point would be to look at the TCP/IP client sample application that ships with CVI. You'll find it at <CVI Folder>\samples\tcp\client.cws
    Martin.
    Martin
    Certified CVI Developer

  • Tecra M5: How to use HDD password when HDD is connected as external device?

    I have a Toshiba Tecra M5 with MK1032GSX hard disk. I put a bios password and HDD password. Every day I power on my laptop by digit my password only one time: unlock disk and bios. The screen for password is before windows starts.
    One day motherboard of my laptop is broken, I bring my pc on Toshiba support center (less disk), and I waiting for it (2 month ago). I need to read my date from disk but it is locked by password. The disc is SATA disk, I put it on a desktop and I see it in bios and in peripheral of windows resource, but I don't see it in explorer.
    Any of software that I tried (HDD unlock, atapwd...) wont work. I have my password, I have not forgotten it.
    How can I read my date? Can you help me?
    Thank you.

    as far as i know its not possible to remove the hardware password from the HDD other than by using your laptop.
    Still if you google arround I think I saw once something about a Linux distro that was able to unlock some HD's. Not sure if thats still arround but perhaps you can give it a go. Still I would not advise doing something like that has its possible that it messes up your HD and then you will be stuck with a good paperweight.
    The proper course of action when you send ur laptop to warranty is to make a full backup. There are image software out there that allows you to make a mirror image of your HD for example. I, myself, bought a 100GB USB2 2.5' HD that fits my pocket and goes with me everywhere. I've encrypted it with TrueCrypt so no one has access to my sensible information if loose it and I make regular backups from the laptop to this HD. It saved my life at least 2x.
    Just my 2 cents
    Cheers

  • External devices

    Hello, Pls how can i transfer files from my external hard drive and flash to my macbook pro? I've been battling with this problem for quiet some time now;each time I connect any external device,I can't take anything from it.

    Connect the HD or flash drive, select it's Desktop icon, CMD+I, and select Ignore ownership on this volume at the bottom. That should allow you to copy anything from those things.

  • Firewire device looses connection when external screen is inserted into the thunderbolt port? HELP

    HI
    I am a recording studio engineer. Ive got a Firewire AD/DA Converter (Focusrite Saffire Pro 56) running from my Firewire port of my MacBook Pro, which is running OSX Mavericks. I've also got an external Screen I want to use as an extended display. I'm using a HDMI cable from the screen to a HDMI to Thunderbolt Converter which I then plug into my Thurderbolt Port.
    As soon as I plug the screen in, the Firewire Port looses connection completely and I cant use or even choose the Saffire Pro 56 as audio driver. Another thing happens where the Thunderbolt port replaces the Saffire Pro 56 Driver with the screen as the audio output source.
    Please help, there's nothing I can find to fix this.
    Thanks Maurice

    You don't mention which model you have, but this is from the M-Audio Firewire 410 Manual Troubleshooting section:
    The FireWire 410 has been designed to give you high performance and professional quality audio. It has been tested under a wide range
    of systems and operating conditions. In the real world, however, there is a nearly infinite number of possible operating scenarios, any of
    which could affect your system’s performance. Much like owning an automobile, “your mileage may vary.” This section can not begin to
    cover all possible issues you may encounter, however we want to give you some suggestions on common problems you may experience.
    One thing to avoid is connecting too many devices. The FireWire bus is a dependable, high-speed, high-bandwidth protocol which is ideally
    suited for digital audio. Nonetheless, it’s important to remember that audio and multimedia streaming places considerable demands on
    your processor and the FireWire bus. Although it is theoretically possible to chain many multiple FireWire devices in series, doing so may
    potentially degrade your audio performance.
    I guess this degradation could also affect the Firewire HD. Maybe there is a simple fix, but it sounds like the M-Audio people have been down this road before.

  • Can i delevop and app that connects to an external device?

    0down votefavorite
    I am working on a project, where I am supposed to make a wireless connection from iOS (iPhone, iPad) to an external device, for sending and receiving some data. I would like to later publish this app on the App Store. At first I wanted to do the connection by bluetooth, but considering Apple's bluetooth MFi policy I had to reconsider this solution.
    My next idea is to use wi-fi. The iOS device would connect to the external device through a socket, probably using something like NSStream or CFStream. The external device would be configured as a wi-fi access point, with some kind of a server that stores data sent from the iOS app. The stored data would then be used by the external device to generate a signal for some mechanical actuators. The server would provide the app with data about the actuators.
    So my big question is, is this OK by the apple policy? Because if this is possible then I'll sign up for the developer program.

    Hello! First thing to check is the LaCie website to see if there's a firmware upgrade for the drive. Second is the drive formatted and HFS+ or did you use it straight out of the box. If that's the case it may be formatted FAT32 which could be the problem. Tom

  • TS3048 My early 2009 Mac Pro does not connect via bluetooth to my sound bar or bluetooth mini speakers. Both my wireless keyboard and mouse have no problems connecting. What do I need to do to connect to external bluetooth devices?

    My early 2009 Mac Pro does not connect via bluetooth to my sound bar or bluetooth mini speakers. Both my wireless keyboard and mouse have no problems connecting. What do I need to do to connect to external bluetooth devices?

    I would always have a wired keyboard and mouse on hand (need not be expensive ... any cheap wired devices will work).  "Emergency recovery" procedures can activate features in random order, so the opportunity to select a recovery partition may pass before the wireless devices are recognized.
    That will let you select the "turn on Bluetooth" icon.

  • How to make external devices (like iPods, etc.) NOT mount as connected drives when plugged in via USB to a Mac?

    If I plug my iPod (or a thumb drive or whatever) to my Mac's USB port, the device appears as a icon representing a connected drive on my Mac's Desktop.
    This is normal, expected behavior.
    HOWEVER, in some cases, I'd prefer that the device not "mount" as a connected external drive.
    With thumb drives or external USB drive, of course, I want them to "mount" so I can transfer files on or off them -- that would be the only possible reason to connect an external drive like that.
    But with other Apple devices like iPods or iPhones, there are TWO possible reasons to connect them to a Mac: either to "sync" them or transfer files on/off them; OR, to simply recharge the device's battery. (Or, both sync and recharging functions at once.)
    For those people who use their Apple devices in ways that require transferring files (i.e. most people), then having the device "mount" as a connected device is a desirable behavior.
    But in my circumstance (and I bet there are a lot of people in a similar circumstance), I have no need or desire to transfer any data to or from my device every time I plug it into my Mac: I'm plugging it in SOLELY to recharge the device's battery.
    Specifically, in my case, I have a 6th-gen iPod Nano, and I use it exclusively as an FM radio and a pedometer. I don't have any mp3s or songs or any other external files loaded on it, nor do I plan to add any in the future.
    The only reason I ever plug it into my Mac is so that I can recharge the iPod's battery.
    But the "problem," which is a minor one I admit but a problem nonetheless, is that every time I connect the iPod to the Mac, the iPod appears as a "connected drive" icon on my Mac's desktop. Which means that I'm not supposed to just unplug the iPod  when I'm done -- first, I have to find its icon on the Mac Desktop, and then drag the icon to the Trash, to "unmount" it -- and only then can I freely unplug the iPod without getting an error message telling me that I shouldn't just disconnect connected drives without first properly unmounting them.
    This would be bothersome enough if I only had to do it once per connection, but in the case of the iPod Nano, there's no way to tell how recharged it is while it is in the act of recharging, so that to see if I'm "done," I have to unplug it, check the battery status, and if it's not fully charged, re-plug it back in. So that each time I recharge it, I often have to unmount the drive several times, depending on how impatient I am.
    There has to be a way to prevent the mounting of the drives of devices that one is connecting simply for the purpose of recharging. But how?
    Strangely, I also have an old iPhone, and when I plug that in for recharging in the same way, it DOESN'T appear as a connected drive on the Desktop. I'm not sure how I managed to do this, but long ago I must have changed some setting or preference for this to happen. And by now I've forgotten what I did.
    I'd prefer that I could change the "mount/don't-mount" setting on a device-by-device basis -- i.e. make it such that this particular iPod doesn't load, but perhaps a different iPod would load -- but if that's not possible, then is there a way to stop ALL iPods and iPhones from loading as connected drives when plugged in?
    (I'm not talking about appearing as connected drives within iTunes -- I'm talking about appearing as an icon on the Desktop in the Finder.)
    And please don't tell me to just buy a wall charger! I prefer to recharge off my computer if possible, using the charging cord that came with the iPod.
    I presume there's some simple setting to toggle this on or off, but I haven't yet found it. Any clues would be appreciated. Thanks!

    Well, I already know about that Finder Preferences option, but that is not what I'm looking for. Why not? Because I still need CDs and DVDs to appear on the Desktop and mount properly! If I uncheck the "CDs, DVDs and iPods" option, then I lose the ability to access CDs and DVDs, which creates a whole new problem for me. What I want is to not mount iPods only -- actually, what I really want is to not mount this particular iPod -- but if that level of specificity is not possible, then I want to exclude just iPods from mounting, without also condemning CDs and DVDs (or whatever) to invisibility.
    Also, I was confused by the way the Preference is worded: It says "Show these items on the Desktop," with a series of options to check. But this phraseology seems to mean that the unchecked items will still "mount," they simply won't appear as Desktop icons. One would still have to "Eject" them using a menu command, rather than dragging the icon to the Trash -- right? Or am I mistaken, and is the Preference Pane simply badly worded, and when they say "Show these items on the Desktop," what they really mean is "mount these external devices as connected drives." So that if a category is unchecked, then they won't load as external drives at all?
    But if so, then what purpose could possibly be served by inserting a CD or DVD that is not recognized by the computer? And if it isn't recognized, then it would seem that there would be no way to ever Eject the CD or DVD disk. Right?
    Thus, if I uncheck that Finder Preference box you suggest, one of two outcomes will result:
    -- Either CD, DVDs and iPods are still mounted, they just won't appear as icons on the Desktop; but they would still need to be Ejected via a menu command, which doesn't solve my problem.
    -- Or, CDs, DVDs and iPods are not mounted or recognized by the computer at all, which means that if I insert a disk into the disk drive, it will get stuck there forever, since there's no way to Eject it, since the OS doesn't recognize that it's even there. Which is thereby a new problem.
    Either way, I'd have a problem! Or...? Clarification, anyone?

  • Is there any way to see if a file has been saved to an external device, or to see a history of which external devics have been connected to an iMac in 10.6.7?

    I have a client that believes someone came into his house and took some digital files (photos, stored in iPhoto) off of his iMac (2.66GHz running v10.6.7)
    He usually just sleeps his computer while away and requires no password to login.  Is there any way to see if an external device or CD/DVD has been used to save files?  Is there any wya to see the history of a file and determine if it has been saved anywhere else?  I know this is a long shot, but I figure it is worth asking.

    Will it continue to say that the device is in lost mode if it has been restored?  My Find Iphone is saying that when the device is connected to the internet that it will be locked and that a message (that I typed in) will appear. It also says that I will be notified and that a sound will occur when it is connected. Now my iphone has been updated to the ios7, but I don't think his ipod was updated.

Maybe you are looking for

  • Hyperlinks in standard texts

    hi all i was sending a mail from sap to my local inbox. the contents of the mail are stored in standard text. when i receive the mail my hyper link is broken. see ex below : http:/abcde.com.abcd/efgh/aklsdjfkjs/ajsdlfj/ajsdlfjalksjfl/askdkfjl/aac = d

  • Stats

    Hi Experts, For how many days once we have to gather statistics of a table. Let us say for example I have gathered the statistics of a table on 12-Dec-2010 after how many days(on what date) again I have to gather the statistics of a table. And also p

  • What are the internal table events

    hi experts can u help me for this

  • BT Infinity date changed again?

    Hiya, Can you tell me if its still end June we get Infinity in Banbury or has it been delayed till end Sept please? Just I have 2 different dates now, thanks  

  • Error when sneding payment advice email notification

    Hi All, I have a problem with program RFFOAVIS_FPAYM, when i am running this to send email notification for payment advices , its giving an error : f0387 : dispatch via e-mail not poss. Please help me how to solve this and what is the cause for this