JApplet Bad Path/ClassNotFoundException

I am writing a JApplet that of course runs fine using an appletviewer but gives me the following error in IE or Netscape (copied from the Java console)
com.ms.security.SecurityExceptionEx[Host]: java.io.IOException: bad path: C:\cs101\RITA\apppack\javax\swing\JApplet.class
at com/ms/security/permissions/FileIOPermission.check (FileIOPermission.java)
at com/ms/security/PolicyEngine.deepCheck (PolicyEngine.java)
at com/ms/security/PolicyEngine.checkPermission (PolicyEngine.java)
at com/ms/security/StandardSecurityManager.chk (StandardSecurityManager.java)
at com/ms/security/StandardSecurityManager.checkRead (StandardSecurityManager.java)
at java/io/File.isDirectory (File.java)
at sun/net/www/protocol/file/FileURLConnection.connect (FileURLConnection.java)
at sun/net/www/protocol/file/FileURLConnection.getInputStream (FileURLConnection.java)
at com/ms/vm/loader/ResourceLoader.getURLData (ResourceLoader.java)
at com/ms/vm/loader/ResourceLoader.getCodebaseRelativeData (ResourceLoader.java)
at com/ms/vm/loader/ResourceLoader.getClassData (ResourceLoader.java)
at com/ms/vm/loader/URLClassLoader.findClass (URLClassLoader.java)
at com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)
at java/lang/ClassLoader.loadClassInternal (ClassLoader.java)
at java/lang/ClassLoader.resolveClass (ClassLoader.java)
at com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)
at com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)
at com/ms/applet/AppletPanel.securedClassLoad (AppletPanel.java)
at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
at com/ms/applet/AppletPanel.run (AppletPanel.java)
at java/lang/Thread.run (Thread.java)
java.lang.ClassNotFoundException: javax.swing.JApplet
at com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)
at java/lang/ClassLoader.loadClassInternal (ClassLoader.java)
at java/lang/ClassLoader.resolveClass (ClassLoader.java)
at com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)
at com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)
at com/ms/applet/AppletPanel.securedClassLoad (AppletPanel.java)
at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
at com/ms/applet/AppletPanel.run (AppletPanel.java)
at java/lang/Thread.run (Thread.java)
I have the Java 1.3.1 Plug-in for swing installed but I am not sure I am using it. What I mean is I think I need to switch my VM from Microsoft's VM to something that allows swing and I have no idea how to do this... Please Help!!! Thanks in advance :)

This problem occurred because your applet is trying to access files byapplet, for your application access files you shall signed you applet, or you can use policytool in your jdk1.3/bin and give permission for FilePermission.
For use the Plugin you can do download the HTMLConverter and convert your old html code for new html code.
http://www.java.sun.com/products/plugin/1.3/docs/html_converter.html
Best Regards,
Isa�as Cristiano Barroso

Similar Messages

  • SQL SERVER 2014 Developer - SQL Server Management Studio (SSMS) - Tools in Toolbox are disabled because of bad path to DTS

    Hello all,
    after populating the Toolbox of SSMS  with the "Maintenance Plan Tasks" all task are disabled. The reason is simple a bad path to the DTS modules. The path in the Toolbox points to ...\DTSTasks\... Installation has created a path of ...\DTS\Tasks\...
    This is clearly a bug. But perhaps there is a workaround by changing something in the configuration. Any idea where to look for the responsible configuration file?
    Regards Uwe

    Hi Uwe,
    Based on my research, just as you said, the path of Maintenance Tasks in the Choose Toolbox Items dialog box points to ...\DTSTasks\..., but the actual path is...\DTS\Tasks\....I can reproduce the issue in my SQL Server 2014, SQL Server 2012 and SQL Server
    2008 R2 environments. It seems that this is a known issue. But the issue doesn’t affect the use of maintenance tasks, we can still drag the tasks to design the maintenance plan.
    If you have concern about this issue, it is my pleasure to help you to reflect your recommendation to the proper department for their consideration. Please feel free to submit your situation on our product to the following link
    https://connect.microsoft.com/SQLServer/. Your feedback is valuable for us to improve our products and increase the level of service provided.
    As to the issue that all tasks are disabled in the Toolbox of "Maintenance Plan Tasks", please make sure that you have selected the tasks in the Choose Toolbox Items dialog box. Then double-click the task in Toolbox pane or drag the task to maintenance
    design tab.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • Warning: [path] bad path element

    Hello Everybody,
    I am building a project in Eclipse , using an ant build.
    I used the Xlint Option , to determine the usage of deprecated API's.
    I am building the project against JRE 1.5. I get the following compiler warnings
    [javac] warning: [path] bad path element "C:\Views\snapshot\JRE5__cpnm2_0_proto.ntss\enm_herbie\framework\tools\external\jakarta-ant-1.5.1\lib\xalan.jar": no such file or directory
    [javac] warning: [path] bad path element "C:\Views\snapshot\JRE5__cpnm2_0_proto.ntss\enm_herbie\framework\tools\external\jakarta-ant-1.5.1\lib\xalan.jar": no such file or directory
    [javac] warning: [path] bad path element "C:\Views\snapshot\JRE5__cpnm2_0_proto.ntss\enm_herbie\framework\tools\external\Castor\xerces.jar": no such file or directory
    [javac] warning: [path] bad path element "C:\Views\snapshot\JRE5__cpnm2_0_proto.ntss\enm_herbie\framework\tools\external\Castor\jdbc-se2.0.jar": no such file or directory
    [javac] warning: [path] bad path element "C:\Views\snapshot\JRE5__cpnm2_0_proto.ntss\enm_herbie\framework\tools\external\Castor\jndi.jar": no such file or directory
    [javac] warning: [path] bad path element "C:\Views\snapshot\JRE5__cpnm2_0_proto.ntss\enm_herbie\framework\tools\external\Castor\jta1.0.1.jar": no such file or directory
    [javac] warning: [path] bad path element "C:\Views\snapshot\JRE5__cpnm2_0_proto.ntss\enm_herbie\framework\tpp\JavaMail1.4\lib\jcommon-1.0.0.jar": no such file or directory.
    any idea as to why this is happening? what is that I need to chnage , in order to fix it ?
    Thank you so much.

    Thank you so much,
    I used the Xlint:path , option , the compiler output is still the same,
    I still get the path related warnings.
    According to the documentation online,
    Xlint:path , will basically remove all the path related warnings, but I have to figure out , as to how the compiler is even referring to these missing jars, even though the ant build.xml does not make a reference to them

  • -Xlint:path : bad path element

    When i compile my code with the compiler optione "-Xlint:path" I get several warnings, e.g.:
    warning: [path] bad path element "D:\data\iComps\icf\prg\java\bin\lib\xercesImpl-2.2.1.jar": no such file or directory   All of them don't exist because I don't need them. I remember that I had them long time ago in my classpath, but changed it and also deleted those files. My classpath doesn't have these files and i don't need them. I also searched my source/config/properties files for these occurences but didn't find them. I don't have these files in my classpath and Eclipse project classpath and it compiles and runs fine. So where the hell is the 5.0 compiler getting these paths from?

    nothing as i don't have a CLASSPATH environment variable. I use an IDE (Eclipse) and Apache ANT with a classpath property. I searched my files for such substrings (also eclipse workspace, my whole porject folder on the harddisc) but can't find any occurence. this is really strange ...

  • Jni.h bad path of jni_md.h j2sdk1.4.2

    in line 27, on include segment, we found:
    include "jni_md.h" <<<< this bad
    include "linux/jni_md.h" <<<<< this ok
    en la linea 27, en el segmento include del archivo jni.h, esta escrito:
    include "jni_md.h"
    lo cual esta mal, pues el archivo al que se hace referencia esta en la carpeta linux/, carpeta incluida en la instalacion de j2sdk1.4.2...
    ese error me estaba generando aproximadamente 2000 lineas de errores al tratar de instalar jpl.
    aun no lo puedo instalar, pero los errores ya no hacen referencia a java.

    Hi all,
    I am not getting the errors anymore. But now, when I do java HelloWorld, there is no output. In the C program, I am printing Hello World.
    This is what I did to get rid of the errors:
    Installed cygwin with gcc, gcc-mingw tools. Then the compilation works just fine.
    If anyone knows why the program is not printing the output to the screen and can share it with me, I would appreciate it.
    thanks in advance
    raaga

  • Bad path in embedded links

    After moving a server I discovered users at a remote site had been using an IP address in their links. I now have thousands of documents each with around 50 images that don't load. I confess I've never used Indesign. Is there anything I can do to help the users.

    Yes, you can post full details of this including the version of InDesign in the InDesign forum.
    This forum is for suite specific issues only.
    Bob

  • When updating .lbi files in DreamWeaver CS4 I get an invalid path.

    When I make changes to my .lbi files in DreamWeaver CS4 I and try to update them I am getting
       item Library\dreamweaver\themed_image.lbiE:\RCG\Web Sites\2011 RCG Working Web Site\Library\dreamweaver\themed_image.lbi contains an invalid path.
        item Library\dreamweaver\logo.lbiE:\RCG\Web Sites\2011 RCG Working Web Site\Library\dreamweaver\logo.lbi contains an invalid path.
        item Library\dreamweaver\icons.lbiE:\RCG\Web Sites\2011 RCG Working Web Site\Library\dreamweaver\icons.lbi contains an invalid path.
        item Library\dreamweaver\menu_top.lbiE:\RCG\Web Sites\2011 RCG Working Web Site\Library\dreamweaver\menu_top.lbi contains an invalid path.
        item Library\dreamweaver\menu_side.lbiE:\RCG\Web Sites\2011 RCG Working Web Site\Library\dreamweaver\menu_side.lbi contains an invalid path.
        item Library\dreamweaver\$_whats_new.lbiE:\RCG\Web Sites\2011 RCG Working Web Site\Library\dreamweaver\$_whats_new.lbi contains an invalid path.
      files examined: 136
      files updated: 0
      files which could not be updated: 0
    total time: (0:00:13)
    Here is the code in one of the files for my side menu.. I do not see what is wrong and was wondering if anyone could help. Thank you.
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <!--
      <div class="maincontainer">
            <table style="width: 100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                    <table style="width: 100%" cellpadding="0" cellspacing="0">
                        <tr>
                            <td class="headerleft"><h3>MainMenu</h3></td>
                            <td class="headerright"> </td>
                        </tr>
                    </table>
                    </td>
                </tr>
                <tr>
                    <td>
                    <table style="width: 100%" cellpadding="0" cellspacing="0">
                        <tr>
                            <td class="leftcolumn"></td>
                            <td class="maincontent">
    -->   
    <div class="maincontent">   
    <h3>MainMenu</h3>               
    <div class="bg">
    <!-- menu  -->
    <div id="ddsidemenubar" class="sidemenu">
    <ul>
    <li><a href="../../index.htm"             title="Home">                        <span>Home</span></a></li>
    <li><a href="../../catalog_opening.html"         title="Catalog"     rel="sub1">        <span>Catalog</span></a></li>
    <li><a href="../../services.htm"         title="Services"    rel="sub2">        <span>Services</span></a></li>
    <li><a href="../../photo_gallery.htm"     title="Photos">Gallery<span></span></a></li>
    <li><a href="../../sitemap.htm"         title="Search">                        <span>Search</span></a></li>
    </ul>
    </div>
    <script type="text/javascript">
    ddlevelsmenu.setup("ddsidemenubar", "sidebar") //ddlevelsmenu.setup("mainmenuid", "topbar|sidebar")
    </script>
    <!--Side Drop Down Menu 1 HTML-->
    <ul id="sub1" class="ddsubmenustyle sidesubmenu">
    <li><a href="../../catalog_opening.html">Senior Class T-Shirts</a>
      <ul>
        <li><a href="../../catalog_seniorclass.html">Page 1</a></li>
        <li><a href="../../catalog_seniorclass2.html">Page 2</a></li>
      </ul>
    </li>
    <li><a href="../../catalog_opening.html">School T-Shirts</a>
      <ul>
        <li><a href="../../catalog_school1.html">Page 1</a></li>
        <li><a href="../../catalog_school2.html">Page 2</a></li>
      </ul>
    </li>
    <li><a href="../../catalog_opening.html">Montana T-Shirts</a>
      <ul>
        <li><a href="../../catalog_montana1.html">Page 1</a></li>
        <li><a href="../../catalog_montana2.html">Page 2</a></li>
        <li><a href="../../catalog_montana3.html">Page 3</a></li>
        </ul>
    </li>
    <li><a href="../../catalog_misc.html">Misc T-Shirts</a>
      </li>
    </ul>
    <!--Side Drop Down Menu 2 HTML-->
    <ul id="sub2" class="ddsubmenustyle sidesubmenu">
    <li><a href="../../direct_to_garment.html">T-Shirt Printing</a> </li>
    <li><a href="../../computer_design.html">Computer Design</a> </li>
    <li><a href="../../signs.html">Signs</a> </li>
    <li><a href="../../vehicle_graphics_and_wraps.html">Vehicle Graphics/Wraps</a> </li>
    <li><a href="../../airbrush.html">Airbrush</a> </li>
    </ul>
    <!--Side Drop Down Menu 3 HTML-->
    <!-- end menu / do not edit beyond this line -->
    </div></div>
    <!--
                            </td>
                            <td class="rightcolumn"></td>
                        </tr>
                    </table>
                    </td>
                </tr>
                <tr>
                    <td>
                    <table style="width: 100%" cellpadding="0" cellspacing="0">
                        <tr>
                            <td class="bottomleft"> </td>
                            <td class="bottomright"> </td>
                        </tr>
                    </table>
                    </td>
                </tr>
            </table>
    </div>
    -->

    Are all of your pages that are linked to this on the same directory level?
    The ../../ in front of every link means "go up two directory levels". If there are no pages, or if some of the pages are not at that directory level, the links would be going to nothing.
    I don't use library items myself, so I'm not sure if that has anything to do with it, but the "bad path" in your error report leads me to think some of those paths (since they're the only ones in the code) could be pointing to the wrong locations.
    My response will also bump your question back to the top of the pile. Maybe someone else will have a good idea of what's actually happening.

  • How do I reference "ok" button in file path?

    Here's a quick question, I am using the LabVIEW file path control icon, when you hit the little file browser up pops the window where one can browse  and select a file. Once they are happy they can hit the OK button. I am trying to embed this as a part of another program which I want to wait until the OK button is pressed. Where is the property node for the "OK" button? I can't seem to find it.
    Attachments:
    picture of path.png ‏26 KB
    path2.png ‏54 KB

    altenbach wrote:
    adamsdaq wrote:
    I want to wait in the program I am running. The real issue is I have the individual instance of this VI working great, however when I go to run it as a subVI embedded in a higher level program, if the path control is empty or has the wrong value the progam is not giving the operator the time to change it. Thus it would be very nice if some how I could use the operator acknowledging the correct path as a precursor to continuing with the program. I must admit I have very little experience programming in LabVIEW.
    You can check the validity of the path, and if it is not suitable, call a file dialog function. Check the new path and also if the dialog go canceled and proceed as needed (ignore error, ask again, etc.)
    Expection handling and such really needs to be done in code and LabVIEW has a rich selection of options. Is the path received from a connector to the subVI? Under what conditions is it empty?
    I agree.  I also feel it is far better to prevent the user from doing something wrong than it is to let them do it and then try to recover from it.  For instance, I'd keep the "OK" button grayed out until a valid path was entered.  That way you avoid having to recover from "bad path was chosen after pressing 'OK'."
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Invalid Path error

    Hi, I'm using iplanet, but I'm sure the principle is the same for any server, ie. tomcat etc.
    Using struts, there are certain urls (usually concerning .do extensions) that cause the server to complain - Invalid path /bal/bla was requested. These are genuinely bad paths, but the kind of thing that a user may accidentally enter.
    Is there somewhere (in the web.xml?) that I can specify a catch-all page that the server will redirect to in the case of such errors? Remember it's not an exception of any kind, so the usual exception page thing doesn't work.

    Dissapointing not to get any responses, I thought this would probably be quite straightforward.

  • Wrong paths in WGM Home tab.  How to correct?

    I'm having some trouble with creating home directories on my server. The create button is not working and there are a couple of bad paths in the WGM Home tab. How can I delete these entries in the Home tab and make sure that only valid paths are in there. I am unable to delete a couple, the minus button is greyed out.
    Just to provide a little further info, I had DNS running on this server (I think incorrectly) and one of the paths that I cannot delete is a path listing the server with it's DNS name /Network/Servers/ns.eocserver.local/Users/<user>.
    The path should be /Network/Servers/eocserver.local/Users/<user>. How do I clean up these entries?

    Here's another interesting aspect to my predicament. If I log into terminal, instead of showing:
    eocserver:~ administrator$
    for my terminal prompt i get the following:
    ns:~ admin$
    My server is called "eocserver" and not "ns" and my DNS is now shut down.
    Another curious thing is that now any new accounts that are created load on the client eMacs within a second compared to at least 30 seconds before this all happened. Not sure why that is but that part is awesome. Since the day this server was set up clients have had to wait for at least 30 seconds for their accounts to load on the client machines.
    It's like something went wrong and as a result the login process for clients is way better. This is rather disconcerting and I'd like to clean it up but I don't want the lag to return.

  • Path Finder in a 2D Grid Map With Different Terrain Types

         I have been thinking for a while on path finding game algoritms and I can up with one idea witch I want to publish. The goal of my project is when I have a 2 dimensional grid map where squares can have different movement cost, like in Civilization II, to find the shortest way from one point in the map to another. I've used the Breathed First Search Engine. If you are not familiar to this search engine it is better to read about it first because I am not fcusing on it and I assume that you now how it works. You can read about it at the book "Practical Artificial Intelligence Programming in Java" writen by Mark Watson, witch is freely distributed at www.markwatson.com.
         Actually the idea of this 2D grid path finder is to use a third dimension witch have a size equal to the highest movement cost among all terrain types. This helps solving the problem with the different movement cost of the squates. By adding this abstract third dimension it is posible to use the Breadth First Search Engine.
         I this example the movementcost of a terrain type is always the same, no matter from witch square to with are you going (like in Civilization II but I haven't included roads or railroads). For example if you want to go from one square A to another square B with movement cost X (A and B are attached) you must go "up stairs" in the third dimension X - 1 times and then move to square B. But when you step on square B you are again at the lowest floor. So if you want to come back to the previous square A and it have movement cost Y first you must go floor Y and then jump in square A. And now you are again at the lowest floor at square A. When you move from one square to another you go always at the lowest floor. This is the way I handle with different movement costs.
         When you find the path to the goal point it is in 3 dimensions. So you must just project it in the 2D map and that's all you have the shortest path.
         I am sure this is not the best way to code this search engine but this is just the first scratch with no optimisation and so on. If I make a 100x100 randomly generated map it takes on my configuration(400Mhz Pentium II CPU with ASUS P2B MotherBoard on 100 MHz and 256 MB SD RAM on 133 MHz but because of my MB on 100MHz) around 1000 miliseconds (1000 miliseconds = 1 second) to find the shortest path from (1, 1) to (100, 100) witch is pretty good compare to the goTo function in Civilization II witch does not finds the shortest path at all and have made hundrets of gamers angry. This is amazing that nowadays there are so many games with bad path finding.
         This project includes:
    1. The PathFinder class witch does the jub.
    2. The Map class witch has a generator for a random map in it.
    3. The class TerrainType, every square on the map is based on this class.
    4. The class TerrainTypes witch is the set of all terrain types used in the map.
    5. The class PathFinderTest witch just test the path finder.
    To test this project put all files in one directory and run PathFinderTest.java.
    Map.java:
    import java.util.Vector;
    import java.util.Random;
    //This class just creates a random map and keeps it. I will not comment on this.
    class Map {
      //here is kept the information about the terrain types placed in the map. Where
      //every terrain type has a specific movement cost.
      private int[][] terrain;
      public TerrainTypes terrainTypes;
      private int landMass;
      private int width;
      private int height;
      private int highestMovementCost;
      public Map(int aWidth, int aHeight) {
        width = aWidth;
        height = aHeight;
        terrainTypes = new TerrainTypes();
        highestMovementCost = terrainTypes.getHighestMovementCost();
        terrain = new int[width][height];
        landMass = 0;
        generateRandomMap();
      public void clearGoalAndStartLocFromWater(int sx, int sy, int gx, int gy) {
        terrain[gx][gy] = 0;
        terrain[sx][sy] = 0;
      private void expandWater() {
        int waterConstant = 40;
        int waterExpansion = 2;
        int[][] moreWater = new int[width][height];
        Random randomizer = new Random();
        for (int t = 0; waterExpansion > t; t++) {
          for (int i = 0; i < width; i++) {
            for (int j = 0; j < height; j++) {
              if (i + 1 >= 0 && j >= 0 && i + 1 < width && j < height) {
                if (terrain[i + 1][j] != 4) {
                  if (randomizer.nextInt(waterConstant) == 0)
                    moreWater[i + 1][j] = 1;
              if (i + 1 >= 0 && j - 1 >= 0 && i + 1 < width && j - 1 < height) {
                if (terrain[i + 1][j - 1] != 4) {
                  if (randomizer.nextInt(waterConstant) == 0)
                    moreWater[i + 1][j - 1] = 1;
              if (i >= 0 && j - 1 >= 0 && i < width && j - 1 < height) {
                if (terrain[i][j - 1] != 4) {
                  if (randomizer.nextInt(waterConstant) == 0)
                    moreWater[i][j - 1] = 1;
              if (i - 1 >= 0 && j - 1 >= 0 && i - 1 < width && j - 1 < height) {
                if (terrain[i - 1][j - 1] != 4) {
                  if (randomizer.nextInt(waterConstant) == 0)
                    moreWater[i - 1][j - 1] = 1;
              if (i - 1 >= 0 && j >= 0 && i - 1 < width && j < height) {
                if (terrain[i - 1][j] != 4) {
                  if (randomizer.nextInt(waterConstant) == 0)
                    moreWater[i - 1][j] = 1;
              if (i - 1 >= 0 && j + 1 >= 0 && i - 1 < width && j + 1 < height) {
                if (terrain[i - 1][j + 1] != 4) {
                  if (randomizer.nextInt(waterConstant) == 0)
                    moreWater[i - 1][j + 1] = 1;
              if (i >= 0 && j + 1 >= 0 && i < width && j + 1 < height) {
                if (terrain[i][j + 1] != 4) {
                  if (randomizer.nextInt(waterConstant) == 0)
                    moreWater[i][j + 1] = 1;
              if (i + 1 >= 0 && j + 1 >= 0 && i + 1 < width && j + 1 < height) {
                if (terrain[i + 1][j + 1] != 4) {
                  if (randomizer.nextInt(waterConstant) == 0)
                    moreWater[i + 1][j + 1] = 1;
        for (int i = 0; i < width; i++) {
          for (int j = 0; j < height; j++) {
            if (moreWater[i][j] == 1) {
              terrain[i][j] = 4;
      private void generateRandomMap() {
        Random randomizer = new Random();
        for (int i = 0; i < width; i++) {
          for (int j = 0; j < height; j++) {
            if (randomizer.nextInt(3) == 1)
              terrain[i][j] = 0;
            else if (randomizer.nextInt(2) == 1)
              terrain[i][j] = 1;
            else if (randomizer.nextInt(2) == 1)
              terrain[i][j] = 3;
            else if (randomizer.nextInt(2) == 1)
              terrain[i][j] = 2;
            else if (randomizer.nextInt(2) == 1)
              terrain[i][j] = 2;
            else if (randomizer.nextInt(2) == 1)
              terrain[i][j] = 1;
            else if (randomizer.nextInt(2) == 1)
              terrain[i][j] = 3;
            else
              terrain[i][j] = randomizer.nextInt(5);
        expandWater();
        for (int i = 0; i < width; i++) {
          for (int j = 0; j < height; j++) {
            if (terrain[i][j] != 0)
              landMass++;
      public int getMapHeight() {
        return height;
      public int getMapWidth() {
        return width;
      public int getSquareID(int x, int y) {
        return terrain[x][y];
      public int getSquareMovementCost(int x, int y) {
        return terrainTypes.getMovementCost(terrain[x][y]);
    }PathFinder.java:
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.util.Vector;
    public class PathFinder {
      private BufferedReader consoleReader = new BufferedReader(new InputStreamReader(System.in));
      //The array t3D[][] represents the 2D square map where t3D.leght = map width
      //and t3D[x].lenght = map width (-1 < x < t3D.leght). The third dimension
      //is refered to the square's movement cost, witch is definite by terrain.
      //The fourth dimension will be with lenght = 3. When running the search engine
      //(expanding the explored squares) this 3 values will keep the position of
      //the previous square in 3 dimension, witch are width, height and the maximum
      //movement cost among all squares.
      private int[][][][] squares3DReference;
      //Keeps information witch squares are visited.
      private boolean[][][] visitedSquares;
      private Map map;
      //this is the queue used in the Breathed First Seatch.
      private Vector queue3D;
      //Here is saved the shortest path
      private Vector path2D;
      private int highestMovementCost;
      public PathFinder(Map aMap) {
        map = aMap;
        queue3D = new Vector();
        path2D = new Vector();
        squares3DReference = new int[map.getMapWidth()][map.getMapHeight()][][];
        visitedSquares = new boolean[map.getMapWidth()][map.getMapHeight()][];
        highestMovementCost = map.terrainTypes.getHighestMovementCost();
        buildAbstract3DTerrain();
      private void buildAbstract3DTerrain() {
        for (int x = 0; x < map.getMapWidth(); x++) {
          for (int y = 0; y <map.getMapHeight(); y++) {
            int movementCost = map.terrainTypes.getMovementCost(map.getSquareID(x, y));
            if ( movementCost > 0) {
              visitedSquares[x][y] = new boolean[highestMovementCost];
              squares3DReference[x][y] = new int[highestMovementCost][3];
              for (int z = 0; z < highestMovementCost; z++) {
                for (int t = 0; t < 3; t++) {
                  squares3DReference[x][y][z][t] = -1;
      private boolean isMoveValid(int x, int y, int z, int x2, int y2, int z2) {
        if ( x < 0 || y < 0 || z < 0 || x2 < 0 || y2 < 0 || z2 < 0 || x >= map.getMapWidth() || y >= map.getMapHeight() || z >= highestMovementCost ||  x2 >= map.getMapWidth() || y2 >= map.getMapHeight() || z2 >= highestMovementCost)
          return false;
        if (map.terrainTypes.getMovementCost(map.getSquareID(x2, y2)) < 1)
          return false;
        if (visitedSquares[x2][y2][z2])
          return false;
        if (x == x2 && y == y2)
          return true;
        else {
          if (z == map.terrainTypes.getMovementCost(map.getSquareID(x2, y2)) - 1)
            return true;
          else
            return false;
      private void clearPreviousSearchData() {
        queue3D.clear();
        path2D.clear();
        for (int x = 0; x < map.getMapWidth(); x++) {
          for (int y = 0; y < map.getMapHeight(); y++) {
            if (squares3DReference[x][y] != null) {
              for (int z = 0; z < highestMovementCost; z++) {
                visitedSquares[x][y][z] = false;
                for (int t = 0; t < 3; t++) {
                  squares3DReference[x][y][z][t] = -1;
      private Vector copyPath2D() {
        Vector path = new Vector();
        for (int i = 0; i < path2D.size(); i++) {
          path.add(path2D.get(i));
        return path;
      public Vector findPath(int sX, int sY, int gX, int gY) {
        int head = 0;
        int tail = 0;
        int x = sX;
        int y = sY;
        int z = 0;
        visitedSquares[x][y][z] = true;
        mainLoop: {
          while (tail <= head) {
            int[][] moves = getPosibleMoves(x, y, z);
            for (int i = 0; i < 9; i++) {
              if (moves[i] != null) {
                squares3DReference[moves[0]][moves[i][1]][moves[i][2]][0] = x;
    squares3DReference[moves[i][0]][moves[i][1]][moves[i][2]][1] = y;
    squares3DReference[moves[i][0]][moves[i][1]][moves[i][2]][2] = z;
    queue3D.add(moves[i]);
    if (moves[i][0] == gX && moves[i][1] == gY) {
    break mainLoop;
    visitedSquares[moves[i][0]][moves[i][1]][moves[i][2]] = true;
    head++;
    if (queue3D.size() == 0 || queue3D.size() == tail)
    break mainLoop;
    int[] nextInQueue = ((int[]) queue3D.get(tail));
    x = nextInQueue[0];
    y = nextInQueue[1];
    z = nextInQueue[2];
    tail++;
    if (squares3DReference[gX][gY][0][0] == -1) {
    clearPreviousSearchData();
    return path2D;
    fillpath2D(sX, sY, gX, gY);
    Vector path = copyPath2D();
    clearPreviousSearchData();
    return path;
    private int[][] getPosibleMoves(int x, int y, int z) {
    int[][] moves = new int[9][3];
    if (isMoveValid(x, y, z, x + 1, y, 0)) {
    moves[0][0] = x + 1;
    moves[0][1] = y;
    moves[0][2] = 0;
    else
    moves[0] = null;
    if (isMoveValid(x, y, z, x + 1, y - 1, 0)) {
    moves[1][0] = x + 1;
    moves[1][1] = y - 1;
    moves[1][2] = 0;
    else
    moves[1] = null;
    if (isMoveValid(x, y, z, x, y - 1, 0)) {
    moves[2][0] = x;
    moves[2][1] = y - 1;
    moves[2][2] = 0;
    else
    moves[2] = null;
    if (isMoveValid(x, y, z, x - 1, y - 1, 0)) {
    moves[3][0] = x - 1;
    moves[3][1] = y - 1;
    moves[3][2] = 0;
    else
    moves[3] = null;
    if (isMoveValid(x, y, z, x - 1, y, 0)) {
    moves[4][0] = x - 1;
    moves[4][1] = y;
    moves[4][2] = 0;
    else
    moves[4] = null;
    if (isMoveValid(x, y, z, x - 1, y + 1, 0)) {
    moves[5][0] = x - 1;
    moves[5][1] = y + 1;
    moves[5][2] = 0;
    else
    moves[5] = null;
    if (isMoveValid(x, y, z, x, y + 1, 0)) {
    moves[6][0] = x;
    moves[6][1] = y + 1;
    moves[6][2] = 0;
    else
    moves[6] = null;
    if (isMoveValid(x, y, z, x + 1, y + 1, 0)) {
    moves[7][0] = x + 1;
    moves[7][1] = y + 1;
    moves[7][2] = 0;
    else
    moves[7] = null;
    if (isMoveValid(x, y, z, x, y, z + 1)) {
    moves[8][0] = x;
    moves[8][1] = y;
    moves[8][2] = z + 1;
    else
    moves[8] = null;
    return moves;
    private void fillpath2D(int sX, int sY, int gX, int gY) {
    int[] gLoc = {gX, gY};
    path2D.add(gLoc);
    int x = gX;
    int y = gY;
    int z = 0;
    while (x != sX || y != sY) {
    int x2 = squares3DReference[x][y][z][0];
    int y2 = squares3DReference[x][y][z][1];
    int z2 = squares3DReference[x][y][z][2];
    x = x2;
    y = y2;
    z = z2;
    if (z == 0) {
    int[] loc = {x, y};
    path2D.insertElementAt(loc, 0);
    PathFinderTest.java
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.util.Vector;
    public class PathFinderTest {
      static BufferedReader consoleReader = new BufferedReader(new InputStreamReader(System.in));
      static Map map;
      static int startX;
      static int startY;
      static int goalX;
      static int goalY;
      public static void main(String[] args) throws Exception {
        System.out.print("Enter map size.\nx = ");
        int width = Integer.parseInt(consoleReader.readLine());
        System.out.print("y = ");
        int height = Integer.parseInt(consoleReader.readLine());
        System.out.print("Enter strting location.\nx = ");
        startX = Integer.parseInt(consoleReader.readLine()) - 1;
        System.out.print("y = ");
        startY = Integer.parseInt(consoleReader.readLine()) - 1;
        System.out.print("Enter goal location.\nx = ");
        goalX = Integer.parseInt(consoleReader.readLine()) - 1;
        System.out.print("y = ");
        goalY = Integer.parseInt(consoleReader.readLine()) - 1;
        if (goalX < 0 || goalY < 0 || startX < 0 || startY < 0 || goalX >= width || goalY >= height || startX >= width || startY >= height) {
          System.out.println("Invalid parameters found. Program will exit");
          System.exit(0);
        map = new Map(width, height);
        map.clearGoalAndStartLocFromWater(startX, startY, goalX, goalY);
        printSolution(new Vector());
        PathFinder pathFinder = new PathFinder(map);
        long before = System.currentTimeMillis();
        Vector path = pathFinder.findPath(startX, startY, goalX, goalY);
        long after = System.currentTimeMillis();
        long time = after - before;
        printSolution(path);
        if (path.size() == 0)
          System.out.println("No path found.");
        else
          System.out.println("Path found.");
        System.out.println("Finding the path took " + time + " milliseconds");
      static void printSolution(Vector path) {
        boolean[][] pathOnMap = new boolean[map.getMapWidth()][map.getMapHeight()];
        for (int i = 0; path.size() > i; i++) {
          int[] move = (int[]) path.get(i);
          pathOnMap[move[0]][move[1]] = true;
        for (int y = 0; y < map.getMapHeight(); y++) {
          for (int x = 0; x < map.getMapWidth(); x++) {
            System.out.print(" ");
            if (pathOnMap[x][y] == false)
              System.out.print(" ");
            else
              System.out.print("0");
            if (x == startX && y == startY)
              System.out.print("S");
            else if (x == goalX && y == goalY)
              System.out.print("G");
            else
              System.out.print(map.terrainTypes.getNameFirstLetter(map.getSquareID(x, y)));
          System.out.println();
        System.out.println();
    }TerrainType.java:
    public class TerrainType {
      private int movementCost;
      private String name;
      TerrainType(int aMovementCost, String aName) {
        movementCost = aMovementCost;
        name = aName;
      public int getMovementCost() {
        return movementCost;
      public String getName() {
        return name;
      public String getNameFirstLetter() {
        return name.substring(0, 1).toUpperCase();
    }TerrainTypes.java:
    import java.util.Vector;
    public class TerrainTypes {
      //Here are saved the terrain types with the map has. ElementAt 'i' in
      //setOfTypes is represented by the number in Map.terrain[x][y] witch is
      //equal to i, were x, y are random integer as soon as they do not
      //throw ArrayIndexOutOfBoundsException. Actually this is a coding to know
      //a specific square in the map to witch terrain type is refered in setOfTypes.
      private Vector setOfTypes;
      public TerrainTypes() {
        setOfTypes = new Vector();
        setOfTypes.add(new TerrainType(1, "Plains"));
        setOfTypes.add(new TerrainType(2, "Forst"));
        setOfTypes.add(new TerrainType(3, "Jungle"));
        setOfTypes.add(new TerrainType(4, "Mountain"));
        setOfTypes.add(new TerrainType(-1, "X"));
      public int getMovementCost(int i) {
        return ((TerrainType) setOfTypes.get(i)).getMovementCost();
      public String getName(int i) {
        return ((TerrainType) setOfTypes.get(i)).getName();
      public String getNameFirstLetter(int i) {
        return ((TerrainType) setOfTypes.get(i)).getNameFirstLetter();
      public int getHighestMovementCost() {
        int max = 1;
        for (int i = 0; setOfTypes.size() > i; i++) {
          int movementCost = ((TerrainType) setOfTypes.get(i)).getMovementCost();
          if ( movementCost > 0) {
            if (max < movementCost)
              max = movementCost;
        return max;
    }I hope this program will be helpful.
    Sogartar

    Why is such a smart guy like you not using A*
    It is a general known algorithm which will find the
    optimal solution in a finite search-space (within a minimal time).
    The calculation time for the A* algorithm is influenced by two parameters:
    1 - cumulative cost
    2 - minimal expected additional cost
    The calculation of these two costs has a great influence on the
    solution.
    I think the actual problems most games experience with shortest path calculatoin are
    1 - very little time to spent calculating the shortest path
    The quickest solution might be the best for the game
    If your solution takes 1 second for the calculation of a path for one element on the board (100x100)
    What would it take for the game to calculate the path for all elements controlled by the computer ??
    If the computer controls two players which each have 50 elements to control, it would take forever...
    Don't even consider the usage of a larger board (200x200 would take 4 seconds/element when
    algorithm has complexity O(n))
    2 - low priority.
    Users tend to forgive a bad shortest path-algorithm most of the time,
    but not a bad display, bad pictures,...
    This is why most shortest-path algorithms within games were
    developed as a depth first search,
    within some earlier games this was even developed as
    a rule which went straight to the endlocation and
    takes a right/left turn when blocked by water/wall/...
    So the actual steps you should take are:
    1 - develop a normal breath-first search (to get going)
    2 - develop a normal depth-first search (to compare speed and solution with)
    3 - develop a normal dijkstra algorithm (sometimes called A)
    4 - develop a best first algorithm (called A*)
    5 - develop other AI-algorithms building upon A* (tabu-search, limited memory A*,...)
    6 - develop some other AI-algorithms (Genetic Algorithms, Simulated Annealing,...)
    7 - compare and tweak/change all search-algorithms for
    7 - a - size of maps (small versus huge)
    7 - b - optimality of the solution
    7 - c - actual usage for your game
    8 - !!! very important !!!
    Share the developed path algorithms along with remarks about speed, map-size,...
    with the rest of us. I would be very interested in such library.
    kind regards,

  • Path defined

    Hi,
    In mod pl/sql we are calling a image from the application server. I could see the images path in a mod pl/sql procedure like "/images/test.gif". How the database recognizes this path in the application server. More over this path is not from the root level. Actually in the application server this image is lying in the following path "/report/oracle/images/test.gif". Any one explain me, please?
    -bala

    No on the screen shots. Once the path inexplicably changed, it loaded that way even from the saved action set on the server. There is no way to get back to the original saved path.
    I am with you as far as being dismayed that the saved set isn't what I recorded. But yes, I know new actions load at the bottom of the list. I had deleted the "corrupt" action set and then reloaded what should have been a clean set from the saved file, and still it would give the bad path. It has me completely stumped, particularly since I am the only one who authors these actions, and the first path that got screwed up was to a location that I NEVER have nor NEVER WOULD write actions to access.
    And this is the second time this has happened in as many years. Its frustrating, and I was hoping that someone had a solution to keep me from having to reinvent the wheel every couple of years.

  • CS2 install - path error (unsupported chactery

    I am attempting to install CS2 from a link and have run into a “bad path” error.
    I own Adobe CS (first version) which has been working perfectly. However, I lost it when I sent my computer in for repair.  Yesterday, a customer service rep told me Adobe is no longer willing to activate CS and I must download a free version of CS2 which does not require activation. I was given this link
    http://helpx.adobe.com/x-productkb/policy-pricing/creative-suite-2-act ivation-end-life.html
    https://www.adobe.com/cfusion/entitlement/index.cfm?e=cs2_downloads
    I have downloaded the files. I clicked the disc 1 exe file and was asked where I wanted the program files to be placed and clicked on the default option given . . .
    C:\Program Files (x86)\Adobe
    However, when I choose it, a pop-up window appeared with this info . . .
    “The path you selected for installation contains unsupported characters. Please choose a different folder for installation.”
    When I click on Browse, I don’ t see a likely choice.
    Also, the window shows that the entire suite requires 2.62 MB of available space – but the folder suggested ( C:\Program Files (x86)\Adobe) has 0MB available.
    My C Drive has 119MB of total space, with 65.9MB available.
    If it helps . . . CS2 is NOT shown as an installed program on the control panel. However, I opened my C Drive and see it has a folder “Creative Suite CS2.” Inside that folder are four files and a sub-folder ”Adobe Creative Suite 2.0” Inside that folder are 23 files and seven more sub-folders – each with more files and folders.

    My C Drive has 119MB of total space, with 65.9MB available.
    Is that a typo?
    Do you mean GB (Gigabytes) not MB (Megabytes)?
    “The path you selected for installation contains unsupported characters. Please choose a different folder for installation.”
    http://helpx.adobe.com/creative-suite/kb/error-path-contains-unsupported-characters.html
    Try Solution 2 or 3.

  • FSL-02106  Path contains reserved character ('"'):

    Dear all,
    I am going to uninstall a dialog instance from our IS-U system (NetWeaver 2004sSR1).  Our IS-U system is a cluster system running Microsoft Cluster Service.  Unfortunately, I received the following errors and I didn’t know what went wrong.  Does anyone can help on this?
    INFO 2007-12-13 17:05:06
    Execute step collect of component |NW_Uninstall|ind|ind|ind|ind|0|0|NW_GetSidMaybeProfiles|ind|ind|ind|ind|1|0|NW_readProfileDir|ind|ind|ind|ind|0|0.
    ERROR 2007-12-13 17:05:08
    FSL-02107  Path component contains reserved character ('"'): "
    ERROR 2007-12-13 17:05:08
    FSL-02106  Path contains reserved character ('"'): "
    cisbp103\sapmnt\BP1\SYS\profile\START_D82_cisbp199"
    ERROR 2007-12-13 17:05:08
    MUT-03025  Caught ESyException in Modulecall: Bad path component: ".
    ERROR 2007-12-13 17:05:08
    FCO-00011  The step collect with step key |NW_Uninstall|ind|ind|ind|ind|0|0|NW_GetSidMaybeProfiles|ind|ind|ind|ind|1|0|NW_readProfileDir|ind|ind|ind|ind|0|0|collect was executed with status ERROR .
    Regards,
    Ambrose Chung

    Hi,
    Go to <b>Registry</b>
    Navigate to the path:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
    SAP<SAPSID>_< Instance number > :
    Under <b>ImagePath</b> you can find the Data as
    "C:\usr\sap\<SAPSID>\SCS00\exe\sapstartsrv.exe" pf="C:\usr\sap\<SAPSID>\SYS\profile\START_SCS00_<hostname>"
    Delete the Quotes after <b>pf</b> and start your Sapinst again it will work.
    Reward points if useful
    Regards,
    Srujana

  • HT5622 Why im having bad tym down loading in ny app store?

    Please help cause i cannot down load anymore in my app. Store why? In settings i cannot open app. Store?

    Safe mode: Never used "safe mode" on a Mac or any other Unix based system, I'll look on how and try, then report results.
    Another User: No... frankly, I have only one i use and one more i created for such questions as someone suggested that as diagnostic step to some other random problem in the distant past. Dont have a clue on it's password, but i can do something and try that too.
    ExFat .... yes. I have my iTunes library on an external hard drive. it's only formatted in MS-DOS (FAT32) so i can use it in more places than just my Mac, if I ever feel the need to. Otherwise I would have likely formatted with something Mac likes better to eat.
    So, in thought, I figured I can live without my Music, TV and Movies being in Spotlight as I use iTunes to access it anyway, no need for two databases of the same data. I've just placed the drive in the Privacy list in the Spotlight settings.... as of right now, the message reading "6/25/14 9:13:07.041 AM mdworker[64588]: (Warning) Import: Bad path:", has stopped.
    Kinda seems at this point the message above as an issue may have been resolved with that Spotlight privacy setting change however, I am noticing in my logs, even BEFORE the settings change, THESES messages had been hanging out for a bit:
    6/30/14 7:51:39.261 PM iTunes[27164]: Entered:_AMMuxedDeviceDisconnected, mux-device:1876
    6/30/14 7:51:39.262 PM iTunes[27164]: Entered:__thr_AMMuxedDeviceDisconnected, mux-device:1876
    6/30/14 7:51:39.262 PM iTunes[27164]: tid:2465f - Mux ID not found in mapping dictionary
    6/30/14 7:51:39.262 PM iTunes[27164]: tid:2465f - Can't handle disconnect with invalid ecid
    The last occurrence was about 2 minutes BEFORE the change that stopped the mdworker message.

Maybe you are looking for

  • How do I use the google+  app to upload photos to google  from my ipad2

    I have already downloaded the Google+ App to my iPad2 but am unclear how to download my photos to my Google+ page.   How do I do this?

  • PowerShell using start job to run multiple code blocks at the same time

    I will be working with many 1000's of names in a list preforming multiple function on each name for test labs. I notice when it is running the functions on each name I am using almost no CPU or memory.  That led me to research can I run multiple thre

  • How to set the JNDI resources and params

    I am trying to connect my Crystal reports to my JSP page. I am using MySql DB and TomCat 4.1 My web.xml is in the right place and contains the JNDI name (jdbc/MyDB) I was able to accomplish the following: 1) Setting the connection pool and 2) Able to

  • Descrepency in BOM Report

    Dear All Please clarify the following discrepancy I found in BOM report in one of my Customer database:   Schenario - 1       Parent Item A  --  Qty 1 kg             Child Item B  --  Qty 1.2 kg        Parent Item B  --  Qty 1 kg               Child

  • Including native database functions in partnerlink

    Is there a way to include native Oracle database functions (such as NVL) in the definition of a partnerlink based on a database adapter?