[EJB/JBoss] - cannot connect db by EJB, pls Help!
by poonwingyee
i need to upgrade my system from jboss 3.0.8 to 4.0.5.
the configuration is difference.
i try to set the
<?xml version="1.0" encoding="UTF-8"?>
| <datasources>
| <local-tx-datasource>
| <jndi-name>ABCDB</jndi-name>
| <connection-url>jdbc:hsqldb:hsql://localhost:4467</connection-url>
|
| <!-- The driver class -->
| <driver-class>org.hsqldb.jdbcDriver</driver-class>
|
| <!-- The login and password -->
| <user-name>sa</user-name>
| <password></password>
| <min-pool-size>5</min-pool-size>
| <max-pool-size>20</max-pool-size>
| <idle-timeout-minutes>0</idle-timeout-minutes>
| <track-statements/>
|
| <security-domain>ABCDbRealm</security-domain>
|
| <prepared-statement-cache-size>32</prepared-statement-cache-size>
| <metadata>
| <type-mapping>Hypersonic SQL</type-mapping>
| </metadata>
| <depends>jboss:service=ABCHypersonic,database=ABC</depends>
| </local-tx-datasource>
|
| <!-- For hsqldb accessed from jboss only, in-process (standalone) mode -->
| <mbean code="org.jboss.jdbc.HypersonicDatabase" name="jboss:service=DOCAWAREHypersonic,database=ABC">
| <attribute name="Port">4467</attribute>
| <attribute name="Silent">true</attribute>
| <attribute name="Database">ABC</attribute>
| <attribute name="Trace">false</attribute>
| </mbean>
| </datasources>
|
in the /conf/login-config.xml
<application-policy name = "ABCDbRealm">
| <authentication>
| <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
| flag = "required">
| <module-option name = "principal">sa</module-option>
| <module-option name = "userName">sa</module-option>
| <module-option name = "password"></module-option>
| <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=ABCDB</module-option>
| </login-module>
| </authentication>
| </application-policy>
|
when i load the web page, the error is occured.
java.lang.ClassCastException in
| try{
| Context ctx = getInitialContext();
| objref = ctx.lookup(lookUpName);
| EJBHome home = (EJBHome)PortableRemoteObject.narrow(objref,homeClass);
| .....
| the error is occured in PortableRemoteObject.narrow(objref,homeClass);
|
how come. i am the first time to setting jboss. please help.!!!!
if i don't use the ejb to connect , i can connect the db to get the data to the web page.
HELP!!!!!!!!!!!!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980960#3980960
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980960
19 years, 6 months
[Clustering/JBoss] - RoundRobin, new cluster member & SFSB == NPE
by pmadzik
Hello,
I know that using RoundRobin policy for SFSB is not best idea, but nevertheless i don't expect behavior described below.
When new member joins to cluster, client crashes with NPE exception:
| [java] Exception in thread "main" java.lang.NullPointerException
| [java] at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:61)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.aspects.remoting.ReplicantsManagerInterceptor.invoke(ReplicantsManagerInterceptor.java:51)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| [java] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulContainer.java:319)
| [java] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
| [java] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| [java] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
| [java] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
| [java] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
| [java] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:398)
| [java] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
| [java] at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:190)
| [java] at org.jboss.remoting.Client.invoke(Client.java:525)
| [java] at org.jboss.remoting.Client.invoke(Client.java:488)
| [java] at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.aspects.remoting.ClusterChooserInterceptor.invoke(ClusterChooserInterceptor.java:77)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.ejb3.stateful.StatefulClusteredProxy.invoke(StatefulClusteredProxy.java:103)
| [java] at $Proxy2.sayHelloFrom(Unknown Source)
| [java] at client.Client.main(Client.java:22)
|
Is it bug in jboss?
I use 4.0.5.GA-ejb3 version. I didn't change anything in default configuration.
Regards,
PM
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980956#3980956
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980956
19 years, 6 months
[JBoss Portal] - Re: Apply a role policy access to a portlet
by manui
"sohil.shah(a)jboss.com" wrote : Manui-
|
| Are your roles specified in the portlet.xml and correspondingly available in the roles table in the portal.
|
|
| Can u post your portlet.xml and jboss-portlet.xml as well.
|
|
| Thanks
| Sohil
Hi Sohil in the admin panel I've inserted the role and I can view in the DB.
my portlet.xml is:
<portlet-app version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet"
xmlns="http://java.sun.com/xml/ns/portlet">
<portlet-name>I18nPortlet</portlet-name>
<portlet-class>org.eu.myheart.portlets.I18nPortlet</portlet-class>
<portlet-info>
I18nPortlet
</portlet-info>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
<user-attribute>
user.name.nickName
</user-attribute>
<user-attribute>
user.business-info.online.email
</user-attribute>
<user-attribute>
user.name.given
</user-attribute>
<user-attribute>
user.name.family
</user-attribute>
<user-attribute>
portal.user.locale
</user-attribute>
<user-attribute>
portal.user.signature
</user-attribute>
<user-attribute>
portal.user.last-login-date
</user-attribute>
</portlet-app>
and my jboss-portlet.xml
<portlet-app>
<portlet-name>I18nPortlet</portlet-name>
<service-name>UserModule</service-name>
<service-class>org.jboss.portal.identity.UserModule</service-class>
<service-ref>:service=Module,type=User</service-ref>
</portlet-app>
Question:
1. there is a user attribute tag to obtain the role of the user??
2. I've also declared the use of the Usermodule, how I can get the role...?
thanks very much manuel
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980955#3980955
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980955
19 years, 6 months
[JBossWS] - Re: WS-Eventing - sending notification
by maeste
Hi artem,
I can't understand what you mean? Specification of ws-eventing doesn't constrain notifications because (specification said) any message MAY be a notification.
But in real world producer and receiver have to constrain the message accepted. And it is an application level know how.
Of course should be convenient if the application engine does it for you, but I can't understand where is the value of that: immagine you (event producer) define a schema for notification and a subscriber implement a different schema. When you will send notifications you will construct the xml according to your schema (the only one you are supposed to know). You are asking the engine to validate notifications according to the receiver schema, but in that case (schema defined by the ws-eventing source != schema implemented by the event sink) it wold (always) fail and throws an exption. You can check the exception, but anyway you can't recover it. Isn't it?
Instead the validation of the producer defined schema could be conveniently made by the engine, but it can be done also at application level as Alessio already said.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980948#3980948
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980948
19 years, 6 months