subbarao dachepalli

Greenhorn
+ Follow
since Jul 28, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by subbarao dachepalli

Hi,

I am using Spring 3.0.5

I have multiple schedulers in multiple classes annotated with @Scheduled annotation with cron expression like:
1) @Scheduled(cron = "0 * * * * ?")
public void doSomething1()
2) @Scheduled(cron = "0 0/5 * * * *")
public void doSomething2()

Now i have a requirement where in i will get the cron expression from UI. and I have to reschedule the existing schedulers according to the expressions received from UI. I will be storing the values in DB.
I tried googling but did not get the solution.
Can you please suggest best approach for achieving this.

Thanks in Advance.
10 years ago
Hi all

I am new to servltes.I am developing webappliction and i have requirement that
is if the session has expired and then if user tries to access any page then the page should direct to some page saying that the "session has expired.Plz login to the system".

Please advice me.

Thansks
18 years ago
Hi all,

I am trying connection pooling with tomcat 5.0.28.I have searched all sites.
I have put the follwing in server.xml file:

<Context path="/DBTest" docBase="DBTest"
debug="5" reloadable="true" crossContext="true">

<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_DBTest_log." suffix=".txt"
timestamp="true"/>

<Resource name="jdbc/TestDB"
auth="Container"
type="javax.sql.DataSource"/>

<ResourceParams name="jdbc/TestDB">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>100</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>30</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
<parameter>
<name>username</name>
<value>ccm</value>
</parameter>
<parameter>
<name>password</name>
<value>ccmccm</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>org.gjt.mm.mysql.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:mysql://192.168.0.36:3306/ccm?autoReconnect=true</value>
</parameter>
</ResourceParams>
</Context>

I have put the following code in web.xml file

<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/TestDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

and i have written following code in one pool.java:
Context context = new InitialContext();
DataSource ds = (DataSource)context.lookup("java:comp/env/jdbc/DBTest");

and then i got the error:

javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

so i have changed code like
Context context = getInitialContext();
....

static public Context getInitialContext() throws Exception {
Hashtable h = new Hashtable();
h.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.commons.dbcp.BasicDataSourceFactory");
h.put(Context.PROVIDER_URL, "jdbc:mysql://192.168.0.82/ccm");
h.put(Context.SECURITY_PRINCIPAL, "ccm");//user
h.put(Context.SECURITY_CREDENTIALS, "ccmccm"); //password
return new InitialContext(h);
}
javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.commons.dbcp.BasicDataSourceFactory [Root exception is java.lang.ClassCastException]

i have put commonsdbcp.jar,commonspool.jar,coomonscollections.jar files on classpath.

But i still not able to get it right?
can any body help me?

Advance Thanks

Regards
Subbarao.
18 years ago
Hi all

I am new hibernate.I tried to do some simple program.
But i got null pointer exception.

my code is :
Configuration cfg = new Configuration().addClass(Contact.class);
System.out.println("-----c-"+cfg);
cfg.configure("/hibernate.cfg.xml");
SessionFactory sessionFactory = cfg.buildSessionFactory();
session =sessionFactory.openSession();

I am not able to get that println.(I added that println to know where exactly the null pointer exception is throwing).

can any body tell me where iam going wrong
Thanks in advamce
Hi all
I am to jsp&servlets.
In one of my web page there is a text box name' product name'.
So users will enter product names which might contain spaces.

My problem is when product name is entered with spaces i'm not getting text after space in the next jsp page.I am redaing the value of that as:
request.getParameter("productName");

how to get the full text after the spaces .

Thanks in advance
[ August 06, 2005: Message edited by: Bear Bibeault ]
18 years ago
JSP