[JNDI/Naming/Network] - Class Cast Exception thrown when casting Data Source jboss
by Pranava_kumar2003
HI
I am trying to get a DataSource object in a stand alone java program.
this is my program
| import java.util.*;
| import javax.naming.*;
| public class jndi {
| public static void main(String args[]){
| try{
|
| Properties prop = new Properties();
| prop.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
| prop.put("java.naming.provider.url","jnp://localhost:51099" );
| prop.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
| Context context = new InitialContext(prop);
| Object dSource = context.lookup("java://qpmDS");
| System.out.println(dSource.toString());
| javax.sql.DataSource da =(javax.sql.DataSource) dSource;
|
| }catch(Exception ex){
| ex.printStackTrace();
| System.out.println("Error-1.0"+ex);
| }
|
| }
| }
|
|
Here
Object dSource = context.lookup("java://DSname");
|
dSource object is a org.jnp.interfaces.NamingContext's object
When i try to type cast it it throwing Type cast exception
pls let me is there any problem in my code.
Pranav
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968084#3968084
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968084
19 years, 8 months
[JBoss Portal] - Management Portlet, strange behaviour
by MaxVanLoon
I succesfully login as administrator into portal, and I can succesfully add/remove pages to my site deployed into portal.
The fact is that if I restart JBoss, and I get again logged into portal, all that I have previously created is disappeared :(
The pentaho-object.xml file into this deployed directory:
/home/pentahome/pentaho/jboss/server/default/deploy/jboss-portal.sar/pentaho-portlets.war/WEB-INF
contains all the preconfigured entries, that of course survive to the jboss restart.
I noticed that if I make changes to that file I'll be able to see that after server restart, but it's crazy that I cannot create thinghs at runtime into the admin section of the portal and see them after server restart.
I also noticed that my pages configuration infos are succesfully stored into auth DB schema.
Please help, we are evaluating this solution for our next BI projects so I would like to understand if this is a lack of my skills in jboss portal, a bug, or whatever.
Thanks
Max
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968081#3968081
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968081
19 years, 8 months