[JBoss Seam] - Question about Conversations and Stateful Bean Instances
by ekusnitz
I have the following question, which doesn't appear to be addressed in the documentation or the forums:
We have a stateful bean declared like this:
| @Stateful
| @Name("CRUDNode")
| @Scope(ScopeType.CONVERSATION)
| public class CRUDNodeAction extends CRUDAdminTypeAction implements Serializable, CRUDAdminType, CRUDNode {
| ...
| @Create
| public void create() {
|
The ancestor looks like this:
| @Stateful
| @Name("CRUDAdminType")
| @Scope(ScopeType.CONVERSATION)
| public class CRUDAdminTypeAction implements CRUDAdminType {
| ...
| @Begin(nested=true)
| public String details() {
| ...
| @End
| public String edit() {
| ...
| @End
| public String cancel() {
| ...
|
|
The details() method is called from a set of links representing different nodes (created dynamically via Javascript, so I can't reproduce it here). The first time you click the link, @Create gets called, then @Begin, which makes sense. However, on subsequent clicks on different nodes (without calling any @End methods) @Create never gets called.
So, my question is: Shouldn't a new conversation (nested or not) create a new instance of my stateful bean, CRUDNodeAction, and therefore call @Create?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991038#3991038
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991038
19 years, 7 months
[JBossWS] - Re: Authorization failure .NET client to secured Webservices
by marcelvanvelzen
Thanks, it now works !!
What I added was the portcomponent, I specified:
@PortComponent(authMethod="BASIC", transportGuarantee="NONE")
At the moment I am not interested in SSL communication.
Also I don't use Tomcat, but thanks for the advice, perhaps in the future.
In my VB code, I removed the domain login, since user/password as in your VB example works perfectly.
In the VB code, it was necessary to override GetWebRequest, otherwise the first call would result in a HTTP 505 error.
Now I am able to finish my dll, include it in the InfoPath form (and add the cabinet file) and access my webservices via authentication.
Thanks !
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991037#3991037
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991037
19 years, 7 months
[Beginners Corner] - Re: ERROR [NamingService] Could not start on port 1099
by vkokodyn
I have ejbCreate method in my bean
==============
package com.beans.ejb;
import java.sql.*;
import java.util.Enumeration;
import java.util.Vector;
import java.rmi.RemoteException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import javax.ejb.ObjectNotFoundException;
import javax.ejb.*;
import com.beans.interfaces.ProductPK;
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.sql.DataSource;
/**
* XDoclet-based BMP entity bean.
*
* To generate EJB related classes using XDoclet:
*
* - Add Standard EJB module to XDoclet project properties
* - Customize XDoclet configuration
* - Run XDoclet
*
* Below are the xdoclet-related tags needed for this EJB.
*
* @ejb.bean name="Product"
* display-name="Name for Product"
* description="Description for Product"
* jndi-name="ejb/Product"
* type="BMP"
* view-type="both"
*/
public class ProductBean implements EntityBean {
/** The entity context */
private EntityContext context;
int UID;
String pName;
int pQuantity ;
String pPrice;
public int getUID() {
System.out.println("getUID");
return UID;
}
public String getpName() {
System.out.println("getpName");
return pName;
}
public int getpQuantity() {
System.out.println("getpQuantity");
return pQuantity;
}
public String getpPrice() {
System.out.println("getpPrice");
return pPrice;
}
public ProductBean() {
super();
// TODO Auto-generated constructor stub
}
/**
* There are zero or more ejbCreate(...) methods, whose signatures match
* the signatures of the create(...) methods of the entity bean?s home interface.
* The container invokes an ejbCreate(...) method on an entity bean instance
* when a client invokes a matching create(...) method on the entity bean?s
* home interface.
*
* The entity bean provider?s responsibility is to initialize the instance in the ejbCreate<
* METHOD>(...) methods from the input arguments, using the get and set accessor
* methods, such that when the ejbCreate(...) method returns, the persistent
* representation of the instance can be created.
*
* The entity bean provider must not attempt to modify the values of cmr-fields in an ejbCreate<
* METHOD(...) method; this should be done in the ejbPostCreate<METHOD(...) method instead.
*
* The entity object created by the ejbCreate method must have a unique primary
* key. This means that the primary key must be different from the primary keys of all the existing
* entity objects within the same home. However, it is legal to reuse the primary key of a previously
* removed entity object. The implementation of the bean provider?s ejbCreate<
* METHOD>(...) methods should be coded to return a null.
*
* An ejbCreate(...) method executes in the transaction context determined by
* the transaction attribute of the matching create(...) method.
* The database insert operations are performed by the container within the same
* transaction context after the Bean Provider?s ejbCreate(...) method completes.
*
* @throws CreateException Thrown if method fails due to system-level error.
*
* @throws CreateException
*
* @ejb.create-method
*/
public ProductPK ejbCreate( int UID, String pName, int pQuantity,
String pPrice) throws CreateException {
System.out.println("ejbCreate");
this.UID = UID;
this.pName = pName;
this.pQuantity = pQuantity;
this.pPrice = pPrice;
Connection connect = null;
PreparedStatement ps = null;
try {
String sql = "INSERT INTO ProductInfo" +
" (UID, pName, pQuantity, pPrice)" +
" VALUES" +
" (?, ?, ?, ?)";
connect = getConnection();
ps = connect.prepareStatement(sql);
ps.setInt(1, UID);
ps.setString(2, pName);
ps.setInt(3, pQuantity);
ps.setString(4, pPrice);
ps.executeUpdate();
}
catch (SQLException e) {
System.out.println(e.toString());
}
finally {
try {
if (ps!=null)
ps.close();
if (connect!=null)
connect.close();
}
catch (SQLException e) {
}
}
return new ProductPK(UID);
}
/**
* For each ejbCreate(...) method, there is a matching ejbPostCreate<
* METHOD>(...) method that has the same input parameters but whose return type is
* void. The container invokes the matching ejbPostCreate(...) method on
* an instance after it invokes the ejbCreate(...) method with the same arguments.
* The instance can discover the primary key by calling getPrimaryKey() on its
* entity context object.
*
* The entity object identity is available during the ejbPostCreate(...)
* method. The instance may, for example, obtain the component interface of the associated entity
* object and pass it to another enterprise bean as a method argument.
*
* The entity Bean Provider may use the ejbPostCreate(...) to set the values
* of cmr-fields to complete the initialization of the entity bean instance.
* An ejbPostCreate(...) method executes in the same transaction context as
* the previous ejbCreate(...) method.
*
* @throws CreateException Thrown if method fails due to system-level error.
*/
public void ejbPostCreate(int UID, String pName, int pQuantity
, String pPrice)
throws CreateException {
System.out.println("ejbPostCreate");
}
public ProductPK ejbFindByPrimaryKey(ProductPK primaryKey)
throws RemoteException, FinderException {
System.out.println("ejbFindByPrimaryKey");
Connection connect = null;
PreparedStatement ps = null;
ResultSet rs = null;
try {
String sql = "SELECT pName" +
" FROM ProductInfo" +
" WHERE UID=?";
int UID = primaryKey.UID;
connect = getConnection();
ps = connect.prepareStatement(sql);
ps.setInt(1, UID);
rs = ps.executeQuery();
if (rs.next()) {
rs.close();
ps.close();
connect.close();
return primaryKey;
}
}
catch (SQLException e) {
System.out.println(e.toString());
}
finally {
try {
if (rs!=null)
rs.close();
if (ps!=null)
ps.close();
if (connect!=null)
connect.close();
}
catch (SQLException e) {
}
}
throw new ObjectNotFoundException();
}
public Enumeration ejbFindBypName(String pName)
throws RemoteException, FinderException {
System.out.println("ejbFindBypName");
Vector products = new Vector();
Connection connect = null;
PreparedStatement ps = null;
ResultSet rs = null;
try {
String sql = "SELECT UID " +
" FROM ProductInfo" +
" WHERE pName=?";
connect = getConnection();
ps = connect.prepareStatement(sql);
ps.setString(1, pName);
rs = ps.executeQuery();
while (rs.next()) {
int UID = rs.getInt(1);
products.addElement(new ProductPK(UID));
}
}
catch (SQLException e) {
System.out.println(e.toString());
}
finally {
try {
if (rs!=null)
rs.close();
if (ps!=null)
ps.close();
if (connect!=null)
connect.close();
}
catch (SQLException e) {
}
}
return products.elements();
}
public void ejbActivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub
System.out.println("ejbActivate");
}
public void ejbLoad() throws EJBException, RemoteException {
// TODO Auto-generated method stub
System.out.println("ejbLoad");
Connection con = null;
PreparedStatement ps = null;
ResultSet rs = null;
try {
String sql = "SELECT pName, pPrice" +
" FROM ProductInfo" +
" WHERE UID=?";
con = getConnection();
ps = con.prepareStatement(sql);
ps.setInt(1, this.UID);
rs = ps.executeQuery();
if (rs.next()) {
this.pName = rs.getString(1);
this.pQuantity = rs.getInt(2);
this.pPrice = rs.getString(3);
}
}
catch (SQLException e) {
System.out.println(e.toString());
}
finally {
try {
if (rs!=null)
rs.close();
if (ps!=null)
ps.close();
if (con!=null)
con.close();
}
catch (SQLException e) {
}
}
}
public void ejbPassivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub
System.out.println("ejbPassivate");
}
public void ejbRemove() throws RemoveException,
EJBException, RemoteException {
// TODO Auto-generated method stub
System.out.println("ejbRemove");
Connection connect = null;
PreparedStatement ps = null;
try {
String sql = "DELETE FROM ProductInfo" +
" WHERE UID=?";
ProductPK key = (ProductPK) context.getPrimaryKey();
int UID = key.UID;
connect = getConnection();
ps = connect.prepareStatement(sql);
ps.setInt(1, UID);
ps.executeUpdate();
}
catch (SQLException e) {
System.out.println(e.toString());
}
finally {
try {
if (ps!=null)
ps.close();
if (connect!=null)
connect.close();
}
catch (SQLException e) {
}
}
}
public void ejbStore() throws EJBException, RemoteException {
// TODO Auto-generated method stub
System.out.println("ejbStore");
Connection connect = null;
PreparedStatement ps = null;
try {
String sql = "UPDATE ProductInfo" +
" SET pName=?, pQuantity=?, pPrice=?" +
" WHERE UID=?";
ProductPK key = (ProductPK) context.getPrimaryKey();
int UID = key.UID;
connect = getConnection();
ps = connect.prepareStatement(sql);
ps.setString(1, this.pName);
ps.setInt(2, this.pQuantity);
ps.setString(3, this.pPrice);
ps.setInt(4, UID);
ps.executeUpdate();
}
catch (SQLException e) {
System.out.println(e.toString());
}
finally {
try {
if (ps!=null)
ps.close();
if (connect!=null)
connect.close();
}
catch (SQLException e) {
}
}
}
/**
* Set the associated entity context. The container calls this method
* after the instance creation. The entity bean must not attempt to
* access its persistent state and relationships using the accessor
* methods during this method.
*
* The enterprise bean instance should store the reference to the context
* object in an instance variable.
*
* This method is called with no transaction context.
*
* @throws EJBException Thrown if method fails due to system-level error.
*/
public void setEntityContext(EntityContext newContext) throws EJBException {
System.out.println("setEntityContext");
context = newContext;
}
/**
* Unset the associated entity context. A container invokes this method
* before terminating the life of the instance. The entity bean must not
* attempt to access its persistent state and relationships using the
* accessor methods during this method.
*
* This method is called with no transaction context.
*
* @throws EJBException Thrown if method fails due to system-level error.
*/
public void unsetEntityContext() throws EJBException {
context = null;
}
public Connection getConnection() {
String DBDriver = null;
String DBUrl = null;
String DBUserName = null;
String DBPassword = null;
Context initialContext;
Context environment;
Connection connect = null;
DBUrl = "jdbc:odbc:EJB";
DBUserName = "";
DBPassword = "";
try {
DBDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
Class.forName(DBDriver).newInstance();
connect = DriverManager.getConnection(DBUrl, DBUserName, DBPassword);
System.out.println("Connect");
}
catch(Exception e) {
System.out.println(e);
//return;
}
return connect;
}
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991036#3991036
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991036
19 years, 7 months
[EJB 3.0] - Re: Cyclic depencies
by Nico67
anonymous wrote :
| to compile @IgnoreDependency - you need
| jboss-4.0.5.GA\client\jboss-annotations-ejb3.jar in your compile classpath.
|
I found jboss-annotations-ejb3.jar in ejb3.deployer directory which is in the deploy directory of my server, not the client/ directory as you specified.
Note that to install EJB3 , I installed JBoss 4.0.5 , copied the default server configuration, then run the EJB3 ant script (install.xml) to install EJB3 stuffs in my server configuration.
Current conclusion is that:
- <ignore-dependency /> put in jboss.xml is ignored : i mean event if i specify it, the bean are not deployed;
- @IgnoreDependency works fine. When specified, the bean is started even if dependencies are not.
So, there may be a problem with my jboss.xml file and ignore-dependency. Has someone got it running ?
I copy below my jboss.xml file content.
<?xml version="1.0" encoding="UTF-8"?>
| <jboss
| xmlns="http://java.sun.com/xml/ns/javaee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
| http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
| version="3.0">
| <enterprise-beans>
| <session>
| <ejb-name>CmdbServiceBean</ejb-name>
| <ejb-ref>
| <ejb-ref-name>RepositoryServiceBean</ejb-ref-name>
| <ignore-dependency/>
| </ejb-ref>
| <ejb-ref>
| <ejb-ref-name>SecurityServiceBean</ejb-ref-name>
| <ignore-dependency/>
| </ejb-ref>
| </session>
| <session>
| <ejb-name>RegistryServiceBean</ejb-name>
| <ejb-ref>
| <ejb-ref-name>RepositoryServiceBean</ejb-ref-name>
| <ignore-dependency/>
| </ejb-ref>
| <ejb-ref>
| <ejb-ref-name>SecurityServiceBean</ejb-ref-name>
| <ignore-dependency/>
| </ejb-ref>
| </session>
| <session>
| <ejb-name>TestServiceBean</ejb-name>
| <ejb-ref>
| <ejb-ref-name>RegistryServiceBean</ejb-ref-name>
| <ignore-dependency/>
| </ejb-ref>
| </session>
| </enterprise-beans>
| </jboss>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991024#3991024
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991024
19 years, 7 months
[JBoss Seam] - Re: Excessive [could not destroy component] 1.1B1 to 1.1CR1
by lowecg2004
Oops - yes, you're quite right.
And you'll be searching for 'domain name="Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">'
(there should be a '<' before "domain name" above - but this renders the string invisible when it is displayed in the forum.)
<domain name="Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">
| <!-- NON Clustered cache configuration -->
| <annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache) AND !class((a)org.jboss.annotation.ejb.Clustered)">
| @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.simple.SimpleStatefulCache.class)
| </annotation>
| <annotation expr="!class((a)org.jboss.annotation.ejb.cache.simple.PersistenceManager) AND !class((a)org.jboss.annotation.ejb.Clustered)">
| @org.jboss.annotation.ejb.cache.simple.PersistenceManager (org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.class)
| </annotation>
| <annotation expr="!class((a)org.jboss.annotation.ejb.cache.simple.CacheConfig) AND !class((a)org.jboss.annotation.ejb.Clustered)">
| @org.jboss.annotation.ejb.cache.simple.CacheConfig (maxSize=100000, idleTimeoutSeconds=900)
| </annotation>
|
| <!-- Clustered cache configuration -->
| <annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache) AND class((a)org.jboss.annotation.ejb.Clustered)">
| @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.tree.StatefulTreeCache.class)
| </annotation>
| <annotation expr="!class((a)org.jboss.annotation.ejb.cache.tree.CacheConfig) AND class((a)org.jboss.annotation.ejb.Clustered)">
| @org.jboss.annotation.ejb.cache.tree.CacheConfig (name="jboss.cache:service=EJB3SFSBClusteredCache", maxSize=100000, idleTimeoutSeconds=300)
| </annotation>
| </domain>
A wiki sounds like a great idea. Can you point me to the wiki page that tells me "how to create a wiki page"?!
C
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991023#3991023
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991023
19 years, 7 months
[Messaging, JMS & JBossMQ] - JBossMQ errors after starting up with many messages in the q
by pkorros
Using JBoss 4.0.5, when I startup my application with ~2400 messages already persisted (but not yet processed) in the queue the application server correctly starts to dispatch the messages.
The problem is that I get some (~4-10) errors like the following, when the execution finishes I see the same amount of unprocessed messages in the database.
2006-12-04 16:51:46,651 ERROR [org.jboss.jms.asf.StdServerSession] (JMS SessionPool Worker-5) failed to commit/rollback
org.jboss.mq.SpyXAException: Resource manager error during commit; - nested throwable: (javax.jms.JMSException: Transaction is not active for rollback)
at org.jboss.mq.SpyXAException.getAsXAException(SpyXAException.java:72)
at org.jboss.mq.SpyXAResource.commit(SpyXAResource.java:92)
at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:317)
at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:905)
at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
at org.jboss.mq.SpySession.run(SpySession.java:323)
at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.jms.JMSException: Transaction is not active for rollback
at org.jboss.mq.pm.Tx.rollback(Tx.java:253)
at org.jboss.mq.pm.TxManager.rollbackTx(TxManager.java:180)
at org.jboss.mq.server.JMSDestinationManager.transact(JMSDestinationManager.java:449)
at org.jboss.mq.server.JMSServerInterceptorSupport.transact(JMSServerInterceptorSupport.java:126)
at org.jboss.mq.security.ServerSecurityInterceptor.transact(ServerSecurityInterceptor.java:197)
at org.jboss.mq.server.TracingInterceptor.transact(TracingInterceptor.java:352)
at org.jboss.mq.server.JMSServerInvoker.transact(JMSServerInvoker.java:132)
at org.jboss.mq.il.jvm.JVMServerIL.transact(JVMServerIL.java:175)
at org.jboss.mq.Connection.send(Connection.java:1110)
at org.jboss.mq.SpyXAResourceManager.commit(SpyXAResourceManager.java:166)
at org.jboss.mq.SpyXAResource.commit(SpyXAResource.java:88)
... 7 more
I have configured JBOSSMQ to use the MS SQL Server 2005 to persist the message queue.
Any ideas on how can I solve this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991022#3991022
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991022
19 years, 7 months
[EJB 3.0] - EntityManager is loosing updates
by konstantin.ermakov
Hello!
I have the following problem. In our project we are using the standart design - there is one EntityBean pojo per table, and one Stateless session bean which is working with the table. We are also using rich clients, which are manipulating the data, i.e.:
|
| @Entity
| public class SomeObject {
|
| private Integer id_;
|
| private String name_;
|
| @Id
| public void setId( Integer id ) {
| id_ = id;
| }
|
| public Integer getId() {
| return id_;
| }
| .....
|
| };
|
|
| @Stateless
| public class SomeStatelessBean {
|
| @PersistenceContext(name = "myname", unitName = "myunit")
| private EntityManager manager;
|
|
| public SomeObject getObject() {
| return manager.find(SomeObject.class, id);
| };
|
| public update( SomeObject detached ) {
| SomeObject obj = manager.find(detached.id);
| obj.setName( detached.getName );
| manager.flush();
| };
|
| };
|
In the background there is a Timer Bean which is reading SomeObject information ( it does not manipulate, just reading ).
The problem is as following. If I am calling update() very often my EntityManger returns me the old with the getObject() method object, though I am sure that the new copy is in database (Oracle). Can somebody tell me why does it happen?
There are no exceptions on the server side, just the data is wrong.
Thank you,
Sincerely yours, Konstantin
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991018#3991018
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991018
19 years, 7 months
[Installation, Configuration & Deployment] - Re: javax.resource.spi.SecurityException
by nsv
Hi
I got the "No Password credentials" exception fixed
solution was to remove the <security-domain-and-application>JmsXARealm</security-domain-and-application>
from connectionfactory declaration in jms-ds.xml in server\default\deploy\jms directory
| <tx-connection-factory>
| <jndi-name>AlarmMgrConnectionFactory</jndi-name>
| <xa-transaction/>
| <rar-name>jms-ra.rar</rar-name>
| <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
| <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Queue</config-property>
| <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
| <max-pool-size>20</max-pool-size>
| <security-domain-and-application>JmsXARealm</security-domain-and-application>
| </tx-connection-factory>
Thanks for all you help
-Vishnu
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991010#3991010
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991010
19 years, 7 months
[JBoss Seam] - Broken CVS? CNF org.jboss.seam.ui.UISecure
by lowecg2004
The current CVS build appears to be broken:
14:21:07,088 ERROR [ApplicationImpl] Component class org.jboss.seam.ui.UISecure not found
| javax.faces.FacesException: java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.seam.ui.UISecure
| at org.apache.myfaces.shared_impl.util.ClassUtils.simpleClassForName(ClassUtils.java:162)
| at org.apache.myfaces.application.ApplicationImpl.addComponent(ApplicationImpl.java:269)
| at org.jboss.seam.jsf.SeamApplication11.addComponent(SeamApplication11.java:43)
| at org.jboss.seam.jsf.SeamApplication11.addComponent(SeamApplication11.java:43)
| at org.apache.myfaces.config.FacesConfigurator.configureApplication(FacesConfigurator.java:479)
| at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:141)
| at org.apache.myfaces.webapp.StartupServletContextListener.initFaces(StartupServletContextListener.java:69)
| at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:52)
| at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
| at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
| at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
| at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
| at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
| 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.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
| at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052)
| 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.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
| at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297)
| at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103)
| at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371)
| at org.jboss.web.WebModule.startModule(WebModule.java:83)
| at org.jboss.web.WebModule.startService(WebModule.java:61)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy42.start(Unknown Source)
| at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
| 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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
| at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
| at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy43.start(Unknown Source)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy6.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
| Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.seam.ui.UISecure
| at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
| at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:511)
| at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
| at java.lang.ClassLoader.loadClass(Unknown Source)
| at java.lang.ClassLoader.loadClassInternal(Unknown Source)
| at java.lang.Class.forName0(Native Method)
| at java.lang.Class.forName(Unknown Source)
| at org.apache.myfaces.shared_impl.util.ClassUtils.classForName(ClassUtils.java:138)
| at org.apache.myfaces.shared_impl.util.ClassUtils.simpleClassForName(ClassUtils.java:157)
| ... 97 more
The issue is with:
jboss-seam\src\ui\META-INF\seam.taglib.xml
Where the following entry refers to a class that doesn't yet exist:
<component>
| <component-type>org.jboss.seam.ui.UISecure</component-type>
| <component-class>org.jboss.seam.ui.UISecure</component-class>
| </component>
Removing that particular entry and rebuilding the jars allowed me to continue.
Cheers,
C.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991009#3991009
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991009
19 years, 7 months
[JBoss AOP] - Re: inheritance of aspects
by flavia.rainone
Hi,
It is not allowed to put an expression in the 'class' attribute of 'aspect' tag.
Still, you can simulate the inheritance of aspect advices. As Stalep said, you need to declare the subclasses as aspects in the xml file, and declare the bindings like in the following example.
| >>>>> ASPECTS
|
| class MyAspect1 extends MySuperAspect
| {
| public Object advice(Invocation invocation) throws Throwable
| {
| // do something I want to and then invoke super aspect
| return super.advice(invocation);
| }
| }
|
| class MyAspect2 extends MySuperAspect
| {
| public Object advice(Invocation invocation) throws Throwable
| {
| // do only what I want to, don't call super aspect
| .....
| return invocation.invokeNext();
| }
| }
|
| public abstract class MySuperAspect
| {
| public Object advice(Invocation invocation) throw Throwable
| {
| ....
| }
| }
|
| >>>>> XML FILE
|
| <?xml ....?>
| <aop>
| <aspect class="MyAspect1" scope="PER_VM" />
| <aspect class="MyAspect2" scope="PER_VM" />
|
| <bind pointcut=">whatever you want here<" />
| <advice name="advice" aspect="MyAspect1"/>
| <advice name="advice" aspect="MyAspect2"/>
| </bind>
| </aop>
|
Notice MySuperAspect can also be an interface or a concrete class.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991008#3991008
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991008
19 years, 7 months
[Messaging, JMS & JBossMQ] - Re: JBossMQ Fails under load - Exiting on IOE
by alchemista
Also, if I try to do a Twiddle thread-dump while in the failed state I get the following errors:
[root@box bin]# sh twiddle.sh invoke "jboss.system:type=ServerInfo" listThreadDump
08:58:12,403 ERROR [Twiddle] Exec failed
org.jboss.util.NestedRuntimeException: - nested throwable: (javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.io.EOFException])
at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:137)
at org.jboss.console.twiddle.command.MBeanServerCommand.getMBeanServer(MBeanServerCommand.java:47)
at org.jboss.console.twiddle.command.MBeanServerCommand.queryMBeans(MBeanServerCommand.java:54)
at org.jboss.console.twiddle.command.InvokeCommand.execute(InvokeCommand.java:262)
at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:293)
Caused by: javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is: java.io.EOFException]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:707)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org.jboss.console.twiddle.Twiddle.createMBeanServerConnection(Twiddle.java:244)
at org.jboss.console.twiddle.Twiddle.connect(Twiddle.java:262)
at org.jboss.console.twiddle.Twiddle.access$300(Twiddle.java:56)
at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:133)
... 4 more
Caused by: java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.io.EOFException
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:203)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
... 10 more
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:243)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:189)
... 13 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990996#3990996
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990996
19 years, 7 months
[JBoss Seam] - Re: custom JSF component with facelets
by dgallego
This is the structure of the jar under my /WEB-INF/lib/:
META-INF:
- faces-config.xml
- nt.taglib.xml
- taglib.tld
and the packets structure containing my tags and JSF components.
My tags work only if I specify facelets.LIBRARIES option under web.xml.
faces-config.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
| "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
| <faces-config>
|
| <component>
| <component-type>component.Version</component-type>
| <component-class>component.Version</component-class>
| </component>
| </faces-config>
|
nt.taglib.xml:
| <?xml version="1.0"?>
| <!DOCTYPE facelet-taglib PUBLIC
| "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
| "facelet-taglib_1_0.dtd">
|
| <facelet-taglib>
|
| <namespace>http://www.ntrying.com</namespace>
|
| <tag>
| <tag-name>version</tag-name>
| <component>
| <component-type>component.Version</component-type>
| </component>
| </tag>
|
|
| </facelet-taglib>
|
taglib.tld:
| <?xml version="1.0"?>
| <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
| "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
| <taglib>
|
| <tlib-version>1.0</tlib-version>
| <jsp-version>1.2</jsp-version>
| <short-name>nt</short-name>
| <uri>http://www.ntrying.com</uri>
| <display-name>NTrying.com.</display-name>
|
| <!-- <nt:version /> -->
| <tag>
| <name>version</name>
| <tag-class>taglib.VersionTag</tag-class>
| <body-content>empty</body-content>
| <description>
| The current version of the Ntrying library.
| </description>
| </tag>
| </taglib>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990992#3990992
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990992
19 years, 7 months
[Beginners Corner] - Error with JBoss 5, Web module and java:comp/UserTransaction
by xbrenuchon
Hello,
I'm in my web module (in a Servlet), and i want to have the UserTransaction :
UserTransaction utx = (UserTransaction)context.lookup("java:comp/UserTransaction");
With JBoss 4, it's work very well, but with the new JBoss 5 b1, I have a exception.
JBoss 5 don't support java:comp/UserTransaction in web module ?
javax.naming.NameNotFoundException: UserTransaction not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:628)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:719)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:590)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at fr.unedic.test.web.TestServlet.runUsrTransaction(TestServlet.java:73)
at fr.unedic.test.web.TestServlet.doGet(TestServlet.java:50)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:86)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:818)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:595)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990989#3990989
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990989
19 years, 7 months
[JCA/JBoss] - [JBoss + M$ SQLServer 2005 driver] XA Datasource definition
by bulledesavon
Hi,
I'm trying to define a XA DataSource on JBoss 4.0.3SP1 (same problem with 4.0.4GA) using the Microsoft SQLServer 2005 driver version 1.1.
Here is the content of my datasource-ds.xml file :
<?xml version="1.0" encoding="UTF-8"?>
<xa-datasource>
<jndi-name>jdbc/mydatasource</jndi-name>
<track-connection-by-tx>True</track-connection-by-tx>
<connection-url>jdbc:inetdae7</connection-url>
<xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class>
<xa-datasource-property name="DatabaseName">myDB</xa-datasource-property>
<xa-datasource-property name="ServerName">myServer</xa-datasource-property>
<xa-datasource-property name="Port">1433</xa-datasource-property>
<xa-datasource-property name="ApplicationName">myAppName</xa-datasource-property>
<xa-datasource-property name="SelectMethod">cursor</xa-datasource-property>
<xa-datasource-property name="SendStringParametersAsUnicode">true</xa-datasource-property>
<user-name>myUser</user-name>
<min-pool-size>1</min-pool-size>
<max-pool-size>5</max-pool-size>
<new-connection-sql>select 1 from systypes</new-connection-sql>
<check-valid-connection-sql>select 1 from systypes</check-valid-connection-sql>
</xa-datasource>
Pay attention to the port number property line.
When the DataSource is created, I get the following exception :
2006-11-30 10:11:45,667 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Could not find accessor on XADataSource: ; - nested throwable: (java.lang.NoSuchMethodException: com.microsoft.sqlserver.jdbc.SQLServerXADataSource.setPort(java.lang.String)))
at org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:153)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:519)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:208)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:529)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:410)
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:342)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:462)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:894)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:73)
It is showed in the log file as a Warning, but the DataSource is not useable at all.
It seems that JBoss can't find out that the parameter of the setPort method is an int and not a String...
If I comment out the port property line, everything is fine.
Any hint?
Is this JBoss related or driver related?
Thanks,
BdS
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990988#3990988
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990988
19 years, 7 months