Re: Upgraded to Tomee 1.5, Password cipher not working anymore

2012-10-24 Thread Jean-Louis MONTEIRO
Hi,

Not for the moment. That's only an OpenEJB feature on DBCP original pool.
I guess it should not be so tricky to make it available on tomcat-pool as
well.

JLouis

2012/10/25 mommymutya 

> Oh, come to think of it, how do I now encrypt my password if I want to use
> the default datasourcecreator which is tomcat? Does it have something like
> PasswordCipher for dbcp?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Upgraded-to-Tomee-1-5-Password-cipher-not-working-anymore-tp4658231p4658256.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>


Re: Upgraded to Tomee 1.5, Password cipher not working anymore

2012-10-24 Thread mommymutya
Adding DataSourceCreator=dbcp in the resource declaration, worked like a
charm! 
Thanks Romain Manni-Bucau! :)  



--
View this message in context: 
http://openejb.979440.n4.nabble.com/Upgraded-to-Tomee-1-5-Password-cipher-not-working-anymore-tp4658231p4658255.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Upgraded to Tomee 1.5, Password cipher not working anymore

2012-10-24 Thread mommymutya
Oh, come to think of it, how do I now encrypt my password if I want to use
the default datasourcecreator which is tomcat? Does it have something like
PasswordCipher for dbcp?



--
View this message in context: 
http://openejb.979440.n4.nabble.com/Upgraded-to-Tomee-1-5-Password-cipher-not-working-anymore-tp4658231p4658256.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


How to override/set custom resource factory in tomee.xml 'Resource'

2012-10-24 Thread mommymutya
I would like to do this tomcat setting in my tomee server.


Basically I just would like to have my password encrypted/decrypted.  I used
PasswordCipher but apparently it is only commons-dbcp that recognizes it.  I
would like to use the default tomcat-jdbc for the pool lib so I thought of
just creating my custom class.

At the moment, I have this:

JdbcDriver driver
JdbcUrl jdbc:blabla:/
UserName username
Password encryptedPassword
JtaManaged true
ValidationQuery SELECT 1


I have extended org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory as
MyCustomBasicDataSourceFactory and would like openejb to use it as I have
put the password decryption in an overriden getObjectInstance method.  How
do I set it up for tomee?





--
View this message in context: 
http://openejb.979440.n4.nabble.com/How-to-override-set-custom-resource-factory-in-tomee-xml-Resource-tp4658258.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


How to get TomEE+ version from command-line?

2012-10-24 Thread Alex The Rocker
Hello,

I have a simple question : how can TomEE+ version can be found using
command-line?
If we run /bin/version.sh/.bat then we only see
Tomcat's version.
also RELEASE-NOTES.txt file in the install root only mentions Tomcat.

Am i missing something ?

Thanks,
Alex


Cannot create PoolableConnectionFactory error?

2012-10-24 Thread javanovice
Hello Experts!

Can you please point me in the right direction? I am trying to simply get
the ConnectionPool to work. Below is my stack trace for error.

I am running: TomEE 1.5 on Solaris with mysql.

MySQL database is working fine. Ive checked the username/password several
times. Ive granted all privileges on the user of that table. I know the
username/password works - I am able to insert two records and error occurs.
I dont think it is a networking issue of any kind. I dont think it is a
login issue either.

I am confident I am closing the database objects properly. I followed a DAO
example provided by  Bauke Scholtz
 
. I create a connection, prepared statement, and resultset in that order.
Then I close them in reverse order: resultset, statement, and connection. I
am happy to post the specific methods if you like. Please advise on that.

*Do you have any suggestions on where I am going wrong?* I have full access
to my Tomcat server so I can retrieve any information you may need. Thank
you for your time and thoughts. 


Here are my configuration snippets:


server.xml Resource Configuration

  






  

web.xml


Database Connection
jdbc/myNutrition
javax.sql.DataSource
Container




Stack Trace

Oct 24, 2012 9:13:35 PM com.corejsf.chapter3.QuizBean 
INFO: * * * * * QUIZ BEAN INITIATED * * * * *
Oct 24, 2012 9:13:35 PM com.nutrition.dao.tests.QuizQuestionTest logMe
INFO: DAOFactory successfully obtained:
com.nutrition.dao.DataSourceDAOFactory@a32dba
Oct 24, 2012 9:13:35 PM com.nutrition.dao.tests.QuizQuestionTest logMe
INFO: QuizQuestionDAO successfully obtained:
com.nutrition.dao.QuizQuestionDAOJDBC@10f2e76
Oct 24, 2012 9:13:39 PM com.corejsf.chapter3.QuizBean 
SEVERE: null
com.nutrition.dao.DAOException:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (Could not create connection to database server.
Attempted reconnect 3 times. Giving up.)
  at
com.nutrition.dao.QuizQuestionDAOJDBC.create(QuizQuestionDAOJDBC.java:139)
  at
com.nutrition.dao.tests.QuizQuestionTest.performTest(QuizQuestionTest.java:62)
  at com.corejsf.chapter3.QuizBean.(QuizBean.java:37)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
  at
org.apache.webbeans.inject.InjectableConstructor.doInjection(InjectableConstructor.java:89)
  at
org.apache.webbeans.component.ManagedBean.createComponentInstance(ManagedBean.java:94)
  at
org.apache.webbeans.component.AbstractInjectionTargetBean.createDefaultInstance(AbstractInjectionTargetBean.java:133)
  at
org.apache.webbeans.component.AbstractInjectionTargetBean.createInstance(AbstractInjectionTargetBean.java:116)
  at
org.apache.webbeans.component.AbstractOwbBean.createNewInstance(AbstractOwbBean.java:233)
  at
org.apache.webbeans.portable.creation.AbstractProducer.produce(AbstractProducer.java:79)
  at
org.apache.webbeans.component.InjectionTargetWrapper.produce(InjectionTargetWrapper.java:136)
  at
org.apache.webbeans.component.AbstractOwbBean.create(AbstractOwbBean.java:180)
  at
org.apache.webbeans.context.creational.BeanInstanceBag.create(BeanInstanceBag.java:81)
  at
org.apache.webbeans.context.AbstractContext.getInstance(AbstractContext.java:167)
  at
org.apache.webbeans.context.AbstractContext.get(AbstractContext.java:132)
  at
org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.getContextualInstance(NormalScopedBeanInterceptorHandler.java:154)
  at
org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.invoke(NormalScopedBeanInterceptorHandler.java:114)

 

Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (Could not create connection to database server.
Attempted reconnect 3 times. Giving up.)
  at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
  at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
  at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
  at
com.nutrition.dao.DataSourceDAOFactory.getConnection(DAOFactory.java:188)
  at
com.nutrition.dao.QuizQuestionDAOJDBC.create(QuizQuestionDAOJDBC.java:126)
  ... 63 more
Caused by:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could
not create connection to database server. Attempted reconnect 3 times.
Giving up.
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Del

Re: Tinkering with JAX-WS web service URLs in EJB 3.1 module of EAR

2012-10-24 Thread Romain Manni-Bucau
Hi,

didn't try for ear but could work:
http://svn.apache.org/repos/asf/openejb/trunk/openejb/examples/change-jaxws-url/src/main/resources/META-INF/openejb-jar.xml

*Romain Manni-Bucau*
*Twitter: @rmannibucau *
*Blog: **http://rmannibucau.wordpress.com/*
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*




2012/10/24 ymaraner 

> Within an EAR file, I have an EJB 3.1 module that implements multiple
> stateless session beans which expose JAX-WS web services specified in
> endpoint interfaces.
>
> When I deploy the EAR file to the apps directory of TomEE+ 1.5, I can
> access
> the wsdl for each of the services at:
> - http://localhost:8080/EJB1Name?wsdl
> - http://localhost:8080/EJB2Name?wsdl
>
> However, I want my URLs to be something like:
> - http://localhost:8080/WebServices/Nickname1?wsdl
> - http://localhost:8080/WebServices/Nickname2?wsdl
>
> How can I specify a common root context for all of the web services in my
> ear?
> How can I specify subcontexts that are something other than the name of the
> EJB that implements the service?
>
> WebSphere handles this with a web service router module that is linked and
> configured using vendor-specific deployment descriptors. Is there something
> similar in TomEE? If so, where can I find documentation on how to set this
> up?
>
>
>
>
> -
> - Tim
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Tinkering-with-JAX-WS-web-service-URLs-in-EJB-3-1-module-of-EAR-tp4658250.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>


Tinkering with JAX-WS web service URLs in EJB 3.1 module of EAR

2012-10-24 Thread ymaraner
Within an EAR file, I have an EJB 3.1 module that implements multiple
stateless session beans which expose JAX-WS web services specified in
endpoint interfaces.

When I deploy the EAR file to the apps directory of TomEE+ 1.5, I can access
the wsdl for each of the services at:
- http://localhost:8080/EJB1Name?wsdl
- http://localhost:8080/EJB2Name?wsdl

However, I want my URLs to be something like: 
- http://localhost:8080/WebServices/Nickname1?wsdl
- http://localhost:8080/WebServices/Nickname2?wsdl

How can I specify a common root context for all of the web services in my
ear?
How can I specify subcontexts that are something other than the name of the
EJB that implements the service?

WebSphere handles this with a web service router module that is linked and
configured using vendor-specific deployment descriptors. Is there something
similar in TomEE? If so, where can I find documentation on how to set this
up?




-
- Tim
--
View this message in context: 
http://openejb.979440.n4.nabble.com/Tinkering-with-JAX-WS-web-service-URLs-in-EJB-3-1-module-of-EAR-tp4658250.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: JPA Load-Time Enhancement

2012-10-24 Thread Romain Manni-Bucau
didnt think about it exactly,

that's already the case since openejb 3 - it is what the javaagent does

*Romain Manni-Bucau*
*Twitter: @rmannibucau *
*Blog: **http://rmannibucau.wordpress.com/*
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*




2012/10/24 Anthony Fryer 

> +1 for this.  I raised a JIRA here
> https://issues.apache.org/jira/browse/TOMEE-501
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/JPA-Load-Time-Enhancement-tp4658181p4658247.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>


Re: JPA Load-Time Enhancement

2012-10-24 Thread Anthony Fryer
+1 for this.  I raised a JIRA here
https://issues.apache.org/jira/browse/TOMEE-501



--
View this message in context: 
http://openejb.979440.n4.nabble.com/JPA-Load-Time-Enhancement-tp4658181p4658247.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: bug with openejb cipher

2012-10-24 Thread Romain Manni-Bucau
Hi,

good catch, updated on trunk
https://issues.apache.org/jira/browse/OPENEJB-1923

*Romain Manni-Bucau*
*Twitter: @rmannibucau *
*Blog: **http://rmannibucau.wordpress.com/*
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*




2012/10/24 kp.gores 

> Hi,
>
> I've found a bug with `openejb cipher` when trying to encrypt a
> password. The password I used looked like a MAC address.
>
> To reproduce the bug enter:
>
> openejb-3.1.4/bin/openejb cipher AA-DA-AA
>
> This throws an exception:
>
> Exception in thread "main" java.lang.StringIndexOutOfBoundsException:
> String index out of range: -5
> at java.lang.String.substring(String.java:1937)
> at
> org.apache.openejb.cli.MainImpl.processSystemProperties(MainImpl.java:211)
> at org.apache.openejb.cli.MainImpl.main(MainImpl.java:65)
> at org.apache.openejb.cli.Bootstrap.main(Bootstrap.java:103)
>
>
> The problem is the '-DA' in my password.
>
>
> Regards
> kp
>


bug with openejb cipher

2012-10-24 Thread kp.gores
Hi,

I've found a bug with `openejb cipher` when trying to encrypt a
password. The password I used looked like a MAC address.

To reproduce the bug enter:

openejb-3.1.4/bin/openejb cipher AA-DA-AA

This throws an exception:

Exception in thread "main" java.lang.StringIndexOutOfBoundsException:
String index out of range: -5
at java.lang.String.substring(String.java:1937)
at 
org.apache.openejb.cli.MainImpl.processSystemProperties(MainImpl.java:211)
at org.apache.openejb.cli.MainImpl.main(MainImpl.java:65)
at org.apache.openejb.cli.Bootstrap.main(Bootstrap.java:103)


The problem is the '-DA' in my password.


Regards
kp


Re: Upgraded to Tomee 1.5, Password cipher not working anymore

2012-10-24 Thread Romain Manni-Bucau
passwordcipher is not supported by tomcat-jdbc,

using the property DataSourceCreator=dbcp should make it working back

will have a look if it can be added on trunk for tomcat-jdbc

*Romain Manni-Bucau*
*Twitter: @rmannibucau *
*Blog: **http://rmannibucau.wordpress.com/*
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*




2012/10/24 mommymutya 

> Ooops, I meant it was working nicely in my tomee 1.0 setup, but stopped
> working when I switched to tomee 1.5
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Upgraded-to-Tomee-1-5-Password-cipher-not-working-anymore-tp4658231p4658232.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>


Upgraded to Tomee 1.5, Password cipher not working anymore

2012-10-24 Thread mommymutya
Hi,
I upgraded to tomee 1.5 from a 1.0 setup. However, I couldn't have
PasswordCipher work correctly.  I am using the default one : PasswordCipher
Static3DES.  This worked nicely in my tomee 1.5 setup.
I am having the error: 
WARNING: Property "passwordCipher" not supported by "jdbc/CAWebServiceJTADS"

If I take out the 'PasswordCipher' property, and use the plain text
password, it works fine.  Is there anything I've missed in my upgrade?
Shouldn't it be straightforward?

Thanks,
MM



--
View this message in context: 
http://openejb.979440.n4.nabble.com/Upgraded-to-Tomee-1-5-Password-cipher-not-working-anymore-tp4658231.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Upgraded to Tomee 1.5, Password cipher not working anymore

2012-10-24 Thread mommymutya
Ooops, I meant it was working nicely in my tomee 1.0 setup, but stopped
working when I switched to tomee 1.5



--
View this message in context: 
http://openejb.979440.n4.nabble.com/Upgraded-to-Tomee-1-5-Password-cipher-not-working-anymore-tp4658231p4658232.html
Sent from the OpenEJB User mailing list archive at Nabble.com.