Pramod Kumar

Ranch Hand
+ Follow
since Oct 05, 2007
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 Pramod Kumar

Hi,

While I am working with eclipse suddenly it will crash and an error will popup with the following message. Please help me

Background Indexer Crash Recovery
java.lang.OutOfMemoryError


Thanks,
Hi,

I am not able to print the transparent images in IE6, when I take a print out a white patch is appearing on around the image it happens only in IE6. any fix around this to work.

Thanks,
Thanks,
I dont want to make 2 wars I have to make it only one war. How can I do that?
16 years ago
Hi

How can I create 2 context roots for a single war, I have 2 modules and need to be accessed with 2 urls suppose /sampleApp and /sampleApp/module1

How can I create this in weblogic8 I am using struts.
16 years ago
Hi, I have a arraylist and I need to iterate and display the values with <bean:write

here is the code

<bean:write name="allnames" />

I am adding allnames.add("name1");......etc

it is displaying in browser as [name1, name2] in a single row I need to be displayed seperately.

<bean:write name="allnames" property="?"/>


what is the property name here I need to give?
16 years ago
I have used
<property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>

it started working.

Thanks,
Hi,

I am getting the following exception,

javax.persistence.PersistenceException: org.hibernate.HibernateException: Could not instantiate cache implementation

---------

org.hibernate.HibernateException: Could not instantiate cache implementation


--------

org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]


I have placed

<property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>

in my persistance.xml under properties tag and still I am getting this exception .....

Thanks,
Pramod.
Hi,

When I an doing this

session.saveOrUpdate(user);

ignoring persistent instance

object already associated with session

I am not getting any Exception and in the database values are not updating.

Thanks,
I have created jndi.properties file in class path and I have given the properties in it.

java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.provider.url=t3://localhost:7001

and in the code I have given as below but still I am getting the same exception. Do I need to code any thing? My datasource name is UserDs



-----------------------------------------
1718 [main] INFO org.hibernate.util.NamingHelper - JNDI InitialContext properties:{}
8249 [main] FATAL org.hibernate.connection.DatasourceConnectionProvider - Could not find datasource: OamDs
javax.naming.NameNotFoundException: Unable to resolve 'UserDs'. Resolved '' [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'UserDs'. Resolved '']; remaining name 'UserDs'
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:195)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:338)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
at weblogic.jndi.internal.ServerNamingNode_921_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:374)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:362)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
I am getting exception while using jta-data-source

I am using Weblogic 9.2, I have created a DataSource with the name UserDs with all the properties in Weblogic and I gave that datasource name in jta-data-source I am getting the exception as shown below.

<persistence>
<persistence-unit name="userconsole">
<jta-data-source>UserDs</jta-data-source>
<class>user.Users</class>

<properties>

<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
</properties>
</persistence-unit>
</persistence>


javax.persistence.PersistenceException: org.hibernate.HibernateException: Could not find datasource
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:217)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
at entity.PersonTest.initEmfAndEm(PersonTest.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)



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

1937 [main] INFO org.hibernate.util.NamingHelper - JNDI InitialContext properties:{}
1953 [main] FATAL org.hibernate.connection.DatasourceConnectionProvider - Could not find datasource: OamDs
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
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:61)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1928)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:631)


------------------
Hi,

I need to read the database properties from a configurable properties file and set to the persistance.xml how can I do this for example if I need to change the database I need to go to persistance.xml and need to change the values, but I need like there should be a properties file in that I need to configure all the database properties and need to access those values to persistance.xml how can I do this?
Hi,

If I will copy the application url in the browser and paste it in a new browser, the request goes to --------- which servlet? How I can track the request? In web.xml <servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class> can I change this action servlet to any user defined servlet?

Thanks
[ November 06, 2007: Message edited by: Pramod Kumar ]
16 years ago
Hi I need to sort an object which is persisted.

Set<User> users = EntM.Users(); // In this step I will get all the users in the database but how can I sort the users Set?

users.sort()?? how can I do this.

Thanks,
Hi,

I need to create a datasource and need to use that every time.

Right now I am giving these properties in persistance.xml.

<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect" />
<property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver" />
<property name="hibernate.connection.username" value="pramod" />
<property name="hibernate.connection.password" value="pramod" />
<property name="hibernate.connection.url" value="jdbc racle:thin:@localhost:1521:localdb" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
</properties>


and when ever I need to persist or remove I am doing this each and every time
EntityManagerFactory emf =Persistence.createEntityManagerFactory("usermgt");

Give me some sugessions so that I can use this commonly. I am using weblogic9.2.

Thanks,
Now I am having one more problem, if the Set is empty in the jsp I am getting empty select box. If the Set is empty I need to show as "No values".

How can I do this.

Thanks.
16 years ago