[rules-users] adding all packages to kbuilder in web application geting errors...

srinivasasanda srinivasasanda at gmail.com
Wed Dec 21 11:53:51 EST 2011


		

	
packagelisturl=http://localhost:8080/guvnor-5.2.0.Final-jboss-as-5.1/org.drools.guvnor.Guvnor/webdav/packages
		(which show the list of package ==>
							Contents of this Folder:
							defaultPackage
							mortgages
							sample
							demo

		Storeing the result in buffered reader, and manuplateing the eachline and
adding all the package to the kbuilder() 
	
packageurl=http://localhost:8080/guvnor-5.2.0.Final-jboss-as-5.1/org.drools.guvnor.Guvnor/package/

	
...............................................................................................................		
	
System.out.println(GlobalConfig.getConfigParameterValue("packagelisturl"));
		URL packages = new
URL(GlobalConfig.getConfigParameterValue("packagelisturl"));
		URLConnection yc = packages.openConnection();
		BufferedReader in = new BufferedReader(new
InputStreamReader(yc.getInputStream()));
		String inputLine;
		inputLine = in.readLine();
		System.out.print("inputLine"+inputLine);
		while ((inputLine = in.readLine()) != null) 
			 {
				System.out.print("inputLine"+inputLine);
				String
urlstr=GlobalConfig.getConfigParameterValue("packageurl")+""+inputLine+"/LATEST";
			        URL url = new URL(urlstr);	
			        UrlResource urlResource =
(UrlResource)ResourceFactory.newUrlResource(url);
			        urlResource.setBasicAuthentication("enabled");
			        urlResource.setUsername("admin");
			        urlResource.setPassword("admin");
				_kbuilder.add(urlResource, ResourceType.PKG);
				System.out.println("added pacakges into _kbuilder"+urlstr);
		         }
	        in.close();
 		......................................................... some other code
to fire rules.....

		    This code works fine with simple java application and geting the
result.

		    but when i try to use this in some web application , the packages are
not adding to kbuilder  and it shows the following error


2011-12-21 20:31:01,819 INFO  [STDOUT] (http-127.0.0.1-8080-5) after
creating kbuilder
2011-12-21 20:31:01,819 INFO  [STDOUT] (http-127.0.0.1-8080-5)
http://localhost:8080/guvnor-5.2.0.Final-jboss-as-5.1/org.drools.guvnor.Guvnor/webdav/packages
2011-12-21 20:31:01,819 INFO  [STDOUT] (http-127.0.0.1-8080-4) INFO  21-12
20:31:01,819 (NilAuthenticator.java:authenticate:35) All users are guests.
2011-12-21 20:31:01,819 INFO  [STDOUT] (http-127.0.0.1-8080-4) INFO  21-12
20:31:01,819 (RepositoryServlet.java:allowUser:114) null authenticated for
rest api
2011-12-21 20:31:01,835 INFO  [STDOUT] (http-127.0.0.1-8080-5)
inputLineContents of this Folder:
2011-12-21 20:31:01,835 INFO  [STDOUT] (http-127.0.0.1-8080-5)
inputLinedefaultPackage
2011-12-21 20:31:01,835 INFO  [STDOUT] (http-127.0.0.1-8080-5) added
pacakges into
_kbuilderhttp://localhost:8080/guvnor-5.2.0.Final-jboss-as-5.1/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST
2011-12-21 20:31:01,835 INFO  [STDOUT] (http-127.0.0.1-8080-5) Provider
org.drools.io.impl.ResourceProviderImpl could not be set.
2011-12-21 20:31:01,835 ERROR [org.in.treetech.bss.common.cache]
(http-127.0.0.1-8080-5)  RuleEngine  234  Provider
org.drools.io.impl.ResourceProviderImpl could not be set.
2011-12-21 20:31:01,835 INFO  [STDOUT] (http-127.0.0.1-8080-5) After adding
packages
2011-12-21 20:31:01,835 ERROR [org.in.treetech.bss.common.cache]
(http-127.0.0.1-8080-5)  RuleEngine  173  Provider
org.drools.impl.KnowledgeBaseProviderImpl could not be set.
2011-12-21 20:31:01,835 INFO  [STDOUT] (http-127.0.0.1-8080-5) After
creation of Kbase
2011-12-21 20:31:01,835 INFO  [STDOUT] (http-127.0.0.1-8080-5) FactName
issample-person
2011-12-21 20:31:01,835 ERROR [org.in.treetech.bss.common.cache]
(http-127.0.0.1-8080-5)  RuleEngine  390  null
2011-12-21 20:31:01,835 INFO  [STDOUT] (http-127.0.0.1-8080-5) Rule engine
ended

--
View this message in context: http://drools.46999.n3.nabble.com/adding-all-packages-to-kbuilder-in-web-application-geting-errors-tp3604551p3604551.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list