Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    datasource problems

    i use oracle 10g for my database.

    servers.properties:
    Code:
    webRoot: __AUTODETECT__
    
    isomorphicPathRootRelative: test/sc
    
    # administration app
    apps.adminConsole.location: $webRoot/test/tools
    ui.adminConsole.location: $webRoot/test/tools
    
    
    sql.defaultDatabase: oracle
    
    project.datasources: $webRoot/ds
    project.ui: $webRoot/shared/ui
    project.apps: $webRoot/shared/app
    
    #for development
    #RPCManager.enabledBuiltinMethods: *
    RPCManager.enabledBuiltinMethods: xmlToJS, uploadProgressCheck
    
    FilesystemDataSource.enabled: true
    
    sql.oracle.interface.credentialsInURL: true
    sql.oracle.database.type: oracle
    sql.oracle.driver.serverName: localhost
    sql.oracle.driver.portNumber: 1521
    sql.oracle.driver.user: hsman
    sql.oracle.driver.password: XXX
    sql.oracle.driver.databaseName: XXX
    sql.oracle.driver: oracle.jdbc.driver.OracleDriver
    sql.Oracle.driver.url: jdbc:oracle:thin:@localhost:XXX
    sql.oracle.interface.type: dataSource
    sql.oracle.pool.enabled: true
    sql.oracle.driver.networkProtocol: tcp
    sql.oracle.driver.driverType: thin
    sql.oracle.driver.context: _container_
    and
    Code:
    ListGrid newsGrid = new ListGrid();
    		newsGrid.setWidth100();
    		newsGrid.setHeight100();
    		newsGrid.setAutoFetchData(true);
    		newsGrid.setDataSource(NewsXmlDS.getInstance());
    		newsGrid.setDataSource(DataSource.getDataSource("news"));   
    		newsGrid.setUseAllDataSourceFields(true);
    		tTab4.setPane(newsGrid);
    		tabSet.addTab(tTab4);
    and ds.xml file:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <DataSource  tableName="collectgroup" ID="news"  serverType="sql">
    	<fields>
    		<field title="GROUP"  type="sequence" name="GROUP_ID"></field>
    		<field title="DCC" type="text" length="256" name="DCC_NAME"></field>
    		<field title="IP" type="text" length="256" name="IP_ADDRESS"></field>
    		<field title="REMARK" type="text" length="256" name="REMARK"></field>
    	</fields>
    </DataSource>
    and NewsXmlDS.java
    Code:
    public class NewsXmlDS extends DataSource{
    	
    	private static NewsXmlDS instance = null;  
    	
    	public static NewsXmlDS getInstance() {  
    	       
    		  if (instance == null) {  
    	            instance = new NewsXmlDS("news");  
    	        }  
    	        return instance;  
    	    }
    
    	public NewsXmlDS(String id) {
    		    setID(id);  
    		    
    		    setRecordXPath("/DataSource/fields");  
    	        setDataURL("ds/news.ds.xml");  
    	                
    	        DataSourceIntegerField newsIdField = 
    	        	new DataSourceIntegerField("GROUP");  
    	    
    	        newsIdField.setRequired(true);  
    	  
    	        DataSourceTextField newsTitleField = 
    	        	new DataSourceTextField("DCC");  
    	        newsTitleField.setRequired(true);  
    	     	        
    	        DataSourceTextField newsContentField = 
    	        	new DataSourceTextField("IP");  
    	        newsContentField.setRequired(true); 
    	        
    	        DataSourceTextField newAutorField = 
    	        	new DataSourceTextField("REMARK");  
    	        newAutorField.setRequired(true);	  
    	       	  
    	        setFields(newsIdField, newsTitleField, newsContentField,newAutorField
    	        		);      	        
    	}
    }
    then the error:
    Code:
    === 2012-03-05 21:34:48,678 [l0-4] INFO  RequestContext - URL: '/sc/DataSourceLoader', User-Agent: 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; BOIE9;ZHCN)': MSIE with Accept-Encoding header, ready for compressed JS
    === 2012-03-05 21:34:48,680 [l0-4] DEBUG ProcessedFileCache - STALE object for file 'D:\workspaces 3.6\test\war\ds\news.ds.xml', reloading (file timestamp 1330954473069, cache timestamp 1330954435801)
    === 2012-03-05 21:34:48,683 [l0-4] DEBUG XML - Parsed XML from D:\workspaces 3.6\testMySQL\war\ds\news.ds.xml: 2ms
    === 2012-03-05 21:34:48,717 [l0-4] DEBUG PoolableSQLConnectionFactory - Initializing SQL config for 'mysql' from system config - using DataSource:  null
    === 2012-03-05 21:34:48,717 [l0-4] ERROR SQLConnectionManager - Caught exception
    so where does appear " mysql",is there something wrong with my setting?
    thanks a lot!
    Last edited by ruikaka16; 5 Mar 2012, 07:04.

    #2
    You have not yet successfully set the default database. This could be because you've changes server.properties in your editor but not saved it, not restarted the server after changes to server.properties, or used the Admin Console to write to server.properties but then not downloaded the new file and put it in your project.

    Comment


      #3
      Originally posted by Isomorphic
      You have not yet successfully set the default database. This could be because you've changes server.properties in your editor but not saved it, not restarted the server after changes to server.properties, or used the Admin Console to write to server.properties but then not downloaded the new file and put it in your project.
      thanks for your reply:
      i used mysql database before,it worked fine,then i want to change to oracle and saved the server.properties after changed ,i do not work.

      ps:there is something wrong with adminconsole,then i try adminconsole.

      Comment

      Working...
      X