[JCA/JBoss] - Problem of accessing Oracle DS in JBOSS from a stand-alone J
by guha_gourab
Hello,
I am trying to access Oracle data source in Jboss from a stand-alone java program. For doing this I have done the following:
(1) Copied the oracle driver (classes12.jar) in server\default\lib directory of
JBOSS_HOME.
(2) Copied the oracle-ds.xml file from docs\examples\jca directory of JBOSS_HOME to
server\default\deploy of JBOSS_HOME.
In this file I have changed the connection URL.
(3) Next I have changed the default standardjaws.xml. I have changed the data source
name and its type-mapping to Oracle8.
(4) I have changed standardjbosscmp-jdbc.xml file also.
(5) I have put an entry in login-config.xml file also.
The code that I used to access the JNDI name for the data source is follows
public class JNDIServiceLocator
{
private static InitialContext intContex =null;
static
{
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY , "org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL , "jnp://localhost:1099");
env.put("java.naming.rmi.security.manager", "yes");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming");
try
{
intContex = new InitialContext(env);
System.out.println("Created the context ....");
}
catch(Exception e)
{
e.printStackTrace();
}
}
public static void main(String[] args)
{
try
{
intContex.lookup("java:/OracleDS");
}
catch (NamingException e)
{
e.printStackTrace();
}
}
}
Now I am getting the following exception
Created the context ....
javax.naming.NameNotFoundException: OracleDS not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:530)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
at javax.naming.InitialContext.lookup(Unknown Source)
at JNDIServiceLocator.main(JNDIServiceLocator.java:33)
Can anybody give me any guide line regarding this problem.
Regards,
Gourab
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031984#4031984
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031984
19Â years
[Persistence, JBoss/CMP, Hibernate, Database] - Mapping exception
by gailcassar85
I am using Hibernate Core 3.2.2 with Jboss Application Server 4.0.5GA. I managed to map my entities using myEntity.hbm.xml file for each. However, now I would like to use Hibernate Annotations to facilitate mapping especially when having attribute ovverrides in an embeddable class.
I have replaced the myEntity.hbm.xml files with hibernate.cfg.xml file which includes a list of mapping classes as follows. I have placed the config file in the root of my source code outside any package.
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
jdbc:mysql://localhost/myDB
guest
password
com.mysql.jdbc.Driver
org.hibernate.dialect.MySQLDialect
org.hibernate.transaction.JTATransactionFactory
thread
true
create
<!-- mapping files -->
</session-factory>
</hibernate-configuration>
However when I run my application and arrive at the point of saving one of my entities, the following exception is thrown:
org.hibernate.MappingException: Unknown entity: com.company.test.ejb.entity.TestEntity
at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:548)
at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1338)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:96)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
at com.company.test.ejb.session.myTestApp.method1(TestThread.java:70)
So I'm assuming that during deployment the hibernate.cfg.xml is not being considered. Am I placing the file in the wrong place or do I have to add some configuration settings to Jboss?
Thanks
Gail
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031980#4031980
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031980
19Â years
[JBoss Portal] - Handle HTTP errors or Exceptions gracefully
by engela
I quite like to configure my portal or my portlets to go to an error page if an exception or Http Error is thrown. To so I have added the usual error page elements to the web.xml of my portlet as well as to the web.xml file in jboss-portal.sar/portal-server.war/WEB-INF:
<error-page>
| <error-code>500</error-code>
| <location>/error.jsp</location>
| </error-page>
| :
| :
| <error-page>
| <exception-type>javax.portlet.PortletException</exception-type>
| <location>/error.jsp</location>
| </error-page>
There is a error.jsp in the root of my portlet as well as in jboss-portal.sar/portal-server.war diretory. Despite this the generic "HTTP Status 500" error page generated by Tomcat is displayed when my portlet throws a PortletException.
Does anyone know how to configure the portal or a portlet to display a specified error page if a HTTP error or Exception is thrown.
Thanks,
Anette
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031977#4031977
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031977
19Â years
[JBoss Seam] - Handling nested conversations [newbie]
by jlemoine
Hi,
this is quite basic but I can't find resources on that :
I'm running into trouble with conversation contexts.
Imagine the following -classic- scenario involving State and Country entities:
1 - a user initiates the Create State process, and searches for the adequate Country in a drop down menu.
2 - since the Country does not exist yet, he clicks the "New Country" button
to launch the Create Country child process.
3 - the country created, the app resumes the Create State process, and why not pre-selects the newly created country in the (updated) menu.
This is so basic that I couldn't find anything on that.
The Seam Issue example handles sub processes, but is not self explanatory and doesn't work ("conversation ended"...).
I've seen that the login procedure does that, but I can't imagine putting interceptors everywhere.
Last, I've browsed the javadoc and found stuff like Conversation.endAndRedirect() but I really don't know how to use that.
I've poked around with @Begin(nested=true) annotations and the like, without success ("conversation ended ..." at best).
Is there any simple tutorial for that use-case, guideline, best practice?...
Thanks in advance,
Jean
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031970#4031970
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031970
19Â years
[JBoss Seam] - jboss.com Nested exception: jboss.com <- HELP
by Stateless Bean
Hi,
When I migrated from Seam 1.1.6 to 1.2 i get following error:
When I try starting my app, offline (no internet connection) i get this:
| 12:33:59,313 INFO [Pages] reading pages.xml
| 12:33:59,463 ERROR [SeamPhaseListener] uncaught exception
| java.lang.RuntimeException: org.dom4j.DocumentException: jboss.com Nested exception: jboss.com
| at org.jboss.seam.core.Pages.getDocumentRoot(Pages.java:795)
| at org.jboss.seam.core.Pages.parse(Pages.java:760)
| at org.jboss.seam.core.Pages.initialize(Pages.java:99)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:121)
|
and redirects from pages.xml couldn't work:
When I'm online everythink works fine!
Maybe i need some library?
here is my libs list:
EAR:
| boss-seam.jar
| myProject.jar
| el-api.jar
| el-ri.jar
| drools-compiler-3.0.5.jar
| drools-core-3.0.5.jar
| commons-jci-core-1.0-406301.jar
| commons-jci-janino-2.4.3.jar
| commons-lang-2.1.jar
| janino-2.4.3.jar
| stringtemplate-2.3b6.jar
| antlr-2.7.6.jar
| antlr-3.0ea8.jar
|
WAR:
| jboss-seam-ui.jar
| jsf-facelets.jar
any help?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031968#4031968
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031968
19Â years
[Installation, Configuration & Deployment] - JBoss 4.0.5, AIX, JRE 1.4 and java.lang.ClassCastException
by jova73
Hi,
I'm trying to use JBoss 4.0.5.GA on an AIX server with IBM JRE 1.4.2
I get this exceptions at startup:
| 2007-03-27 11:15:19,125 ERROR [org.jboss.xb.binding.Util] Failed to create schema loader.
| java.lang.ClassCastException: org.apache.xerces.dom.DOMXSImplementationSourceImpl
| at org.w3c.dom.bootstrap.DOMImplementationRegistry.newInstance(Unknown Source)
| at org.jboss.xb.binding.Util$5.run(Util.java:512)
| at java.security.AccessController.doPrivileged1(Native Method)
| at java.security.AccessController.doPrivileged(AccessController.java(Compiled Code))
| at org.jboss.xb.binding.Util.getXSImplementation(Util.java:488)
| at org.jboss.xb.binding.Util.loadSchema(Util.java:387)
| at org.jboss.Main$1.run(Main.java:490)
| ...
| at java.lang.Thread.run(Thread.java:570)
| 2007-03-27 11:15:19,139 INFO [org.jboss.system.ServiceConfigurator] Problem configuring service jboss.web:service=WebServer
| org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed to create schema loader: org.apache.xerces.dom.DOMXSImplementationSourceImpl
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:170)
| at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:140)
| at org.jboss.system.ServiceConfigurator.parseJbxbSerialData(ServiceConfigurator.java:643)
| at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:327)
| at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:460)
| at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
| at org.jboss.system.ServiceController.install(ServiceController.java:226)
| ...
| at org.jboss.Main$1.run(Main.java:490)
| at java.lang.Thread.run(Thread.java:570)
| Caused by: java.lang.IllegalStateException: Failed to create schema loader: org.apache.xerces.dom.DOMXSImplementationSourceImpl
| at org.jboss.xb.binding.Util$5.run(Util.java:518)
| at java.security.AccessController.doPrivileged1(Native Method)
| at java.security.AccessController.doPrivileged(AccessController.java(Compiled Code))
| at org.jboss.xb.binding.Util.getXSImplementation(Util.java:488)
| at org.jboss.xb.binding.Util.loadSchema(Util.java:387)
| at org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.java:166)
| at org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.java:137)
| at org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver.resolve(DefaultSchemaResolver.java:248)
| at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:162)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:301)
| at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
| at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
| at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
| at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
| at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
| at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:166)
| ... 89 more
|
No problems with:
- JBoss 3.2.1 with same AIX server and same JRE
- JBoss 4.0.5 GA on Windows XP with JDK 1.4.2
I noticed that the IBM JRE 1.4 has a file <JAVA INSTALLATION DIR>/jre/lib/xml.jar and I think that it could be the reason of the ClassCastException, with a clash between that jar file and JBOSS/lib/endorsed/xercesImpl.jar
Am I correct? How can I solve this problem?
Thanks in advance,
Andrea
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031965#4031965
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031965
19Â years