title: Unable to start neo4j server on click of a submit button of an applet running on xampp server
body: <p>I have an applet which is a registraton form.I fill data in the registration form and on click of the submit button the neo4j database server is called which  creates a node of the data entered.I am doing this through java.</p>
  
  <p>The code is as follows</p>
  
  <pre><code>            import java.util.*;
              import java.awt.*;
              import javax.swing.*;
              import java.applet.Applet;
              import java.awt.event.*;
              import java.awt.event.ActionEvent;
              import java.io.*;
              import org.neo4j.graphdb.Direction;
              import org.neo4j.graphdb.GraphDatabaseService;
              import org.neo4j.graphdb.Node;
              import org.neo4j.graphdb.Label;
              import org.neo4j.graphdb.DynamicLabel;
              import org.neo4j.graphdb.Relationship;
              import org.neo4j.graphdb.RelationshipType;
              import org.neo4j.graphdb.Transaction;
              import org.neo4j.graphdb.factory.GraphDatabaseFactory;
              import org.neo4j.kernel.impl.util.FileUtils;
              import org.neo4j.kernel.InternalAbstractGraphDatabase;
              import  org.neo4j.kernel.StoreLocker;
              import org.neo4j.cypher.javacompat.*; 
  
              import java.util.Collection;
  
              public class formModified extends JApplet implements ActionListener
  
              {
                  JFrame frame=new JFrame();
                  String Firstname;
                  String Lastname,Birthdate,Gender,State,City,HobbyS,EducationS,OccupationS;
                  Object Hobby,Education,Occupation;
                  String HobbyList[]={"Select ANY ONE","Cricket","Hockry","Golf","BasketBall","Football"};
                  String EducationList[]={"Select ANY ONE","BSc","BCom","BE","B.Tech","MBA","MBBS","PhD"};
                  String OccupationList[]={"Select ANY ONE","Business","Service","others"};
                  JPanel panel=new JPanel(new SpringLayout());
                  JLabel l1=new JLabel("First Name",JLabel.LEFT);
                  JTextField  t1=new JTextField(50);
                  JLabel l2=new JLabel("Last Name",JLabel.LEFT);
                  JTextField t2=new JTextField(50);
                  JLabel l3=new JLabel("Birthday",JLabel.LEFT);
                  JTextField t3=new JTextField(20);
                  JRadioButton r1=new JRadioButton("Male");
                  JRadioButton r2=new JRadioButton("Female");
                  JLabel l4=new JLabel("State",JLabel.LEFT);
                  JTextField t4=new JTextField(50);
                  JLabel l5=new JLabel("City",JLabel.LEFT);
                  JTextField t5=new JTextField(50);
                  JLabel l6=new JLabel("Hobby",JLabel.LEFT);
                  JComboBox jl1=new JComboBox(HobbyList);
                  JLabel l7=new JLabel("Education",JLabel.LEFT);
                  JComboBox jl2=new JComboBox(EducationList);
                  JLabel l8=new JLabel("Occupation",JLabel.LEFT);
                  JComboBox jl3=new JComboBox(OccupationList);
                  JLabel l9=new JLabel("THANK YOU" ,JLabel.LEFT);
                  JButton submit=new JButton("SUBMIT");
                  JLabel l10=new JLabel("stackTrace" ,JLabel.LEFT);
                  JTextArea tExtra=new JTextArea();
  
                  public void init()
                  {
                  SwingUtilities.invokeLater(new Runnable() {
                              public void run() {
                                  createAndShowGUI();
                              }
  
                          });
                  }
  
                  void  createAndShowGUI()
                  {
                      add(panel);
                      panel.setLayout(new SpringLayout());
                      panel.add(l10);
                      panel.add(tExtra);
  
                      panel.add(l1);
                      panel.add(t1);
                      panel.add(l2);
                      panel.add(t2);
                      panel.add(l3);
                      panel.add(t3);
                      // add(cpanel);
                      panel.add(r1);
                      panel.add(r2);       
                      panel.add(l4);
                      panel.add(t4);
                      panel.add(l5);
                      panel.add(t5);
                      panel.add(l6);
                      panel.add(jl1);
                      panel.add(l7);
                      panel.add(jl2);
                      panel.add(l8);
  
                      panel.add(jl3);
                      panel.add(l9);
  
                      panel.add(submit);
  
                      /*panel.add(c1);
                      panel.add(c2);
                      panel.add(c3);
                      panel.add(c4);*/
                      /*panel.add(c2);*/
                      Dimension d =new Dimension(20,20);
  
                      Dimension d1=new Dimension(1000,1000);
  
                      l1.setLabelFor(t1);
                      l2.setLabelFor(t2);
                      t1.setPreferredSize(d);
                      t1.setSize(d);
                      t1.setMaximumSize(d);
                      // t1.setMinimumSize(d);
                      t2.setPreferredSize(d);
                      t2.setSize(d);
                      t2.setMaximumSize(d);
  
                      t3.setPreferredSize(d);
                      t3.setSize(d);
                      t3.setMaximumSize(d);
  
                      t4.setPreferredSize(d);
                      t4.setSize(d);
                      t4.setMaximumSize(d);
  
                      t5.setPreferredSize(d);
                      t5.setSize(d);
                      t5.setMaximumSize(d);
  
                      /*tExtra.setPreferredSize(d1);
                      tExtra.setSize(d1);
                      tExtra.setMaximumSize(d1);
                      tExtra.setLineWrap(true);*/
  
                      SpringUtilities.makeCompactGrid(panel,11,2,20,20,10,10);
                      submit.addActionListener(this);
  
                  }
  
                  public void actionPerformed(ActionEvent ae)
                  {
                      try
                      {
                          Firstname=t1.getText();
                          Lastname=t2.getText();
                          Birthdate=t3.getText();
                          if(r1.isSelected())
                          {Gender=r1.getText();
                          }
                          else
                              Gender=r2.getText();
                          State=t4.getText();
                          City=t5.getText();
                          Hobby=jl1.getSelectedItem();
                          Education=jl2.getSelectedItem();
                          Occupation=jl3.getSelectedItem();
                          HobbyS=Hobby.toString();
                          EducationS=Education.toString();
                          OccupationS=Occupation.toString();
  
                          //JOptionPane.showMessageDialog( frame,"BEFORE FUNCTION CALL");
                          callFunction();
                          //JOptionPane.showMessageDialog( frame,"After FUNCTION CALL");
                      }
                      catch(Exception e)
                      {
                          JOptionPane.showMessageDialog( frame,"in action Catch bLOCK");
                      }
  
                      //Person.getFname(Firstname);
                      //System.out.println(Firstname)
                  }
  
                  public void callFunction()
  
                  {
                      JOptionPane.showMessageDialog( frame,"IN FUNCTION");
                      String test;
                      String test1;
                      String test2;
                      String test3;
                      String test4;
                      JOptionPane.showMessageDialog( frame," CREATE OBJECT NOW");
                      EmbeddedNeo4j hello = new EmbeddedNeo4j();
                      JOptionPane.showMessageDialog( frame,"OBJECT CREATED");
  
  
                      test2=hello.start() ;//starts database? connects to it?
                      JOptionPane.showMessageDialog( frame,"Connected to Database");
  
                      test=hello.createDb(Firstname,Lastname,Gender,State,City,HobbyS,EducationS,OccupationS);
                      JOptionPane.showMessageDialog( frame,test);
                      //hello.clearDb();
                      //JOptionPane.showMessageDialog( frame,"performing clustering");
  
                      test3=hello.shutDown();
  
                      JOptionPane.showMessageDialog( frame,test3);
  
                  }
                                  public void start()
                      {
                        SecurityManager sm = new MySecurityManager();
                          System.setSecurityManager(sm);    
                      }
                      public void stop()
                      {
  
                      }
  
                      public void paint(Graphics g)
                      {
                          // simple text displayed on applet
                          g.setColor(Color.red);
                          super.paint(g);
  
                                                }
                                                } 
  
  
                   class EmbeddedNeo4j
              {
                  String k="";
                  final String DB_PATH = "C://neo4j-community-2.0.1//data//graph.db";
                  String greeting;
                  String greeting1;
                  GraphDatabaseService graphDb;
                  Node firstNode;
                  Node adNode;
                  Label myLabel,myLabel1;
  
                  String start()
                  {
  
                      try
                      {
                          graphDb  = new GraphDatabaseFactory().newEmbeddedDatabase( DB_PATH);
                          return k;
                      }
                      catch(Exception e)
                      {
  
                          k=Arrays.toString(e.getStackTrace());
                          System.out.println(k);
                          return k;
                      }
  
                  }
  
                  String verify(String fn)
                  {
                      String fn1=fn;
                      return fn1;
                  }
  
                  /* public static void main( final String[] args )
                  {
                  EmbeddedNeo4j hello = new EmbeddedNeo4j();
                  hello.createDb();
                  //.removeData();
                  hello.shutDown();
                  }*/
  
                  //
                  String createDb(String Firstname,String Lastname,String Gender,String State,String City,String Hobby,String Education,String Occupation)
                  //String createDb()
                  {
  
                      Transaction tx=null;
                      try
                      {
                          tx= graphDb.beginTx();
                          firstNode = graphDb.createNode();
                           myLabel = DynamicLabel.label("Users");
                          firstNode.addLabel(myLabel);
                          firstNode.setProperty( "firstName", Firstname );
                          firstNode.setProperty( "LastName", Lastname );
                          firstNode.setProperty( "Age", "21");
                          firstNode.setProperty( "Gender", Gender );
                          firstNode.setProperty( "State", State );
                          firstNode.setProperty( "City", City );
                          firstNode.setProperty( "Hobby", Hobby );
                          firstNode.setProperty( "Education", Education );
                          firstNode.setProperty( "Occupation", Occupation );
                          //secondNode = graphDb.createNode();
                          //secondNode.setProperty( "message", "World!" );
  
                          //  relationship = firstNode.createRelationshipTo( secondNode, RelTypes.KNOWS );
                          //relationship.setProperty( "message", "brave Neo4j " );
                          // END SNIPPET: addData
  
                          // START SNIPPET: readData
  
                          System.out.print( firstNode.getProperty( "firstName"));
                          System.out.print( firstNode.getProperty(  "LastName" ));
                          System.out.print( firstNode.getProperty( "Age" ) );
                          System.out.print( firstNode.getProperty( "Gender") );
                          System.out.print( firstNode.getProperty( "State" ) );
                          System.out.print( firstNode.getProperty( "City") );
                          System.out.print( firstNode.getProperty( "Hobby") );
                          System.out.print( firstNode.getProperty("Education") );
                          System.out.print( firstNode.getProperty( "Occupation") );
  
                          // END SNIPPET: readData
                          greeting = ( (String) firstNode.getProperty( "firstName" ) )
                          + ( (String)  firstNode.getProperty( "LastName"  ))
                          + ( (String)  firstNode.getProperty(  "Age" ))
                          + ( (String)  firstNode.getProperty(  "Gender" ))
                          + ( (String)  firstNode.getProperty( "State" ))
                          + ( (String)  firstNode.getProperty( "City" ))
                          + ( (String)  firstNode.getProperty(  "Hobby"))
                          + ( (String)  firstNode.getProperty( "Education" ))
                          + ( (String)  firstNode.getProperty(  "Occupation" ));
  
                          // START SNIPPET: transaction
                          tx.success();
                      }
                      catch(Exception e)
                      {
                          tx.failure();
                      }
                      finally
                      {
                          tx.finish();
                          return greeting;
                      }
                      // END SNIPPET: transaction
                  }
  
                  String createAdDb(String Title,String Content,String Publisher)
                  {
                      Transaction tx=null;
                      try
                      {
                          tx= graphDb.beginTx();
                          //adNode = graphDb.createNode();
                          // myLabel = DynamicLabel.label("Person");
                          //firstNode.addLabel(myLabel);
                          adNode = graphDb.createNode();
                           myLabel1 = DynamicLabel.label("Ads");
                           adNode.addLabel(myLabel1);
                          adNode.setProperty( "Title", Title);
                          adNode.setProperty( "Content",Content);
                          adNode.setProperty( "Publisher",Publisher);
                          System.out.print( adNode.getProperty("Title"));
                          System.out.print( adNode.getProperty( "Content" ));
                          System.out.print( adNode.getProperty( "Publisher" ) );
  
                          greeting1 = ( (String) adNode.getProperty("Title" ) )
                          + ( (String)  adNode.getProperty( "Content"  ))
                          + ( (String)  adNode.getProperty(  "Publisher" ));
                          tx.success();
                      }
                      catch(Exception e)
                      {
                          tx.failure();
                      }
                      finally
                      {
                          tx.finish();
                          return greeting1;
                      }
  
                  }
  
                  void clearDb()
                  {
                      try
                      {
                          FileUtils.deleteRecursively( new File(DB_PATH) );
                      }
                      catch ( IOException e )
                      {
                          //throw new RuntimeException( e );
                      }
                  }
  
                  void removeData()
                  {
                      Transaction tx=null;
                      try 
                      {
  
                          tx = graphDb.beginTx() ;
  
                          // firstNode.getSingleRelationship( RelTypes.KNOWS, Direction.OUTGOING ).delete();
                          firstNode.delete();
                          //secondNode.delete();
                          // END SNIPPET: removingData
  
                          tx.success();
                      }
  
                      catch(Exception e)
                      {
                          tx.failure();
                      }
                      finally
  
                      {
                          // START SNIPPET: removingData
                          // let's remove the data
                          tx.finish();
  
                      }
                  }
  
                  String clustering()
                  {
                      Transaction tx=null;
                      ExecutionEngine engine = new ExecutionEngine( graphDb );
  
                      ExecutionResult result;
                      try 
                      {
                          tx=graphDb.beginTx();
                          //Transaction ignored = graphDb.beginTx();
  
                          //result = engine.execute( "start n=node(*) match(n) return n" );
  
                          tx.success();
                          return k;
  
                      }
                      catch(Exception e)
                      {
                          tx.failure();
                          k=Arrays.toString(e.getStackTrace());
                          System.out.println(k);
                          return k;
  
                      }
                      finally
                      {
  
                          tx.finish();
                      }
                  }
  
                  String shutDown()
                  {
                      //System.out.println();
  
                      // START SNIPPET: shutdownServer
                      graphDb.shutdown();
  
                      return "Shutting down database ..." ;
                      // END SNIPPET: shutdownServer
                  }
  
              }
  </code></pre>
  
  <p>My code works well and creates node as desired when run from an appletviewer using the ide Bluej.
  But when I try to run the code in the browser,the applet does not create the neo4j database instance.There is no message dialogue box after "Object created" message dialog box.
  Also ,there is no stacktrace nor any message in the messages.log in neo4j.</p>
  
  <p>Also,I have doing this by creating  a jar file including my java program and all jar files required for neo4j.I have given the entry pint in the jar file as this java code mention above.I have signed the jar file with the jarsigner.</p>
  
  <p>I am running this file using the xampp server.</p>
  
  <p>my html code is as follows</p>
  
  <pre><code>            &lt;html&gt;
                &lt;head&gt;
                      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
                      &lt;title&gt;Registration Form&lt;/title&gt;
                  &lt;/head&gt;
                  &lt;body&gt;
                      &lt;h1&gt;Registration Form&lt;/h1&gt;
                      &lt;hr&gt;
                      &lt;applet code="formModified.class" 
                          width=500 
                          height=500
                          codebase="http://localhost"
                          archive="5last.jar"
                          alt="Your browser understands the &amp;lt;APPLET&amp;gt; tag but isn't running the applet, for some reason."
                       &gt;
                            &lt;PARAM NAME = "Application-Name"   VALUE = "reg"&gt;
                              &lt;PARAM name="separate_jvm" value="true"&gt;
  
                      &lt;/applet&gt;
                      &lt;hr&gt;
                  &lt;/body&gt;
              &lt;/html&gt;
  </code></pre>
  
  <p>What could be the problem?
  I am using Neo4j 2.01 Community version.</p>