Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在小程序中单击按钮调用neo4j数据库服务器时,该服务器不会启动_Java_Swing_Applet_Neo4j_Stack Trace - Fatal编程技术网

Java 在小程序中单击按钮调用neo4j数据库服务器时,该服务器不会启动

Java 在小程序中单击按钮调用neo4j数据库服务器时,该服务器不会启动,java,swing,applet,neo4j,stack-trace,Java,Swing,Applet,Neo4j,Stack Trace,我在小程序中点击按钮调用embeddedNeo4j程序。它在语句之前执行所有语句 graphDb = new GraphDatabaseFactory().newEmbeddedDatabase( DB_PATH); 另外,在直接运行EmbeddedNo4j时,服务器会启动 我的小程序执行的操作如下 public void actionPerformed(ActionEvent ae) { Firstname=t1.getText();

我在小程序中点击按钮调用embeddedNeo4j程序。它在语句之前执行所有语句

      graphDb  = new GraphDatabaseFactory().newEmbeddedDatabase( DB_PATH);
另外,在直接运行EmbeddedNo4j时,服务器会启动

我的小程序执行的操作如下

     public void actionPerformed(ActionEvent ae)
    {
       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();
      }

    public void callFunction()
      {
        JOptionPane.showMessageDialog( frame,"IN FUNCTION");
        String test;
        String test1;            String test2;            JOptionPane.showMessageDialog( frame," CREATE OBJECT NOW");           EmbeddedNeo4j hello = new EmbeddedNeo4j();          JOptionPane.showMessageDialog( frame,"OBJECT CREATED");           test1=hello.verify(Firstname);          test2=hello.start() ;          tExtra.setText(test2);    test=hello.createDb(Firstname,Lastname,Gender,State,City,HobbyS,EducationS,OccupationS);        JOptionPane.showMessageDialog( frame,test);        }my EmbeddedNeo4j Program is as follows         public class EmbeddedNeo4j        {           final String DB_PATH = "C://neo4j-community-1.9.6//data//graph.db";           String greeting;           GraphDatabaseService graphDb;           Node firstNode;           String start()         {              String k="";            try           {             graphDb  = new GraphDatabaseFactory().newEmbeddedDatabase( DB_PATH);//This statement is creating problem             return k;           }                      catch(Exception e)          {           k=Arrays.toString(Thread.currentThread().getStackTrace());           System.out.println(k);           return k;          }           }    String verify(String fn)    {        String fn1=fn;        return fn1;    }         String createDb(String Firstname,String Lastname,String Gender,String State,String City,String Hobby,String Education,String Occupation)     { Transaction tx=null;        try        {             tx= graphDb.beginTx();            firstNode.setProperty( "firstName", ""+Firstname+"" );            firstNode.setProperty( "LastName", Lastname );            firstNode.setProperty( "Gender", Gender );            firstNode.setProperty( "State", State );            firstNode.setProperty( "City", City );            firstNode.setProperty( "Hobby", Hobby );            firstNode.setProperty( "Education", Education );            firstNode.setProperty( "Occupation", Occupation );

         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") );

           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" ));


        tx.success();
    }
    catch(Exception e)
    {
        tx.failure();
    }
    finally
    {
        tx.finish();
        return greeting;
    }
    // END SNIPPET: transaction
}
             [java.lang.Thread.getStackTrace(Thread.java:1588),
              EmbeddedNeo4j.start(EmbeddedNeo4j.java:48), 
              form.callFunction(form.java:170),      
              form.actionPerformed(form.java:151),                           
              javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018),             
              javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341),                 
              javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402),              
              javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259),           
              javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252),           
              java.awt.Component.processMouseEvent(Component.java:6505),                
              javax.swing.JComponent.processMouseEvent(JComponent.java:3320),               
              java.awt.Container.processEvent(Container.java:2229),             
              java.awt.Component.dispatchEventImpl(Component.java:4861),                
              java.awt.Container.dispatchEventImpl(Container.java:2287),                
              java.awt.Component.dispatchEvent(Component.java:4687),                
              java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832),               
              java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492),                
              java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422),                
              java.awt.Container.dispatchEventImpl(Container.java:2273),                
              java.awt.Component.dispatchEvent(Component.java:4687),                
              java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735),               
              java.awt.EventQueue.access$200(EventQueue.java:103),              
              java.awt.EventQueue$3.run(EventQueue.java:694),               
              java.awt.EventQueue$3.run(EventQueue.java:692),               
              java.security.AccessController.doPrivileged(Native Method),                
              java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76),               
              java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87),                
              java.awt.EventQueue$4.run(EventQueue.java:708),               
              java.awt.EventQueue$4.run(EventQueue.java:706),               
              java.security.AccessController.doPrivileged(Native Method),               
              java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76),               
              java.awt.EventQueue.dispatchEvent(EventQueue.java:705),               
              java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242),                 
              java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161),               
              java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150),                
              java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146),            
              java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138),                
              java.awt.EventDispatchThread.run(EventDispatchThread.java:91)]
运行小程序后的StackTrace如下所示

     public void actionPerformed(ActionEvent ae)
    {
       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();
      }

    public void callFunction()
      {
        JOptionPane.showMessageDialog( frame,"IN FUNCTION");
        String test;
        String test1;            String test2;            JOptionPane.showMessageDialog( frame," CREATE OBJECT NOW");           EmbeddedNeo4j hello = new EmbeddedNeo4j();          JOptionPane.showMessageDialog( frame,"OBJECT CREATED");           test1=hello.verify(Firstname);          test2=hello.start() ;          tExtra.setText(test2);    test=hello.createDb(Firstname,Lastname,Gender,State,City,HobbyS,EducationS,OccupationS);        JOptionPane.showMessageDialog( frame,test);        }my EmbeddedNeo4j Program is as follows         public class EmbeddedNeo4j        {           final String DB_PATH = "C://neo4j-community-1.9.6//data//graph.db";           String greeting;           GraphDatabaseService graphDb;           Node firstNode;           String start()         {              String k="";            try           {             graphDb  = new GraphDatabaseFactory().newEmbeddedDatabase( DB_PATH);//This statement is creating problem             return k;           }                      catch(Exception e)          {           k=Arrays.toString(Thread.currentThread().getStackTrace());           System.out.println(k);           return k;          }           }    String verify(String fn)    {        String fn1=fn;        return fn1;    }         String createDb(String Firstname,String Lastname,String Gender,String State,String City,String Hobby,String Education,String Occupation)     { Transaction tx=null;        try        {             tx= graphDb.beginTx();            firstNode.setProperty( "firstName", ""+Firstname+"" );            firstNode.setProperty( "LastName", Lastname );            firstNode.setProperty( "Gender", Gender );            firstNode.setProperty( "State", State );            firstNode.setProperty( "City", City );            firstNode.setProperty( "Hobby", Hobby );            firstNode.setProperty( "Education", Education );            firstNode.setProperty( "Occupation", Occupation );

         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") );

           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" ));


        tx.success();
    }
    catch(Exception e)
    {
        tx.failure();
    }
    finally
    {
        tx.finish();
        return greeting;
    }
    // END SNIPPET: transaction
}
             [java.lang.Thread.getStackTrace(Thread.java:1588),
              EmbeddedNeo4j.start(EmbeddedNeo4j.java:48), 
              form.callFunction(form.java:170),      
              form.actionPerformed(form.java:151),                           
              javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018),             
              javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341),                 
              javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402),              
              javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259),           
              javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252),           
              java.awt.Component.processMouseEvent(Component.java:6505),                
              javax.swing.JComponent.processMouseEvent(JComponent.java:3320),               
              java.awt.Container.processEvent(Container.java:2229),             
              java.awt.Component.dispatchEventImpl(Component.java:4861),                
              java.awt.Container.dispatchEventImpl(Container.java:2287),                
              java.awt.Component.dispatchEvent(Component.java:4687),                
              java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832),               
              java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492),                
              java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422),                
              java.awt.Container.dispatchEventImpl(Container.java:2273),                
              java.awt.Component.dispatchEvent(Component.java:4687),                
              java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735),               
              java.awt.EventQueue.access$200(EventQueue.java:103),              
              java.awt.EventQueue$3.run(EventQueue.java:694),               
              java.awt.EventQueue$3.run(EventQueue.java:692),               
              java.security.AccessController.doPrivileged(Native Method),                
              java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76),               
              java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87),                
              java.awt.EventQueue$4.run(EventQueue.java:708),               
              java.awt.EventQueue$4.run(EventQueue.java:706),               
              java.security.AccessController.doPrivileged(Native Method),               
              java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76),               
              java.awt.EventQueue.dispatchEvent(EventQueue.java:705),               
              java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242),                 
              java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161),               
              java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150),                
              java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146),            
              java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138),                
              java.awt.EventDispatchThread.run(EventDispatchThread.java:91)]

另外,我的数据库路径/消息是空的。:Plz guide me

您能发布您收到的异常/错误吗?确保没有其他服务器实例正在运行。我已经编辑了问题中的stackTrace。请进一步指导我。你在谈论哪个小程序?您可以共享db logs db_PATH/messages.log吗?我的db_PATH/messages.log是空的。另外,我已经编辑了问题并添加了小程序。问题解决了,这是一个权限问题,我在java.policy文件中更改了权限,并包含了SecurityManager,它工作正常。