Hi Eranda, That's only used when Statistic publishing is enabled. When it's disabled, APIM should function without specifying that datasource.
AmilaD On Fri, Jan 4, 2013 at 2:10 PM, Eranda Sooriyabandara <[email protected]>wrote: > Hi Amila, > > As I can see in your masterdatasource.xml there is a datasource configured > as follows, > > <datasource> > <name>WSO2AM_STATS_DB</name> > <description>The datasource used for getting statistics to API > Manager</description> > <jndiConfig> > <name>jdbc/WSO2AM_STATS_DB</name> > </jndiConfig> > <definition type="RDBMS"> > <configuration> > <url>jdbc:h2:*<!-- Full path to JDBC database -->* > ;AUTO_SERVER=TRUE</url> > <username>wso2carbon</username> > <password>wso2carbon</password> > <driverClassName>org.h2.Driver</driverClassName> > <maxActive>50</maxActive> > <maxWait>60000</maxWait> > <testOnBorrow>true</testOnBorrow> > <validationQuery>SELECT 1</validationQuery> > <validationInterval>30000</validationInterval> > </configuration> > </definition> > </datasource> > > Please make sure you do the configurations correctly. > > thanks > Eranda > > > > On Fri, Jan 4, 2013 at 2:01 PM, Amila De Silva <[email protected]> wrote: > >> Hi Eranda, >> I'm using a MySql database for this. Attached the files. >> >> AmilaD >> >> On Fri, Jan 4, 2013 at 1:44 PM, Eranda Sooriyabandara <[email protected]>wrote: >> >>> Hi Amila, >>> What is the database you used as the remote DB? H2? Also can you please >>> copy the masterdata source config to that remote DB as well as the >>> govregistry DB configuration in the registry.xml. >>> >>> thanks >>> Eranda >>> >>> >>> On Fri, Jan 4, 2013 at 12:51 PM, Amila De Silva <[email protected]> wrote: >>> >>>> >>>> Hi, >>>> As explained in [1] an exception is thrown when accessing the pubisher >>>> and store apps. >>>> When these are accessed for the first time, an SQL resource is added to >>>> the location >>>> "/repository/components/org.wso2.carbon.registry/queries/tag-summary" of >>>> the config space. >>>> Within the publisher app, following code is used to obtain the related >>>> registry space; >>>> >>>> Registry configRegistry = >>>> ServiceReferenceHolder.getInstance().getRegistryService().getConfigSystemRegistry(); >>>> >>>> As observed following takes place in the registry side, after calling >>>> the configRegistry.put method; >>>> 1. Since the inserted resource is marked as an SQL media type, at a >>>> point SQLQueryHandler.put is called. >>>> 2.The location of the resource is identified as a non existing one, >>>> therefore it gets created level by level. >>>> 3.The new location gets created by addEmptyCollection method in >>>> Repository class, which is recursively called until an existing >>>> parentResourceID is found. >>>> 4. Once it reaches an existing parentResourceID (in this case it is >>>> /_system/local/repository/), the immediate child collection (components) is >>>> created in the underlying database by resourceDAO.add method. >>>> 5. This subsequently calls to createAndApplyResourceID in >>>> JDBCResourceDAO, which ultimately calls to createResourceID. >>>> 6. The problem originates when executing the block; >>>> >>>> JDBCDatabaseTransaction.ManagedRegistryConnection conn = >>>> JDBCDatabaseTransaction.getConnection(); >>>> JDBCPathCache pathCache = JDBCPathCache.getPathCache(); >>>> int pathID = pathCache.getPathID(conn, path); >>>> if (pathID == -1) { >>>> pathID = pathCache.addEntry(path, parentPathID); >>>> } >>>> >>>> "conn" variable points to the database where local space is stored, >>>> meaning that the pathID is first fetched from the local_space (which is the >>>> expected behaviour). >>>> >>>> The call to pathCache.addEntry, subsequently invokes >>>> >>>> dataAccessManager = >>>> CurrentSession.getUserRegistry().getRegistryContext().getDataAccessManager(); >>>> >>>> to get a datasource (the new collection 'components' gets actually >>>> stored here). But this datasource actually points to the database where >>>> config space is mounted. >>>> The problem in short is path is retrieved from one location, but it is >>>> stored to another. >>>> >>>> Has this to do anything with the way the registry space is obtained? >>>> >>>> [1] https://wso2.org/jira/browse/APIMANAGER-869 >>>> >>>> >>>> Regards, >>>> AmilaD >>>> >>>> >>>> _______________________________________________ >>>> Dev mailing list >>>> [email protected] >>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>> >>>> >>> >>> >>> -- >>> *Eranda Sooriyabandara >>> *Software Engineer; >>> Integration Technologies Team; >>> WSO2 Inc.; http://wso2.com >>> >>> * >>> * >>> >> >> > > > -- > *Eranda Sooriyabandara > *Software Engineer; > Integration Technologies Team; > WSO2 Inc.; http://wso2.com > > * > * >
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
