[JBoss/Spring Integration] - Re: Spring Component Auto Detection
by alesj
I've added the following test to VFS
| public void testDirectoryFind() throws Throwable
| {
| URL url = getResource("/vfs/test/outer.jar");
| String urlString = url.toExternalForm();
| int p = urlString.indexOf(":");
| URL rootURL = new URL("vfszip" + urlString.substring(p) + "/org/jboss/test/vfs");
| VirtualFile root = VFS.getRoot(rootURL);
| assertNotNull(root);
| }
|
which should somehow resemble your case.
And it passes for me locally.
Send me the debug log from VFSResourcePatternResolver
| protected List<Resource> getVFSResources(URL rootURL, String subPattern) throws IOException
| {
| log.debug("Scanning url: " + rootURL + ", sub-pattern: " + subPattern);
| VirtualFile root = VFS.getRoot(rootURL);
| PatternVirtualFileVisitor visitor = new PatternVirtualFileVisitor(subPattern);
| root.visit(visitor);
| if (log.isTraceEnabled())
| log.trace("Found resources: " + visitor);
| return visitor.getResources();
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172756#4172756
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4172756
17 years, 7 months
[JBoss Cache: Core Edition] - Clumsy JDBC configuration 2.2.0.CR7
by mbrade
Hello
I'm configuring the cache using Spring. And I noticed some strange behaviours with the JDBCCacheLoader. I'm using C3p0 for connectionpooling and I have my own ddl for table creation and I rewrote some sqls.
Because there are no setters for all the c3p0 properties I have to use the setProperties method. For all others I wanted to use the setters.
After my first tries. I got severall sql exceptions. Especially on those sqls I haven't wrote on my own. I checked the source code and noticed that the configurer does some default configurations while processing the properties. It creates some default sqls if not set.
Now lets say you use another tablename and use the setter to configure instead of the properties (I need them only for c3p0). the order you call the methods results in different configurations. One that might work and one that doesn't. All the default sqls would be created with the default table name. All others will be overriden by the setter if not specified before.
Wouldn't it be better to have an state for the configuration-Objects. And to have an explicit initialisation task?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172740#4172740
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4172740
17 years, 7 months
[JBoss jBPM] - jbpm jrules Rule Compilation error
by shoba
Hi All,
Im working on jbpm jrule sample. I'm getting this error while running jbpm application in jbpm-console.
Error completing task: An exception of type "org.jbpm.graph.def.DelegationException" was thrown. The message is: Rule Compilation error : [Rule name=Your First Rule, agendaGroup=MAIN, salience=0, no-loop=false] login/Rule_Your_First_Rule_0.java (2:23) : Only a type can be imported. com.sample.action.LoginBean resolves to a package login/Rule_Your_First_Rule_0.java (8:285) : l cannot be resolved login/Rule_Your_First_Rule_0.java (9:326) : l cannot be resolved com.sample.action.LoginBean
Please help me to get through this error.
Here is my files:
-----------------------------------------------------
loginrule.drl
-----------
package login
import com.sample.action.LoginBean;
#list any import classes here.
#declare any global variables here
rule "Your First Rule"
when
exists LoginBean
LoginBean(username == "XXX")
then
System.out.println("first rule");
end
----------------------------------------------------------
RulesActionHandler.java
-----------------------
package com.sample.action;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
import org.drools.RuleBase;
import org.drools.compiler.PackageBuilder;
import org.drools.RuleBaseFactory;
import org.drools.WorkingMemory;
public class RulesActionHandler implements ActionHandler {
String RuleFile = "/loginrule.drl";
public void execute(ExecutionContext executionContext) throws Exception {
// TODO Auto-generated method stub
String username = (String)executionContext.getContextInstance().getVariable("u1");
String department = (String)executionContext.getContextInstance().getVariable("u2");
com.sample.action.LoginBean bean = new com.sample.action.LoginBean();
bean.setUsername(username);
bean.setDepartment(department);
bean.print();
RuleBase ruless = readRule(RuleFile);
WorkingMemory memory = ruless.newStatefulSession();
memory.insert((LoginBean)bean);
org.jbpm.context.exe.ContextInstance ci = executionContext.getContextInstance();
memory.setGlobal("ci", ci);
executionContext.getToken().signal();
}
private RuleBase readRule(String filename) throws java.io.IOException,Exception{
RuleBase rulebase = null;
PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl(new java.io.InputStreamReader(RulesActionHandler.class.getResourceAsStream(filename)));
rulebase = RuleBaseFactory.newRuleBase();
rulebase.addPackage(builder.getPackage());
return rulebase;
}
}
---------------------------------------------------------------------
LoginBean.java
--------------
package com.sample.action;
public class LoginBean {
public LoginBean() {
super();
// TODO Auto-generated constructor stub
}
private String username;
private String department;
public String getUsername() {
return username;
}
public LoginBean(String username) {
super();
this.username = username;
}
public LoginBean(String username, String department) {
super();
this.username = username;
this.department = department;
}
public void setUsername(String username) {
this.username = username;
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
public void print(){
System.out.println("User Namev : "+username);
System.out.println("Department : "+department);
}
}
---------------------------------------------------------------------
processdefinition.xml
-------------------
<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="loginprocess">
<start-state name="enterlogin">
</start-state>
/loginrule.drl
<end-state name="finish">
</end-state>
</process-definition>
Thanking You,
Shoba
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172739#4172739
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4172739
17 years, 7 months