Caly LeeAnn

Ranch Hand
+ Follow
since Nov 22, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Caly LeeAnn

Thank you, Jim! This is simple and straight forward and it's exactly what I need!
17 years ago
Anand,

Sorry about that.

Is it possible to restrict the length in the RE itself? Checking the length later is not first option for the condition.
17 years ago
Anand,

Sorry about that.

Is it possible to restrict the length in the RE itself? Checking the length later is not first option for the condition.
17 years ago
That doesn't restrict the whole length of the string to less than or equal to 15. This string "0123456789,0123456789" which its length is 21 passes.
17 years ago
That doesn't restrict the whole length of the string to less than or equal to 15. This string "0123456789,0123456789" which its length is 21 passes.
17 years ago
I need to write a Regular Expression to match the string with the following criteria:

1. the string can only include digits and one and only one comma
2. the whole length of the string is less than or equal to 15
3. the comma can appear anywhere in the string but not at the first place of the string

For example, this string '12123451,13,' should not be matched.

Any advice will be appreciated. Thank you.
17 years ago
I need to write a Regular Expression to match the string with the following criteria:

1. the string can only include digits and one and only one comma
2. the whole length of the string is less than or equal to 15
3. the comma can appear anywhere in the string but not at the first place of the string

For example, this string '12123451,13,' should not be matched.

Any advice will be appreciated. Thank you.
17 years ago
Hi,

I am trying the BeanShell example provided at <a href="http://www.springframework.org/docs/reference/dynamic-language.html">Chapter 24. Dynamic language support</a> - 24.3.4. BeanShell beans.

And I have an 'IllegalAccessError' when I try to use the scripted bean in my java code.

The scripted bean 'BshMessenger.bsh' is written as the following and is deployed under ${mydomain}/config.
String message = "Hello World";

String getMessage() {
return message;
}

The interface 'Messenger' is like the following.
package org.testing.scripting.beanshell;

public interface Messenger {

String getMessage();
}

The configuration in the Spring xml file is like the following:

<lang:bsh id="messageService" refresh-check-delay="2000" script-source="classpath:config/BshMessenger.bsh" script-interfaces="org.testing.scripting.beanshell.Messenger">
</lang:bsh>

<bean class="com.testing.Cube">
<property name="messenger" ref="messageService" />
</bean>


Any advices of how to solve this problem will be appreciated. Thank you.


--------------------------------------------------------------------------------------------------------------------------------

Jun-05-2007 17:31:26 WARN (CommonsLoggingOutput.java:67) - Method execution failed:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scriptedObject.messageService': Instanti
ation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public
java.lang.Object org.springframework.scripting.bsh.BshScriptFactory.getScriptedObject(org.springframework.scripting.ScriptSourc
e,java.lang.Class[]) throws java.io.IOException,org.springframework.scripting.ScriptCompilationException] threw exception; neste
d exception is java.lang.IllegalAccessError: bsh/XThis
Caused by:
org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public java.lang.Object org.springframework.scri
pting.bsh.BshScriptFactory.getScriptedObject(org.springframework.scripting.ScriptSource,java.lang.Class[]) throws java.io.IOExce
ption,org.springframework.scripting.ScriptCompilationException] threw exception; nested exception is java.lang.IllegalAccessErro
r: bsh/XThis
Caused by:
java.lang.IllegalAccessError: bsh/XThis
at org.springframework.scripting.bsh.BshScriptUtils.evaluateBshScript(Ljava.lang.String;[Ljava.lang.Class;Ljava.lang.Cla
ssLoader Ljava.lang.Object;(BshScriptUtils.java:159)
at org.springframework.scripting.bsh.BshScriptUtils.createBshObject(Ljava.lang.String;[Ljava.lang.Class;Ljava.lang.Class
Loader Ljava.lang.Object;(BshScriptUtils.java:90)
at org.springframework.scripting.bsh.BshScriptFactory.getScriptedObject(Lorg.springframework.scripting.ScriptSource;[Lja
va.lang.Class Ljava.lang.Object;(BshScriptFactory.java:145)
at jrockit.reflect.NativeMethodInvoker.invoke0(Ljava.lang.Object;ILjava.lang.Object;[Ljava.lang.Object Ljava.lang.Objec
t;(Unknown Source)
at jrockit.reflect.NativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object Ljava.lang.Object;(Unknown Source)
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object Ljava.lang.Object;(Unknown So
urce)
at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(Lorg.springframework.beans.factory.
support.RootBeanDefinition;Ljava.lang.String;Lorg.springframework.beans.factory.BeanFactory;Ljava.lang.Object;Ljava.lang.reflect
.Method;[Ljava.lang.Object Ljava.lang.Object;(SimpleInstantiationStrategy.java:118)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(Ljava.lang.String;Lorg.sp
ringframework.beans.factory.support.RootBeanDefinition;[Ljava.lang.Object Lorg.springframework.beans.BeanWrapper;(ConstructorRe
solver.java:315)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(Ljava.lang
.String;Lorg.springframework.beans.factory.support.RootBeanDefinition;[Ljava.lang.Object Lorg.springframework.beans.BeanWrapper
;(AbstractAutowireCapableBeanFactory.java:758)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(Ljava.lang.String;Lor
g.springframework.beans.factory.support.RootBeanDefinition;[Ljava.lang.Object Lorg.springframework.beans.BeanWrapper;(AbstractA
utowireCapableBeanFactory.java:712)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(Ljava.lang.String;Lorg.spring
framework.beans.factory.support.RootBeanDefinition;[Ljava.lang.Object Ljava.lang.Object;(AbstractAutowireCapableBeanFactory.jav
a:386)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ljava.lang.String;Ljava.lang.Class;[Ljava.lang.
Object Ljava.lang.Object;(AbstractBeanFactory.java:270)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ljava.lang.String Ljava.lang.Object;(AbstractB
eanFactory.java:160)
at org.springframework.aop.target.dynamic.BeanFactoryRefreshableTargetSource.freshTarget()Ljava.lang.Object;(BeanFactory
RefreshableTargetSource.java:65)
at org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource.refresh()V(AbstractRefreshableTargetSource.jav
a:95)
at org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource.getTarget()Ljava.lang.Object;(AbstractRefresha
bleTargetSource.java:80)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Ljava.lang.Object;Ljava.lang.reflect.Method;[Ljava.lang.O
bject Ljava.lang.Object;(JdkDynamicAopProxy.java:183)
at $Proxy13.toString()Ljava.lang.String;(Unknown Source)
at java.lang.String.valueOf(Ljava.lang.Object Ljava.lang.String;(Unknown Source)
at java.lang.StringBuffer.append(Ljava.lang.Object Ljava.lang.StringBuffer;(Unknown Source)
.....
Jun-05-2007 17:31:26 WARN (CommonsLoggingOutput.java:59) - --Erroring: batchId[0] message[org.springframework.beans.factory.Bea
nCreationException: Error creating bean with name 'scriptedObject.messageService': Instantiation of bean failed; nested exceptio
n is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public java.lang.Object org.springframework
.scripting.bsh.BshScriptFactory.getScriptedObject(org.springframework.scripting.ScriptSource,java.lang.Class[]) throws java.io.I
OException,org.springframework.scripting.ScriptCompilationException] threw exception; nested exception is java.lang.IllegalAcces
sError: bsh/XThis]
Our application is running on JBoss 3.0.3. We are migrating it to run on JBoss 4.0.4 clustering environment.

Some application modules use JDBC to talk to the database. How should I handle the data synchronization issue? For example,

If one request from client A to application to update the firstname, and another request from client B to update the lastname. In this situation how should I keep the updates from those two requests?

Also, if I want the application to run in a highly available environment, what should I consider from application(coding) point of view? I realized this wasn't a simple topic, but a direction will be helpful.

Any advices will be appreciated.

Thank you.
17 years ago
The jsp file is not compiled into the class file when it's first invoked. I can't find the service_jsp.java and the service_jsp.class under the working directory.

I can't tell why the jsp file is not compiled into class file from the exception stack trace. Are there any other places that I should check?
17 years ago
Thank you for your reply.

When you refer to class path, do you mean the classpath set as an environment variable? If so, the classpath is not set, which is same as before the upgrade. Any other places should I look into?
17 years ago
I am upgrade JBoss application server from 3.0.3 to 4.0.4.

Before the upgrade this services.jsp was loaded properly after I login. But I have the following exception after the upgrade. The jsp is not precompiled kind.

In ${JBOSS_HOME}/server/myApp/deploy/jbossweb-tomcat55.sar/META-INF/jboss-service.xml, I have set 'Java2ClassLoadingCompliance' and 'UseJBossWebLoader' to true.

15:18:10,156 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.ClassNotFoundException: org.apache.jsp.service_jsp
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:133)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:65)
at org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:596)
at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:147)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:315)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.liq.login.DisabledUserFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)

Any advice is appreciated. Thank you.
17 years ago
Thank you for your reply. That helps.

I am still a bit confused about the explored directory. For example, what is the reason to make a explored directory myApp.war instead of just the war file version of myApp.war? The same to the sar file. jbossweb-tomcat55.sar is a explored directory but for example ushMonitor.sar is one sar file.

And what is ear file? what is the purpose of using either a ear file or a explored directory like myApp.ear. I saw a deployment structure of an application was like this:

${JBOSS_HOME}/server/entApp/
|- conf
|- data
|- deploy
| |- ent.jar (explored directory)
| | |- ent.ear (explored directory)
| | | |- ent.war (explored directory)
| | | | |- {.jsp, .html}
| | | | |- WEB-INF
| | | | | |- lib (third party .jar)
| | | | ... ...
| | | |- ent-ejb.jar (one jar file)
| | | ... ...
| | |- entMonitor.sar (one sar file)
... ... ... ... ...

Is this a good practice?
17 years ago