Re: java.lang.ClassNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory

2009-01-19 Thread axiez

I added activemq-core-4.1.2*.jar to classpath and retried. This time error
message is:
Exception in thread main java.lang.NoClassDefFoundError:
edu/emory/mathcs/backport/java/util/concurrent/ConcurrentHashMap at
org.apache.activemq.jndi.ActiveMQInitialContextFactory.getInitialContext(ActiveMQInitialContextFactory.java:63)
...
...

axiez wrote:
 
 I have the following sample code and jndi.properties file:
 import javax.jms.*;
 import javax.naming.InitialContext;
 import java.util.*;
 import java.io.*;
 public class LogClient {
 public static void main(String[] args) throws Exception {
 Properties p = new Properties();
 p.load(new FileInputStream(jndi.properties));
 p.put(openejb.authentication.realmName,geronimo-admin);
 InitialContext ctx = new InitialContext(p);
 TopicConnectionFactory factory = (TopicConnectionFactory)
 ctx.lookup(java:comp/env/jms/DefaultActiveMQConnectionFactory);
 TopicConnection connection = factory.createTopicConnection();
 TopicSession session = connection.createTopicSession(false,
 Session.AUTO_ACKNOWLEDGE);
 Topic topic = (Topic)ctx.lookup(java:comp/env/jms/Topic);
 TopicPublisher publisher = session.createPublisher(topic);
 TextMessage msg = session.createTextMessage();
 msg.setText(This is a test message);
 publisher.send(msg);
 publisher.close();
 System.out.println(Message published. Please check application
 server's console to see the response from MDB);
 }
 }
 
 jndi.properties file:
 java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
 java.naming.provider.url=tcp://localhost:61616
 java.naming.security.principal=system
 java.naming.security.credentials=manager
 
 I ran the program after successful compilation. Error message is:
 Exception in thread main javax.naming.NoInitialContextException: Cannot
 instantiate class: org.apache.activemq.jndi.ActiveMQInitialContextFactory
 [Root exception is java.lang.ClassNotFoundException:
 org.apache.activemq.jndi.ActiveMQInitialContextFactory]
 
 

-- 
View this message in context: 
http://www.nabble.com/java.lang.ClassNotFoundException%3A-org.apache.activemq.jndi.ActiveMQInitialContextFactory-tp21537474s134p21538610.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.



Re: java.lang.ClassNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory

2009-01-19 Thread viola.lu

pls add backport-util-concurrent-*.*.jar under
$G_Dir\repository\backport-util-concurrent\backport-util-concurrent\*.*\ to
classpath.

axiez wrote:
 
 I added activemq-core-4.1.2*.jar to classpath and retried. This time error
 message is:
 Exception in thread main java.lang.NoClassDefFoundError:
 edu/emory/mathcs/backport/java/util/concurrent/ConcurrentHashMap at
 org.apache.activemq.jndi.ActiveMQInitialContextFactory.getInitialContext(ActiveMQInitialContextFactory.java:63)
 ...
 ...
 
 axiez wrote:
 
 I have the following sample code and jndi.properties file:
 import javax.jms.*;
 import javax.naming.InitialContext;
 import java.util.*;
 import java.io.*;
 public class LogClient {
 public static void main(String[] args) throws Exception {
 Properties p = new Properties();
 p.load(new FileInputStream(jndi.properties));
 p.put(openejb.authentication.realmName,geronimo-admin);
 InitialContext ctx = new InitialContext(p);
 TopicConnectionFactory factory = (TopicConnectionFactory)
 ctx.lookup(java:comp/env/jms/DefaultActiveMQConnectionFactory);
 TopicConnection connection = factory.createTopicConnection();
 TopicSession session = connection.createTopicSession(false,
 Session.AUTO_ACKNOWLEDGE);
 Topic topic = (Topic)ctx.lookup(java:comp/env/jms/Topic);
 TopicPublisher publisher = session.createPublisher(topic);
 TextMessage msg = session.createTextMessage();
 msg.setText(This is a test message);
 publisher.send(msg);
 publisher.close();
 System.out.println(Message published. Please check application
 server's console to see the response from MDB);
 }
 }
 
 jndi.properties file:
 java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
 java.naming.provider.url=tcp://localhost:61616
 java.naming.security.principal=system
 java.naming.security.credentials=manager
 
 I ran the program after successful compilation. Error message is:
 Exception in thread main javax.naming.NoInitialContextException: Cannot
 instantiate class: org.apache.activemq.jndi.ActiveMQInitialContextFactory
 [Root exception is java.lang.ClassNotFoundException:
 org.apache.activemq.jndi.ActiveMQInitialContextFactory]
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/java.lang.ClassNotFoundException%3A-org.apache.activemq.jndi.ActiveMQInitialContextFactory-tp21537474s134p21539167.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.



Re: java.lang.ClassNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory

2009-01-19 Thread viola.lu

You miss commons-logging-1.0.4.jar on classpath.

axiez wrote:
 
 I have the following sample code and jndi.properties file:
 import javax.jms.*;
 import javax.naming.InitialContext;
 import java.util.*;
 import java.io.*;
 public class LogClient {
 public static void main(String[] args) throws Exception {
 Properties p = new Properties();
 p.load(new FileInputStream(jndi.properties));
 p.put(openejb.authentication.realmName,geronimo-admin);
 InitialContext ctx = new InitialContext(p);
 TopicConnectionFactory factory = (TopicConnectionFactory)
 ctx.lookup(java:comp/env/jms/DefaultActiveMQConnectionFactory);
 TopicConnection connection = factory.createTopicConnection();
 TopicSession session = connection.createTopicSession(false,
 Session.AUTO_ACKNOWLEDGE);
 Topic topic = (Topic)ctx.lookup(java:comp/env/jms/Topic);
 TopicPublisher publisher = session.createPublisher(topic);
 TextMessage msg = session.createTextMessage();
 msg.setText(This is a test message);
 publisher.send(msg);
 publisher.close();
 System.out.println(Message published. Please check application
 server's console to see the response from MDB);
 }
 }
 
 jndi.properties file:
 java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
 java.naming.provider.url=tcp://localhost:61616
 java.naming.security.principal=system
 java.naming.security.credentials=manager
 
 I ran the program after successful compilation. Error message is:
 Exception in thread main javax.naming.NoInitialContextException: Cannot
 instantiate class: org.apache.activemq.jndi.ActiveMQInitialContextFactory
 [Root exception is java.lang.ClassNotFoundException:
 org.apache.activemq.jndi.ActiveMQInitialContextFactory]
 
 

-- 
View this message in context: 
http://www.nabble.com/java.lang.ClassNotFoundException%3A-org.apache.activemq.jndi.ActiveMQInitialContextFactory-tp21537474s134p21540330.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.



Re: java.lang.ClassNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory

2009-01-19 Thread axiez

I added commons-logging-1.0.4.jar. This time the error is:
java.lang.NoClassDefFoundError: javax/management/j2ee/statistics/Stats

axiez wrote:
 
 I have the following sample code and jndi.properties file:
 import javax.jms.*;
 import javax.naming.InitialContext;
 import java.util.*;
 import java.io.*;
 public class LogClient {
 public static void main(String[] args) throws Exception {
 Properties p = new Properties();
 p.load(new FileInputStream(jndi.properties));
 p.put(openejb.authentication.realmName,geronimo-admin);
 InitialContext ctx = new InitialContext(p);
 TopicConnectionFactory factory = (TopicConnectionFactory)
 ctx.lookup(java:comp/env/jms/DefaultActiveMQConnectionFactory);
 TopicConnection connection = factory.createTopicConnection();
 TopicSession session = connection.createTopicSession(false,
 Session.AUTO_ACKNOWLEDGE);
 Topic topic = (Topic)ctx.lookup(java:comp/env/jms/Topic);
 TopicPublisher publisher = session.createPublisher(topic);
 TextMessage msg = session.createTextMessage();
 msg.setText(This is a test message);
 publisher.send(msg);
 publisher.close();
 System.out.println(Message published. Please check application
 server's console to see the response from MDB);
 }
 }
 
 jndi.properties file:
 java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
 java.naming.provider.url=tcp://localhost:61616
 java.naming.security.principal=system
 java.naming.security.credentials=manager
 
 I ran the program after successful compilation. Error message is:
 Exception in thread main javax.naming.NoInitialContextException: Cannot
 instantiate class: org.apache.activemq.jndi.ActiveMQInitialContextFactory
 [Root exception is java.lang.ClassNotFoundException:
 org.apache.activemq.jndi.ActiveMQInitialContextFactory]
 
 

-- 
View this message in context: 
http://www.nabble.com/java.lang.ClassNotFoundException%3A-org.apache.activemq.jndi.ActiveMQInitialContextFactory-tp21537474s134p21541092.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.



Re: java.lang.ClassNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory

2009-01-19 Thread axiez

I added backport-util-concurrent-2.2.jar to classpath. This time the error
is:
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

axiez wrote:
 
 I have the following sample code and jndi.properties file:
 import javax.jms.*;
 import javax.naming.InitialContext;
 import java.util.*;
 import java.io.*;
 public class LogClient {
 public static void main(String[] args) throws Exception {
 Properties p = new Properties();
 p.load(new FileInputStream(jndi.properties));
 p.put(openejb.authentication.realmName,geronimo-admin);
 InitialContext ctx = new InitialContext(p);
 TopicConnectionFactory factory = (TopicConnectionFactory)
 ctx.lookup(java:comp/env/jms/DefaultActiveMQConnectionFactory);
 TopicConnection connection = factory.createTopicConnection();
 TopicSession session = connection.createTopicSession(false,
 Session.AUTO_ACKNOWLEDGE);
 Topic topic = (Topic)ctx.lookup(java:comp/env/jms/Topic);
 TopicPublisher publisher = session.createPublisher(topic);
 TextMessage msg = session.createTextMessage();
 msg.setText(This is a test message);
 publisher.send(msg);
 publisher.close();
 System.out.println(Message published. Please check application
 server's console to see the response from MDB);
 }
 }
 
 jndi.properties file:
 java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
 java.naming.provider.url=tcp://localhost:61616
 java.naming.security.principal=system
 java.naming.security.credentials=manager
 
 I ran the program after successful compilation. Error message is:
 Exception in thread main javax.naming.NoInitialContextException: Cannot
 instantiate class: org.apache.activemq.jndi.ActiveMQInitialContextFactory
 [Root exception is java.lang.ClassNotFoundException:
 org.apache.activemq.jndi.ActiveMQInitialContextFactory]
 
 

-- 
View this message in context: 
http://www.nabble.com/java.lang.ClassNotFoundException%3A-org.apache.activemq.jndi.ActiveMQInitialContextFactory-tp21537474s134p21540073.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.



deploy a GBean - how ?

2009-01-19 Thread Juergen Weber

Hi,

I try to encapsulate my JNI calls in a GBean.

I read a lot of docs and articles, wrote my GBean along the sample in this
posting
http://www.nabble.com/POJO-caching-in-geronimo-td16986524s134.html

read this Wiki entry: http://cwiki.apache.org/GMOxDEV/gbeansarticle1.html
Unfortunately the entry does not tell how to install a GBean into the
server.

I guess, you use the deployer or console and deploy a jar together with a
plan, isn't it?

The Wiki entry links this sample from
http://apache.org/~hemapani/docs/gbeans-sample.zip
but it does not work with 2.1.3, console says:

java.lang.ClassNotFoundException:
org.apache.geronimo.upgrade.Upgrade1_0To1_1 in classloader
org.apache.geronimo.plugins/plugin-console-tomcat/2.1.3/car

org.apache.geronimo.kernel.config.MultiParentClassLoader.loadOptimizedClass(MultiParentClassLoader.java:437)

org.apache.geronimo.kernel.config.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:279)
java.lang.ClassLoader.loadClass(ClassLoader.java:597)

org.apache.geronimo.console.configmanager.DeploymentPortlet.processAction(DeploymentPortlet.java:189)
org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:218)
org.apache.pluto.core.PortletServlet.doPost(PortletServlet.java:145)

Probably it does not like sample's plan's
configuration
xmlns=http://geronimo.apache.org/xml/ns/deployment;
configId=test/plan2


Then I tried

?xml version=1.0 encoding=UTF-8?
configuration
xmlns:sys=http://geronimo.apache.org/xml/ns/deployment-1.2;
configId=test/plan2

gbean name=test:axis=gb1 class=my.JNIGBean
/gbean

/configuration

Now I get 

Deployment failed:
Cannot deploy the requested application module because no deployer is able
to handle it. This can happen if you have omitted the J2EE deployment
descriptor, disabled a deployer module, or if, for example, you are trying
to deploy an EJB module on a minimal Geronimo server that does not have EJB
support installed.

Then, how do I call a GBean method from a web app, is it still like cited in
the posting
http://www.nabble.com/POJO-caching-in-geronimo-td16986524s134.html ?

quoting:
dependencies
  dependency
groupIdcom.w.core.geronimo.services/groupId
artifactIdpojo-cache/artifactId
version1.0/version
typecar/type
  /dependency
/dependencies
   
...
/environment  
gbean-ref
xmlns:naming=http://geronimo.apache.org/xml/ns/naming-1.1;
ref-namecache/ref-name
ref-typejava.util.Map/ref-type
pattern
  namePOJOCache/name
/pattern
  /gbean-ref
 
And get the cache in the following manner

  cache = (MapString, Template) new InitialContext()
  .lookup(java:comp/env/cache);

end quote

Thanks,
Juergen




-- 
View this message in context: 
http://www.nabble.com/deploy-a-GBean---how---tp21542349s134p21542349.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.



[DISCUSS] Security Vulnerability Policy created

2009-01-19 Thread Donald Woods
There was a long discussion around mid-December on the private and 
security Geronimo mailing lists about how to handle security 
vulnerabilities.  The outcome of that discussion (which is mainly a 
boilerplate suggested by Mark Thomas for all projects to use) can be 
found on our Project Policies wiki page at -

  http://cwiki.apache.org/GMOxPMGT/geronimo-project-policies.html

If you see anything that needs changing or information that needs to be 
added, then please discuss on this thread.



Thanks,
Apache Geronimo PMC


Re: [DISCUSS] Security Vulnerability Policy created

2009-01-19 Thread Kevan Miller


On Jan 19, 2009, at 9:14 AM, Donald Woods wrote:

There was a long discussion around mid-December on the private and  
security Geronimo mailing lists about how to handle security  
vulnerabilities.  The outcome of that discussion (which is mainly a  
boilerplate suggested by Mark Thomas for all projects to use) can be  
found on our Project Policies wiki page at -

 http://cwiki.apache.org/GMOxPMGT/geronimo-project-policies.html

If you see anything that needs changing or information that needs to  
be added, then please discuss on this thread.


The only question I had concerned step 6. Should the fix be discussed  
on security@ and/or priv...@? It needs to be on a private list, to  
properly embargo the vulnerability until a fix is available. Since  
most of the discussions of the issue occur on secur...@geronimo, I  
think discussion of the fix is most appropriate there.


Thoughts?

--kevan

Re: deployment for MySQL XA.

2009-01-19 Thread Forrest Xia
Thanks David for pointing out the wrong points.

I made some tries, and figure out a sample datasource for mysql:
ext-module
connectormysqlxads/connector
external-path xmlns:dep=
http://geronimo.apache.org/xml/ns/deployment-1.2;
dep:groupIdorg.tranql/dep:groupId
dep:artifactIdtranql-connector-mysql-xa/dep:artifactId
dep:typerar/dep:type
/external-path
connector xmlns=http://geronimo.apache.org/xml/ns/j2ee/connector-1.2;

resourceadapter
outbound-resourceadapter
connection-definition

connectionfactory-interfacejavax.sql.DataSource/connectionfactory-interface
connectiondefinition-instance
namejdbc/mysqlxads/name
config-property-setting
name=DatabaseNamesampledb/config-property-setting
config-property-setting
name=UserNametheusername/config-property-setting
config-property-setting
name=Passwordthepassword/config-property-setting
connectionmanager
xa-transaction
transaction-caching/
/xa-transaction
single-pool
max-size10/max-size
min-size0/min-size
match-one/
/single-pool
/connectionmanager
/connectiondefinition-instance
/connection-definition
/outbound-resourceadapter
/resourceadapter
  /connector
/ext-module

As to MS SQL sample, updated as following:
resourceadapter
outbound-resourceadapter
connection-definition
connectionfactory-interface
javax.sql.DataSource/connectionfactory-interface
connectiondefinition-instance
namejdbc/SampleDatasource/name
config-property-setting
name=UserNameusername/config-property-setting
config-property-setting
name=Passwordpassword/config-property-setting
config-property-setting
name=Drivercom.microsoft.sqlserver.jdbc.SQLServerDriver/config-property-setting
config-property-setting
name=ConnectionURLjdbc:sqlserver://servername:1433;DataBaseName=sampledb/config-property-setting
connectionmanager
local-transaction/
single-pool
max-size5/max-size
min-size0/min-size

blocking-timeout-milliseconds5000/blocking-timeout-milliseconds
idle-timeout-minutes15/idle-timeout-minutes
match-one/
/single-pool
/connectionmanager
/connectiondefinition-instance
/connection-definition
/outbound-resourceadapter
/resourceadapter

Thanks for pointing out any error.


Re: deployment for MySQL XA.

2009-01-19 Thread bongosdude

David,

I could not figure out how to copy the plan out of the dbpool wizard. Can
you show me the steps?

-B


djencks wrote:
 
 The easiest way is to use the admin console database wizard.  You can  
 copy the plan out of the wizard to put into your plan.xml source.  You  
 can duplicate the xa pool and change the tx element to no- 
 transaction for the non-jta datasource
 
 thanks
 david jencks
 
 On Jan 18, 2009, at 6:47 PM, bongosdude wrote:
 

 Can someone show me how to create deployment plan for MySQL XA  
 datasource?
 How is about MS SQL (local transaction)

 Thanks
 -B

 -
 B Amigo:super:
 -- 
 View this message in context:
 http://www.nabble.com/deployment-for-MySQL-XA.-tp21536125s134p21536125.html
 Sent from the Apache Geronimo - Users mailing list archive at  
 Nabble.com.

 
 
 


-
B Amigo:super:
-- 
View this message in context: 
http://www.nabble.com/deployment-for-MySQL-XA.-tp21536125s134p21550948.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.



Re: deployment for MySQL XA.

2009-01-19 Thread bongosdude

I have put your suggestions into my plan.xml. but maven still complains?

?xml version=1.0 encoding=UTF-8?
connector xmlns=http://geronimo.apache.org/xml/ns/j2ee/connector-1.2;
dep:environment
xmlns:dep=http://geronimo.apache.org/xml/ns/deployment-1.2;
dep:moduleId
dep:groupIdconsole.dbpool/dep:groupId
dep:artifactIdmy_users/dep:artifactId
dep:version1.0/dep:version
dep:typerar/dep:type
/dep:moduleId
dep:dependencies
dep:dependency
dep:groupIdmysql/dep:groupId
dep:artifactIdmysql-connector-java/dep:artifactId
dep:version5.1.7/dep:version
dep:typejar/dep:type
/dep:dependency
/dep:dependencies
/dep:environment

resourceadapter
outbound-resourceadapter
connection-definition
   
connectionfactory-interfacejavax.sql.DataSource/connectionfactory-interface
connectiondefinition-instance
namecallingcard_users/name
config-property-setting
name=Passwordjosso123$/config-property-setting
config-property-setting
name=connectionURLhttp://localhost:3306/my_users/config-property-setting
config-property-setting
name=UserNamejosso/config-property-setting
connectionmanager
xa-transaction
transaction-caching/
/xa-transaction
single-pool
max-size10/max-size
min-size0/min-size
match-one/
/single-pool
/connectionmanager
/connectiondefinition-instance
/connection-definition
/outbound-resourceadapter
/resourceadapter
/connector

1. Maven complains that the attribute DatabaseName is not valid, I have to
change to connectionURL
2. Where does it look to find out if the driver is XA or not?
3. I tried to put in the node ext-module, maven erred out with message,
ext-module is not valid node 

Thanks
-B


bongosdude wrote:
 
 David,
 
 I could not figure out how to copy the plan out of the dbpool wizard. Can
 you show me the steps?
 
 -B
 
 
 djencks wrote:
 
 The easiest way is to use the admin console database wizard.  You can  
 copy the plan out of the wizard to put into your plan.xml source.  You  
 can duplicate the xa pool and change the tx element to no- 
 transaction for the non-jta datasource
 
 thanks
 david jencks
 
 On Jan 18, 2009, at 6:47 PM, bongosdude wrote:
 

 Can someone show me how to create deployment plan for MySQL XA  
 datasource?
 How is about MS SQL (local transaction)

 Thanks
 -B

 -
 B Amigo:super:
 -- 
 View this message in context:
 http://www.nabble.com/deployment-for-MySQL-XA.-tp21536125s134p21536125.html
 Sent from the Apache Geronimo - Users mailing list archive at  
 Nabble.com.

 
 
 
 
 


-
B Amigo:super:
-- 
View this message in context: 
http://www.nabble.com/deployment-for-MySQL-XA.-tp21536125s134p21552390.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.



Re: Jetty/Tomcat plugin build failed with persistence.xml

2009-01-19 Thread bongosdude

David,

I put it the file persistence.xml in
${EJB_PROJECT_HOME}/src/resources/META-INF/

Should I put it under tomcat/jetty tomcat?

-B


djencks wrote:
 
 
 On Jan 18, 2009, at 6:23 PM, bongosdude wrote:
 

 David,

 my database name is my_users. and I have two dbpool defined to point  
 to the
 same database my_users. One is XA and other is non XA.
 
 thats fine.
 
 I forgot to mention in my post on the other thread that you need to be  
 sure to use the correct tranql msql xa wrapper in your maven project.   
 Note that it shows up in two places in your pom.xml -- as a dependency  
 and as the module being deployed in the car-maven-plugin.
 
 You still haven't said where you put your persistence.xml but it looks  
 from an earlier post that deployment is still not able to find it.
 
 thanks
 david jencks
 


 Thanks


 bongosdude wrote:


 David,

 Here is my connector definition in my datasource plan.xml

 connector xmlns=http://geronimo.apache.org/xml/ns/j2ee/connector-1.2 
 
resourceadapter
outbound-resourceadapter
connection-definition

 connectionfactory-interfacejavax.sql.DataSource/ 
 connectionfactory-interface
connectiondefinition-instance
namemy_users/name
config-property-setting
 name=DatabaseNamemy_users/config-property-setting
connectionmanager
xa-transaction
transaction-caching/
/xa-transaction
single-pool
max-size10/max-size
min-size0/min-size
select-one-assume-match/
/single-pool
/connectionmanager
/connectiondefinition-instance
connectiondefinition-instance
namemy_users_notx/name
config-property-setting
 name=DatabaseNamemy_users/config-property-setting
connectionmanager
no-transaction/
single-pool
max-size10/max-size
min-size0/min-size
select-one-assume-match/
/single-pool
/connectionmanager
/connectiondefinition-instance
/connection-definition
/outbound-resourceadapter
/resourceadapter
 /connector

 I have configured two database pool name: my_users and  
 my_users_no_tx (the
 database driver is mysql. one is XA and other is NONXA). I am now
 encountering the following:

 [ERROR] BUILD ERROR
 [INFO]
 
 [INFO] You are requesting xa transaction support for a connector that
 supports only local transactions: named: my_users

 What is wrong with my plan.xml




 bongosdude wrote:



 David,

 I figured out part of my problems by looking at Bank/Caculator  
 samples.
 Bank tomcat/jetty plugins depend on the sample sample-datasource
 (sample-datasource.car). So it gave me how to create plan.xml for my
 datasource connector.  The build was now successful but with  
 exception as
 below:

 Can you show me how can I build gbean for my persistence unit that I
 defined in persistence.xml. I could not find out how it can be  
 done with
 the sample bank/calculator.

 INFO] Started deployer:
 org.apache.geronimo.configs/persistence-jpa10-deployer/2.1.2/car
 org.apache.geronimo.common.DeploymentException: Could not resolve
 reference at deploy time for query
 ?name=persistence/ 
 CallingCardUsersUnit 
 #org.apache.geronimo.persistence.PersistenceUnitGBean.
 No GBeans found.
at
 org 
 .apache 
 .geronimo 
 .persistence 
 .builder 
 .PersistenceContextRefBuilder 
 .checkForGBean(PersistenceContextRefBuilder.java:205)
at
 org 
 .apache 
 .geronimo 
 .persistence 
 .builder 
 .PersistenceContextRefBuilder 
 .buildNaming(PersistenceContextRefBuilder.java:119)
at
 org 
 .apache 
 .geronimo 
 .j2ee 
 .deployment 
 .NamingBuilderCollection.buildNaming(NamingBuilderCollection.java: 
 53)
at
 org 
 .apache 
 .geronimo 
 .openejb 
 .deployment.EjbDeploymentBuilder.addEnc(EjbDeploymentBuilder.java: 
 321)
at
 org 
 .apache 
 .geronimo 
 .openejb 
 .deployment 
 .EjbDeploymentBuilder.buildEnc(EjbDeploymentBuilder.java:286)
at
 org 
 .apache 
 .geronimo 
 .openejb 
 .deployment.EjbModuleBuilder.addGBeans(EjbModuleBuilder.java:764)
at
 org 
 .apache 
 .geronimo 
 .j2ee 
 .deployment 
 .EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java: 
 254)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)




 djencks wrote:

 Where exactly is the persistence.xml in your ear?

 BTW if you use auto-create tables or openjpa sequences you almost
 certainly need a non-jta-datasource as well, and it should 

Re: [DISCUSS] Security Vulnerability Policy created

2009-01-19 Thread Donald Woods

Sounds good to me.

Should step #8 include a post to the private@ list, so other PMC members 
will have some history behind the fixes being checked into svn in step #9?



-Donald


Kevan Miller wrote:


On Jan 19, 2009, at 9:14 AM, Donald Woods wrote:

There was a long discussion around mid-December on the private and 
security Geronimo mailing lists about how to handle security 
vulnerabilities.  The outcome of that discussion (which is mainly a 
boilerplate suggested by Mark Thomas for all projects to use) can be 
found on our Project Policies wiki page at -

 http://cwiki.apache.org/GMOxPMGT/geronimo-project-policies.html

If you see anything that needs changing or information that needs to 
be added, then please discuss on this thread.


The only question I had concerned step 6. Should the fix be discussed on 
security@ and/or priv...@? It needs to be on a private list, to 
properly embargo the vulnerability until a fix is available. Since most 
of the discussions of the issue occur on secur...@geronimo, I think 
discussion of the fix is most appropriate there.


Thoughts?

--kevan


Accessing JMS in web app

2009-01-19 Thread James Bailey

I'm having a bear of a time trying to get JMS to work from within a web
application.  Here's all the pertinent information.  I've created the
following via the console:

Group: Logging (console.jms/Logging/1.0/rar)
Type - Name - Deployed As - State
Connection Factory - LoggingConnectionFactory - Server-wide - running   
Queue - LoggingQueue - Server-wide - running

Here's my web.xml file (simplified a little):



?xml version=1.0 encoding=UTF-8?
web-app ...ns... version=2.5
...other stuff...  
resource-ref
res-ref-nameLoggingConnectionFactory/res-ref-name
res-typejavax.jms.QueueConnectionFactory/res-type
res-authContainer/res-auth
res-sharing-scopeShareable/res-sharing-scope
/resource-ref

message-destination-ref

message-destination-ref-nameLoggingQueue/message-destination-ref-name

message-destination-typejavax.jms.Queue/message-destination-type
message-destination-usageProduces/message-destination-usage

message-destination-linkLoggingQueue/message-destination-link
/message-destination-ref
/web-app



The top of my servlet:



...package, imports
public class TestServlet extends HttpServlet {
@Resource(name = LoggingConnectionFactory)
private ConnectionFactory factory;

@Resource(name = LoggingQueue)
private Queue queue;
...etc...



All of the above is almost a direct copy of the code from
http://cwiki.apache.org/GMOxDOC21/jms-mdb-jms-and-mdb-sample-application.html. 
When trying to deploy, I get the error:

Distribution of module failed.  See log for details.
  Can not resolve admin object ref
?j2eeType=JCAAdminObject,name=LoggingQueue# in configuration
test/webApp/1.0/car
  org.apache.geronimo.common.DeploymentException: Can not resolve admin
object ref ?j2eeType=JCAAdminObject,name=LoggingQueue# in configuration
test/webApp/1.0/car
...etc...
  Caused by: org.apache.geronimo.kernel.GBeanNotFoundException: No matches
for referencePatterns: [?j2eeType=JCAAdminObject,name=LoggingQueue#]
...etc...

What am I missing?

P.S.  When will the walk-throughs be updated?  For example,
jms-mdb-jms-and-mdb-sample-application contains invalid information in the
web.xml snippet and using the code as is doesn't work.
-- 
View this message in context: 
http://www.nabble.com/Accessing-JMS-in-web-app-tp21554281s134p21554281.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.



Re: deployment for MySQL XA.

2009-01-19 Thread bongosdude

Hi

I added this MS SQL resourceadapter into my datasource plan

resourceadapter
outbound-resourceadapter
connection-definition
   
connectionfactory-interfacejavax.sql.DataSource/connectionfactory-interface
connectiondefinition-instance
namemynuvoip/name
config-property-setting
name=UserNamesa/config-property-setting
config-property-setting
name=Passwordxx/config-property-setting
config-property-setting
name=Drivercom.microsoft.sqlserver.jdbc.SQLServerDriver/config-property-setting
config-property-setting
name=ConnectionURLjdbc:sqlserver://localhost:1433;databaseName=dtalk/config-property-setting
connectionmanager
local-transaction/
single-pool
max-size5/max-size
min-size0/min-size
   
blocking-timeout-milliseconds5000/blocking-timeout-milliseconds
idle-timeout-minutes15/idle-timeout-minutes
match-one/
/single-pool
/connectionmanager
/connectiondefinition-instance
/connection-definition
/outbound-resourceadapter
   /resourceadapter 

When I tried to deploy my plugin to geronimo, it complaints that I did see
MS SQL driver: com.microsoft.sqlserver.jdbc.SQLServerDriver. I have
installed MS SQL jar file to geronimo repostitory. What setting should I put
in plan.xml to tell the deployer get the driver from geronimo repository?

Thanks
-B

Caused by: org.apache.geronimo.gbean.InvalidConfigurationException:
Configuration
com.myvoip.ipservices/callingcard-datasource/0.0.1-SNAPSHOT/car failed to
start due to the following reasons:
  The service
J2EEApplication=null,JCAConnectionFactory=mynuvoip,JCAResource=com.myvoip.ipservices/callingcard-datasource/0.0.1-SNAPSHOT/car,ResourceAdapter=com.myvoip.ipservices/callingcard-datasource/0.0.1-SNAPSHOT/car,ResourceAdapterModule=com.myvoip.ipservices/callingcard-datasource/0.0.1-SNAPSHOT/car,j2eeType=JCAManagedConnectionFactory,name=mynuvoip
did not start because Unable to load driver class:
com.microsoft.sqlserver.jdbc.SQLServerDriver



-B


bongosdude wrote:
 
 I have put your suggestions into my plan.xml. but maven still complains?
 
 ?xml version=1.0 encoding=UTF-8?
 connector xmlns=http://geronimo.apache.org/xml/ns/j2ee/connector-1.2;
 dep:environment
 xmlns:dep=http://geronimo.apache.org/xml/ns/deployment-1.2;
 dep:moduleId
 dep:groupIdconsole.dbpool/dep:groupId
 dep:artifactIdmy_users/dep:artifactId
 dep:version1.0/dep:version
 dep:typerar/dep:type
 /dep:moduleId
 dep:dependencies
 dep:dependency
 dep:groupIdmysql/dep:groupId
 dep:artifactIdmysql-connector-java/dep:artifactId
 dep:version5.1.7/dep:version
 dep:typejar/dep:type
 /dep:dependency
 /dep:dependencies
 /dep:environment
 
 resourceadapter
 outbound-resourceadapter
 connection-definition

 connectionfactory-interfacejavax.sql.DataSource/connectionfactory-interface
 connectiondefinition-instance
 namecallingcard_users/name
 config-property-setting
 name=Passwordjosso123$/config-property-setting
 config-property-setting
 name=connectionURLhttp://localhost:3306/my_users/config-property-setting
 config-property-setting
 name=UserNamejosso/config-property-setting
 connectionmanager
 xa-transaction
 transaction-caching/
 /xa-transaction
 single-pool
 max-size10/max-size
 min-size0/min-size
 match-one/
 /single-pool
 /connectionmanager
 /connectiondefinition-instance
 /connection-definition
 /outbound-resourceadapter
 /resourceadapter
 /connector
 
 1. Maven complains that the attribute DatabaseName is not valid, I have to
 change to connectionURL
 2. Where does it look to find out if the driver is XA or not?
 3. I tried to put in the node ext-module, maven erred out with message,
 ext-module is not valid node 
 
 Thanks
 -B
 
 
 bongosdude wrote:
 
 David,
 
 I could not figure out how to copy the plan out of the dbpool wizard. Can
 you show me the steps?
 
 -B
 
 
 djencks wrote:
 
 The easiest way is to use the admin console database wizard.  You can  
 copy the plan out of the wizard to put into your plan.xml source.  You  
 can duplicate the xa pool and change the tx element to no- 
 

Re: java.lang.ClassNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory

2009-01-19 Thread viola.lu

I think you forgot to add a geronimo server runtime library, which includes
general libs such as commons-loogins,geronmo-j2ee-management_1.1_spec..

axiez wrote:
 
 I added commons-logging-1.0.4.jar. This time the error is:
 java.lang.NoClassDefFoundError: javax/management/j2ee/statistics/Stats
 
 axiez wrote:
 
 I have the following sample code and jndi.properties file:
 import javax.jms.*;
 import javax.naming.InitialContext;
 import java.util.*;
 import java.io.*;
 public class LogClient {
 public static void main(String[] args) throws Exception {
 Properties p = new Properties();
 p.load(new FileInputStream(jndi.properties));
 p.put(openejb.authentication.realmName,geronimo-admin);
 InitialContext ctx = new InitialContext(p);
 TopicConnectionFactory factory = (TopicConnectionFactory)
 ctx.lookup(java:comp/env/jms/DefaultActiveMQConnectionFactory);
 TopicConnection connection = factory.createTopicConnection();
 TopicSession session = connection.createTopicSession(false,
 Session.AUTO_ACKNOWLEDGE);
 Topic topic = (Topic)ctx.lookup(java:comp/env/jms/Topic);
 TopicPublisher publisher = session.createPublisher(topic);
 TextMessage msg = session.createTextMessage();
 msg.setText(This is a test message);
 publisher.send(msg);
 publisher.close();
 System.out.println(Message published. Please check application
 server's console to see the response from MDB);
 }
 }
 
 jndi.properties file:
 java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
 java.naming.provider.url=tcp://localhost:61616
 java.naming.security.principal=system
 java.naming.security.credentials=manager
 
 I ran the program after successful compilation. Error message is:
 Exception in thread main javax.naming.NoInitialContextException: Cannot
 instantiate class: org.apache.activemq.jndi.ActiveMQInitialContextFactory
 [Root exception is java.lang.ClassNotFoundException:
 org.apache.activemq.jndi.ActiveMQInitialContextFactory]
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/java.lang.ClassNotFoundException%3A-org.apache.activemq.jndi.ActiveMQInitialContextFactory-tp21537474s134p21556083.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.



Re: java.lang.ClassNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory

2009-01-19 Thread axiez

Could you please tell me how to add Geronimo server runtime library?

axiez wrote:
 
 I have the following sample code and jndi.properties file:
 import javax.jms.*;
 import javax.naming.InitialContext;
 import java.util.*;
 import java.io.*;
 public class LogClient {
 public static void main(String[] args) throws Exception {
 Properties p = new Properties();
 p.load(new FileInputStream(jndi.properties));
 p.put(openejb.authentication.realmName,geronimo-admin);
 InitialContext ctx = new InitialContext(p);
 TopicConnectionFactory factory = (TopicConnectionFactory)
 ctx.lookup(java:comp/env/jms/DefaultActiveMQConnectionFactory);
 TopicConnection connection = factory.createTopicConnection();
 TopicSession session = connection.createTopicSession(false,
 Session.AUTO_ACKNOWLEDGE);
 Topic topic = (Topic)ctx.lookup(java:comp/env/jms/Topic);
 TopicPublisher publisher = session.createPublisher(topic);
 TextMessage msg = session.createTextMessage();
 msg.setText(This is a test message);
 publisher.send(msg);
 publisher.close();
 System.out.println(Message published. Please check application
 server's console to see the response from MDB);
 }
 }
 
 jndi.properties file:
 java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
 java.naming.provider.url=tcp://localhost:61616
 java.naming.security.principal=system
 java.naming.security.credentials=manager
 
 I ran the program after successful compilation. Error message is:
 Exception in thread main javax.naming.NoInitialContextException: Cannot
 instantiate class: org.apache.activemq.jndi.ActiveMQInitialContextFactory
 [Root exception is java.lang.ClassNotFoundException:
 org.apache.activemq.jndi.ActiveMQInitialContextFactory]
 
 

-- 
View this message in context: 
http://www.nabble.com/java.lang.ClassNotFoundException%3A-org.apache.activemq.jndi.ActiveMQInitialContextFactory-tp21537474s134p21556399.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.



Re: java.lang.ClassNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory

2009-01-19 Thread viola.lu

1.In eclipse, first install Geronimo Eclipse Plugin from
http://geronimo.apache.org/development-tools.html, and define a Geronimo
server runtime.
2.In eclipse,right-click your project, build-path-library-add
library-Server runtime-choose apache geronmo server ,then you can run
your application.
3.If still class not found, you can find out more jars under Geronimo
repository, and add them to classpath.

Hope it can help!
Thanks.
Viola.Lu


axiez wrote:
 
 Could you please tell me how to add Geronimo server runtime library?
 
 axiez wrote:
 
 I have the following sample code and jndi.properties file:
 import javax.jms.*;
 import javax.naming.InitialContext;
 import java.util.*;
 import java.io.*;
 public class LogClient {
 public static void main(String[] args) throws Exception {
 Properties p = new Properties();
 p.load(new FileInputStream(jndi.properties));
 p.put(openejb.authentication.realmName,geronimo-admin);
 InitialContext ctx = new InitialContext(p);
 TopicConnectionFactory factory = (TopicConnectionFactory)
 ctx.lookup(java:comp/env/jms/DefaultActiveMQConnectionFactory);
 TopicConnection connection = factory.createTopicConnection();
 TopicSession session = connection.createTopicSession(false,
 Session.AUTO_ACKNOWLEDGE);
 Topic topic = (Topic)ctx.lookup(java:comp/env/jms/Topic);
 TopicPublisher publisher = session.createPublisher(topic);
 TextMessage msg = session.createTextMessage();
 msg.setText(This is a test message);
 publisher.send(msg);
 publisher.close();
 System.out.println(Message published. Please check application
 server's console to see the response from MDB);
 }
 }
 
 jndi.properties file:
 java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
 java.naming.provider.url=tcp://localhost:61616
 java.naming.security.principal=system
 java.naming.security.credentials=manager
 
 I ran the program after successful compilation. Error message is:
 Exception in thread main javax.naming.NoInitialContextException: Cannot
 instantiate class: org.apache.activemq.jndi.ActiveMQInitialContextFactory
 [Root exception is java.lang.ClassNotFoundException:
 org.apache.activemq.jndi.ActiveMQInitialContextFactory]
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/java.lang.ClassNotFoundException%3A-org.apache.activemq.jndi.ActiveMQInitialContextFactory-tp21537474s134p21556927.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.



Re: java.lang.ClassNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory

2009-01-19 Thread axiez

I added asm-2.2.3.jar, asm-commons-2.2.3.jar, cglib-nodep-2.1_3.jar,
commons-cli-1.0.jar, geronimo-cli-2.1.3.jar,
geronimo-deploy-jsr88-bootstrapper-2.1.3.jar,
geronimo-jaxws-builder-2.1.3.jar, geronimo-kernel-2.1.3.jar,
geronimo-transformer-2.1.3.jar, jcl104-over-slf4j-1.4.3.jar,
jsr88-deploymentfactory.jar, log4j-1.2.14.jar,
plexus-archiver-1.0-alpha-7.jar, slf4j-api-1.4.3.jar,
slf4j-log4j12-1.4.3.jar, xpp3-1.1.3.4.0.jar and xstream-1.2.2.jar to
classpath.
When I tried to run the program I got the error message:
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

axiez wrote:
 
 I have the following sample code and jndi.properties file:
 import javax.jms.*;
 import javax.naming.InitialContext;
 import java.util.*;
 import java.io.*;
 public class LogClient {
 public static void main(String[] args) throws Exception {
 Properties p = new Properties();
 p.load(new FileInputStream(jndi.properties));
 p.put(openejb.authentication.realmName,geronimo-admin);
 InitialContext ctx = new InitialContext(p);
 TopicConnectionFactory factory = (TopicConnectionFactory)
 ctx.lookup(java:comp/env/jms/DefaultActiveMQConnectionFactory);
 TopicConnection connection = factory.createTopicConnection();
 TopicSession session = connection.createTopicSession(false,
 Session.AUTO_ACKNOWLEDGE);
 Topic topic = (Topic)ctx.lookup(java:comp/env/jms/Topic);
 TopicPublisher publisher = session.createPublisher(topic);
 TextMessage msg = session.createTextMessage();
 msg.setText(This is a test message);
 publisher.send(msg);
 publisher.close();
 System.out.println(Message published. Please check application
 server's console to see the response from MDB);
 }
 }
 
 jndi.properties file:
 java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
 java.naming.provider.url=tcp://localhost:61616
 java.naming.security.principal=system
 java.naming.security.credentials=manager
 
 I ran the program after successful compilation. Error message is:
 Exception in thread main javax.naming.NoInitialContextException: Cannot
 instantiate class: org.apache.activemq.jndi.ActiveMQInitialContextFactory
 [Root exception is java.lang.ClassNotFoundException:
 org.apache.activemq.jndi.ActiveMQInitialContextFactory]
 
 

-- 
View this message in context: 
http://www.nabble.com/java.lang.ClassNotFoundException%3A-org.apache.activemq.jndi.ActiveMQInitialContextFactory-tp21537474s134p21557734.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.