Failed to look up JNDI DataSource with name 'jdbc/testDS1'
by Julie Wilson
Hey there,
I am very much a newbie to Drools, and I have been following the sample
Application setup in the Drools Jboss Rules 5.0 developers guide.
However, I am having some very very annoying problems with my
persistence setup. My application is giving the following error, and
then appears to use a default database jdbc:h2:mem:mydb,
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'entityManagerFactory' defined in class path resource
[applicationContext.xml]: Invocation of init method failed; nested
exception is
org.springframework.jdbc.datasource.lookup.DataSourceLookupFailureExcept
ion: Failed to look up JNDI DataSource with name 'jdbc/testDS1'; nested
exception is javax.naming.NameNotFoundException: Name jdbc is not bound
in this Context
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObjec
t(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.g
etSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(
AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.pre
InstantiateSingletons(DefaultListableBeanFactory.java:423)
at
org.springframework.context.support.AbstractApplicationContext.finishBea
nFactoryInitialization(AbstractApplicationContext.java:728)
at
org.springframework.context.support.AbstractApplicationContext.refresh(A
bstractApplicationContext.java:380)
at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationCon
text(FrameworkServlet.java:402)
at
org.springframework.web.servlet.FrameworkServlet.initWebApplicationConte
xt(FrameworkServlet.java:316)
at
org.springframework.web.servlet.FrameworkServlet.initServletBean(Framewo
rkServlet.java:282)
at
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.jav
a:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav
a:1173)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j
ava:4187)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4496
)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:519)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by:
org.springframework.jdbc.datasource.lookup.DataSourceLookupFailureExcept
ion: Failed to look up JNDI DataSource with name 'jdbc/testDS1'; nested
exception is javax.naming.NameNotFoundException: Name jdbc is not bound
in this Context
at
org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup.getDataS
ource(JndiDataSourceLookup.java:47)
at
org.springframework.orm.jpa.persistenceunit.PersistenceUnitReader.parseP
ersistenceUnitInfo(PersistenceUnitReader.java:281)
at
org.springframework.orm.jpa.persistenceunit.PersistenceUnitReader.parseD
ocument(PersistenceUnitReader.java:215)
at
org.springframework.orm.jpa.persistenceunit.PersistenceUnitReader.readPe
rsistenceUnitInfos(PersistenceUnitReader.java:139)
at
org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManage
r.readPersistenceUnitInfos(DefaultPersistenceUnitManager.java:303)
at
org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManage
r.preparePersistenceUnitInfos(DefaultPersistenceUnitManager.java:275)
at
org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManage
r.afterPropertiesSet(DefaultPersistenceUnitManager.java:260)
at
org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.creat
eNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:
192)
at
org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterProper
tiesSet(AbstractEntityManagerFactoryBean.java:291)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 34 more
Caused by: javax.naming.NameNotFoundException: Name jdbc is not bound in
this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:152)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at
org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:15
5)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:88)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:153)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
at
org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.ja
va:104)
at
org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup.getDataS
ource(JndiDataSourceLookup.java:44)
... 44 more
I have searched every forum I can find online to see if I can find the
solution to this proble, but so far I have not had any joy. The setup I
have following the book to the finest detail, and my transaction manager
has been set up using the
http://docs.codehaus.org/display/BTM/Tomcat13 site. Please can
somebody advise me on where I could be going wrong? Is there something
in the book that I am missing? I have put the h2-1.0.77.jar in both my
classpath and in the lib directory of Tomcat6.
Thanks in advance,
Julie
Julie Wilson
Java Developer
Technology
Direct dial: +44 (0) 1442 829879
Email: Julie.Wilson(a)grg.com
www.grassroots.uk.com <http://www.grassroots.uk.com/>
Grass Roots
Logo<http://www.grassroots.uk.com/bdr-emp2/gruk/img/logo-gr-inspiring.jp
g>
________________________________
Grass Roots * * Belfast * * Switchboard +44 (0) 1442 829400
________________________________
Grass Roots is proud to feature in the 2007, 2008, 2009 and 2010 lists
of Sunday Times best 100 companies to work for in the UK.
Registered Name: The Grass Roots Group UK Limited Place of
Incorporation: England & Wales Registered No.: 4155659
Registered Office: Pennyroyal Court, Station Road, Tring, Herts. HP23
5QY
Please consider the environment - do you really need to print this
email?
This e-mail message including any attachment(s) is intended for the addressee only and may be confidential. If you are not the intended
addressee, we request that you notify us immediately and delete this e-mail including any attachment(s), without copying, forwarding,
disclosing or using this (these) in any other way.
16 years
Drools.pom file missing in maven repo?
by Savga, Ilie
Hi,
while trying to build the drools-examples project (its last version, currently available for download) using the corresponding pom file I got a FileNotFindException. The cause was that the file
http://repo1.maven.org/maven2/org/drools/drools/5.0.1/drools-5.0.1.pom
was not in the maven repository anymore. In fact, the whole drools directory is not present there. Was it moved somewhere else or deleted altogether? If the latter, what would be the best (easiest) way to proceed in order to get the project built?
Thanks a lot in advance!
Best regards,
Ilie
16 years
Getting fix for JBRULES-2375
by Norman C
Hi All,
I'm working with Drools Fusion and have run into the deadlock issue in
https://jira.jboss.org/browse/JBRULES-2375 (Drools hangs when events are
retracted). This bug indicates it is fixed in 5.1.0.CR1. How can I get this
fix, or alternatively, where in the SVN repository can I look at the code fix so
I can create a custom version of 5.0.1 with this fix?
Thanks in advance for your help.
Norman
16 years
direct access to guvnor servlet without login
by Zhuk, Yefim
Hello everyone!
I saw several threads related to this or a similar question:
- how to directly access the Guvnor securityService servlet without the login window.
In the single sign-on scenario it is desirable to pass user credentials directly.
What is the URL to pass the credentials?
I provide below the example, but this example does not work
/drools-guvnor/org.drools.guvnor.Guvnor/securityService?username=[]&password=[]
GWT and SEAM frameworks are good in hiding the URL.
Did anyone do this? What is the URL?
Thank you for sharing!
Jeff
16 years
Drools and Guvnor 5.1M2 - Exception being thrown in processChangeSet
by Jeffrey Schneller
I am trying to upgrade to the 5.1M2 build from 5.0.1 and am running into
some issues. I have installed the new 5.1 Guvnor and imported the rules
from my 5.0.1 Guvnor instance.
I then removed the old 5.0.1 drools jars from my app and replaced them
with the 5.1M2 drools jars. I was also added all the dependent
libraries. The code that worked with the 5.0.1 version does not work
with the 5.1M2 version. In 5.0.1 I was constructing the xml and
streaming it into the applyChangeSet method. With 5.1M2 I am just
pointing to the change set xml file that is in the Guvnor.
I am seeing a NullPointerException being thrown in the processChangeSet
method as shown below.
Caused by: java.lang.NullPointerException
at
org.drools.agent.impl.KnowledgeAgentImpl.processChangeSet(KnowledgeAgent
Impl.java:171)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:143)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:130)
Did I miss something? Am I doing something wrong? Below is the code
that I have.
KnowledgeAgentConfiguration kaconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
kaconf.setProperty( "drools.agent.scanDirectories",
"true" );
kaconf.setProperty("drools.agent.newInstance",
"false");
ResourceFactory.getResourceChangeScannerService().start();
ResourceFactory.getResourceChangeNotifierService().start();
String url =
"http://rulerserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.ru
le.package/LATEST/ChangeSet.xml";
KnowledgeAgent kagent =
KnowledgeAgentFactory.newKnowledgeAgent( "Configuration", kaconf );
kagent.setSystemEventListener(new MyDroolsListener());
try {
kagent.applyChangeSet(ResourceFactory.newUrlResource(new URL(url)));
// ERROR IS OCCURING INSIDE OF applyChangeSet
} catch (MalformedURLException e) {
e.printStackTrace();
}
16 years
Unqualified type in strict mode error & java.io.InvalidCastException: org.drools.rule.DialectRuntimeRegistry error
by Ike Okafo
Hi
I got a great answer to my last post and will like to say thank you to
Jeffrey Schneller. I hope to contribute to the
community once my drools knowledge base grows
I have two quick follow up questions to my last post
(1) I imported some rules validate which succesfully within guvnor but I
have a couple of other rules that use maps on which I am getting errors.
The map contains objects of a certain type Class1 and the map key is a Long
(e.g 1L, 2L). The statement causing the error is of the format
eval(Map[1L].getDirection== Map[2L].getDirection). The error I get is
"unqualified type in strict mode for getDirection". I scoured the forums for
a solution and learnt that I need to cast the object from the map to its
specific type before calling any method of the class and so I changed it to
eval(((Class1)Map[2L]).getDirection == ((Class1)Map[3L]).getDirection) but
the errors only got worse.
Is there a resolution for this "unqualified type in strict mode" error?
I should also mention that I get no such error when working with the .DRL
file in my java code outside guvnor.
(2) The second issue I am dealing with involves those rules that validated
in guvnor (I am running guvnor under JBOSS 4.2.3). I validated and built the
package successfully (I did not create a snapshot for deployment). I then
tried to reference the guvnor package to build the rulebase using the
following java code
RuleAgent agent = RuleAgent.newRuleAgent("guvnor.properties");
RuleBase masterRuleBase = agent.getRuleBase();
guvnor.properties contains only one entry url =
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Some...
I got this url from the guvnor deployment page
The error I got when I ran this was "java.io.InvalidCastException:
org.drools.rule.DialectRuntimeRegistry; local class incompatible: stream
classdesc serailVersionUID= 5308493362083281112, local class serialVersionID
= 510
Is there a compatibility issue between Guvnor and JBOSS 4.2.3
Thanks
16 years
Rule Validation/Package Build Error in Guvnor: Class Not Found
by Ike Okafo
Hello,
I am new to Drools and have written a rule .DRL file which contains some
helper function imports from other packages, fact objects imports from
other packages and the rules that act on these facts. The file works well
when I call it from my javacode using the rulebase or knowledgebase
approach.
The drl file itself is in its own package.
I now have a requirement to call the same rules from within Guvnor.
The goal is to enable business users modify these rules through the
Guvnor UI and also take advantage of the disable individual rules
feature within guvnor.
My current difficulty is importing and validating the rules in guvnor,
along with the associated fact jar files and finally interfacing
with guvnor from my code. Any help would be appreciated .
The main error happens when I try to build a binary package and create
a snapshot of the working rule file I imported for deployment.
When I hit the save and validate configuration button, I get
*"class not found"* validation errors for all the classes imported at
the top of the rule file - includingng the helper import functions
and facts used in the rules. Same thing happens when I try to
build the package I get the following errors
"Error importing: <list of all classes in import statement in rule file>"
Here are the steps I followed in importing the rule file and Jar file
containing the classes
into Guvnor
(1) First within Guvnor I created a package corresponding to the package
path
for for each of the jar files whose classes are referenced/imported in the
rule .DRL file
(2) I created the jar files for each of these packages in eclipse
(3) Imported those jars individually into each of the packages created in
guvnor
using upload model jar function and selecting the appropriate path as
created in step 1 2 above
(4) Imported the rule file which is in its own package - using the create
package (upload method)
(5) I then try to save and validate the imported rule file in step 5 (this
is where the error occurs)
I have already setup my code to call guvnor as follows
RuleAgent agent = RuleAgent.newRuleAgent("guvnor.properties");
RuleBase masterRuleBase = agent.getRuleBase();
guvnor.properties contains only one entry
url =
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Some...
It is my understanding that after I import the rule file
I need to save and validate and build the package
in order to point the url to the path above. If I point the url to just
the drl file itself will it work?
i.e url=
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Some...
Any help to resolve the class not found error will
be much appreciated
Thanks
16 years
Time to Scale some Drools
by tolitius
1. What are the options to scale?
If many rule requests are coming from different nodes ( server nodes ) OR
many rule requests are coming from the same node, but with a very high
frequency: WHAT ARE THE BEST PRACTICE(S) to:
Create
Expose
Access
All the knowledge artifacts? ( KnowledgeBase, Session, etc... )
Guvnor is not production ready, hence I am looking for ways / best practices
with production ready components.
2. I understand that "session creation is very light", but how light? We
have certain SLAs in milliseconds for the whole "request / response" travel,
which would include throwing facts into the engine and getting results.
3. Seems like caching a KnowlegeBase ( e.g. GemFire, Terracotta, etc.. )
across nodes would be one way to go, what are others?
Thank you,
/Anatoly
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Time-to-Scale-some-Dr...
Sent from the Drools - User mailing list archive at Nabble.com.
16 years