Re: tomee testing

2018-06-22 Thread Romain Manni-Bucau
Exclude mysql from sirona instrumentation. Its bytecode is not safe.

Le sam. 23 juin 2018 01:03, Matthew Broadhead
 a écrit :

> thanks i added it using
>  name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33
>
> but i get these errors (which don't seem to stop execution)
>
> fail to transform class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
> JSR/RET are not supported with computeFrames
> optionjava.lang.RuntimeException: JSR/RET are not supported with
> computeFrames option
>  at org.apache.sirona.asm.Frame.a(Unknown Source)
>  at org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown Source)
>
> SEVERE - Can't create DataSource
> java.lang.LinkageError: loader (instance of java/net/URLClassLoader):
> attempted  duplicate class definition for name:
> "com/mysql/jdbc/ConnectionImpl"
>
> but this one is a stopper
>
> SEVERE - CDI Beans module deployment failed
> org.apache.webbeans.exception.WebBeansDeploymentException:
> javax.enterprise.inject.UnsatisfiedResolutionException: Api type
> [uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
> Qualifiers: [@javax.enterprise.inject.Default()]
> for injection into Field Injection Point, field name : quoteTypeDao,
> Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
> Name:null, API
> Types:[java.lang.Object,uk.me.kissy.sales.test.QuoteGeneratorArquillian],
> Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
>
> i tried enabling remote support as i am trying remote not embedded
> tomee.remote.support = true
> # tomee.serialization.class.blacklist = *
> tomee.serialization.class.whitelist = *
>
> On 22/06/18 18:44, Romain Manni-Bucau wrote:
> > You can add it in libs property of arquillian container config. Just
> prefix
> > the coords with mvn:.
> >
> > Ex: mvn:mysql:mysql-connector-jav:version
> >
> > It is a multiline property so you can add N libs to tomee lib this way
> >
> > Le ven. 22 juin 2018 18:13, Matthew Broadhead
> >  a écrit :
> >
> >> INFO: Downloading org.apache.tomee:apache-tomee:7.0.3:zip:plus please
> >> wait...
> >>
> >> i have an arquillian test running up ok but it is complaining
> >> SEVERE - FATAL ERROR: Unknown error in Assembler.  Please send the
> >> following stack trace and this message to users@tomee.apache.org :
> >>org.apache.xbean.propertyeditor.PropertyEditorException: Unable to
> >> resolve class com.mysql.jdbc.Driver
> >>
> >> is there any way to directly bring in the mysql driver from maven
> >> central?  or do i need to download manually and put it into
> >> src/test/tomee/lib?
> >>
> >>
> >> On 22/06/18 10:03, Romain Manni-Bucau wrote:
> >>> You can theorically but I'd recommand you to write it in the final
> module
> >>> instead of trying to use the parent which will be executed before any
> >> other
> >>> modules.
> >>>
> >>> If A depends on B which depends on C then write your tests in A for the
> >>> complete app tests and write unit tests in B and C (potentially using
> >>> arquillian, appcomposer or even other solutions).
> >>>
> >>> For reference:
> >>> http://tomee.apache.org/developer/testing/arquillian/index.html and
> >>> http://tomee.apache.org/developer/testing/index.html
> >>>
> >>> Romain Manni-Bucau
> >>> @rmannibucau  |  Blog
> >>>  | Old Blog
> >>>  | Github <
> >> https://github.com/rmannibucau> |
> >>> LinkedIn  | Book
> >>> <
> >>
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >>>
> >>>
> >>> Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
> >>>  a écrit :
> >>>
>  it sounds like Arquillian might be the best fit in my case.  can the
>  tests inject CDI beans from the webapps or does everything need to be
>  done through http?  looking at
>  https://tomee.apache.org/refcard/refcard.html "Simple Arquilian Test"
> >> it
>  looks as if beans can be injected...
> 
>  is it possible to create the tests (or at least TomEE instance) in a
>  parent pom?  i need to run several webapps at once which are all
> modules
>  of the parent.  i think code is discouraged in parent project.
> 
> 
>  On 22/06/18 09:18, Romain Manni-Bucau wrote:
> > You can set the property openejb.location (or the other ones we have)
> >> to
> > point to an openejb.xml if you want. The advantage of the properties
> is
> > that it is filtered during the test and doesnt require a maven build
> >> but
>  it
> > is up to you and depends the project setup.
> >
> > Arquillian is great to test complete application*s* in a real server,
> > ApplicationComposer is good to test small parts of applications or
> > frameworks, TomEE,
> > TomEEEmbeddedSingleRunner is great to test a real app (single
> >> deployment
> > from the classpath + single test setup) and will save a lot of time.
> >
> > Romain M

Re: tomee testing

2018-06-22 Thread Matthew Broadhead

thanks i added it using
name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33


but i get these errors (which don't seem to stop execution)

fail to transform class:com/mysql/jdbc/AbandonedConnectionCleanupThread, 
JSR/RET are not supported with computeFrames 
optionjava.lang.RuntimeException: JSR/RET are not supported with 
computeFrames option

    at org.apache.sirona.asm.Frame.a(Unknown Source)
    at org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown Source)

SEVERE - Can't create DataSource
java.lang.LinkageError: loader (instance of java/net/URLClassLoader): 
attempted  duplicate class definition for name: 
"com/mysql/jdbc/ConnectionImpl"


but this one is a stopper

SEVERE - CDI Beans module deployment failed
org.apache.webbeans.exception.WebBeansDeploymentException: 
javax.enterprise.inject.UnsatisfiedResolutionException: Api type 
[uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers

Qualifiers: [@javax.enterprise.inject.Default()]
for injection into Field Injection Point, field name : quoteTypeDao, 
Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE, 
Name:null, API 
Types:[java.lang.Object,uk.me.kissy.sales.test.QuoteGeneratorArquillian], 
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]


i tried enabling remote support as i am trying remote not embedded
tomee.remote.support = true
# tomee.serialization.class.blacklist = *
tomee.serialization.class.whitelist = *

On 22/06/18 18:44, Romain Manni-Bucau wrote:

You can add it in libs property of arquillian container config. Just prefix
the coords with mvn:.

Ex: mvn:mysql:mysql-connector-jav:version

It is a multiline property so you can add N libs to tomee lib this way

Le ven. 22 juin 2018 18:13, Matthew Broadhead
 a écrit :


INFO: Downloading org.apache.tomee:apache-tomee:7.0.3:zip:plus please
wait...

i have an arquillian test running up ok but it is complaining
SEVERE - FATAL ERROR: Unknown error in Assembler.  Please send the
following stack trace and this message to users@tomee.apache.org :
   org.apache.xbean.propertyeditor.PropertyEditorException: Unable to
resolve class com.mysql.jdbc.Driver

is there any way to directly bring in the mysql driver from maven
central?  or do i need to download manually and put it into
src/test/tomee/lib?


On 22/06/18 10:03, Romain Manni-Bucau wrote:

You can theorically but I'd recommand you to write it in the final module
instead of trying to use the parent which will be executed before any

other

modules.

If A depends on B which depends on C then write your tests in A for the
complete app tests and write unit tests in B and C (potentially using
arquillian, appcomposer or even other solutions).

For reference:
http://tomee.apache.org/developer/testing/arquillian/index.html and
http://tomee.apache.org/developer/testing/index.html

Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github <

https://github.com/rmannibucau> |

LinkedIn  | Book
<

https://www.packtpub.com/application-development/java-ee-8-high-performance



Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
 a écrit :


it sounds like Arquillian might be the best fit in my case.  can the
tests inject CDI beans from the webapps or does everything need to be
done through http?  looking at
https://tomee.apache.org/refcard/refcard.html "Simple Arquilian Test"

it

looks as if beans can be injected...

is it possible to create the tests (or at least TomEE instance) in a
parent pom?  i need to run several webapps at once which are all modules
of the parent.  i think code is discouraged in parent project.


On 22/06/18 09:18, Romain Manni-Bucau wrote:

You can set the property openejb.location (or the other ones we have)

to

point to an openejb.xml if you want. The advantage of the properties is
that it is filtered during the test and doesnt require a maven build

but

it

is up to you and depends the project setup.

Arquillian is great to test complete application*s* in a real server,
ApplicationComposer is good to test small parts of applications or
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real app (single

deployment

from the classpath + single test setup) and will save a lot of time.

Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github <

https://github.com/rmannibucau> |

LinkedIn  | Book
<

https://www.packtpub.com/application-development/java-ee-8-high-performance


Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
 a écrit :


i am trying to use ApplicationComposer to create some tests.  CDI is
scanning the classes correctly but i am a little uncertain about how

to

load a test database.

i was going to start by just loading the database as normal as i

Re: tomee testing

2018-06-22 Thread Romain Manni-Bucau
You can add it in libs property of arquillian container config. Just prefix
the coords with mvn:.

Ex: mvn:mysql:mysql-connector-jav:version

It is a multiline property so you can add N libs to tomee lib this way

Le ven. 22 juin 2018 18:13, Matthew Broadhead
 a écrit :

> INFO: Downloading org.apache.tomee:apache-tomee:7.0.3:zip:plus please
> wait...
>
> i have an arquillian test running up ok but it is complaining
> SEVERE - FATAL ERROR: Unknown error in Assembler.  Please send the
> following stack trace and this message to users@tomee.apache.org :
>   org.apache.xbean.propertyeditor.PropertyEditorException: Unable to
> resolve class com.mysql.jdbc.Driver
>
> is there any way to directly bring in the mysql driver from maven
> central?  or do i need to download manually and put it into
> src/test/tomee/lib?
>
>
> On 22/06/18 10:03, Romain Manni-Bucau wrote:
> > You can theorically but I'd recommand you to write it in the final module
> > instead of trying to use the parent which will be executed before any
> other
> > modules.
> >
> > If A depends on B which depends on C then write your tests in A for the
> > complete app tests and write unit tests in B and C (potentially using
> > arquillian, appcomposer or even other solutions).
> >
> > For reference:
> > http://tomee.apache.org/developer/testing/arquillian/index.html and
> > http://tomee.apache.org/developer/testing/index.html
> >
> > Romain Manni-Bucau
> > @rmannibucau  |  Blog
> >  | Old Blog
> >  | Github <
> https://github.com/rmannibucau> |
> > LinkedIn  | Book
> > <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
> >
> >
> > Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
> >  a écrit :
> >
> >> it sounds like Arquillian might be the best fit in my case.  can the
> >> tests inject CDI beans from the webapps or does everything need to be
> >> done through http?  looking at
> >> https://tomee.apache.org/refcard/refcard.html "Simple Arquilian Test"
> it
> >> looks as if beans can be injected...
> >>
> >> is it possible to create the tests (or at least TomEE instance) in a
> >> parent pom?  i need to run several webapps at once which are all modules
> >> of the parent.  i think code is discouraged in parent project.
> >>
> >>
> >> On 22/06/18 09:18, Romain Manni-Bucau wrote:
> >>> You can set the property openejb.location (or the other ones we have)
> to
> >>> point to an openejb.xml if you want. The advantage of the properties is
> >>> that it is filtered during the test and doesnt require a maven build
> but
> >> it
> >>> is up to you and depends the project setup.
> >>>
> >>> Arquillian is great to test complete application*s* in a real server,
> >>> ApplicationComposer is good to test small parts of applications or
> >>> frameworks, TomEE,
> >>> TomEEEmbeddedSingleRunner is great to test a real app (single
> deployment
> >>> from the classpath + single test setup) and will save a lot of time.
> >>>
> >>> Romain Manni-Bucau
> >>> @rmannibucau  |  Blog
> >>>  | Old Blog
> >>>  | Github <
> >> https://github.com/rmannibucau> |
> >>> LinkedIn  | Book
> >>> <
> >>
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >>>
> >>>
> >>> Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
> >>>  a écrit :
> >>>
>  i am trying to use ApplicationComposer to create some tests.  CDI is
>  scanning the classes correctly but i am a little uncertain about how
> to
>  load a test database.
> 
>  i was going to start by just loading the database as normal as it is a
>  copy of production database.  but how do i specify the username and
>  password or any other properties that are needed to connect to the db?
> 
>  @ContainerProperties(@ContainerProperties.Property(name = "mydb",
> value
>  = "jdbc:mysql://localhost:3306/mydb"))
> 
>  is there a way to specify the resource in an xml file?
> 
>  another question...is it better to start with Arquillian or
>  ApplicationComposer?
> 
> >>
>
>


Re: tomee testing

2018-06-22 Thread Matthew Broadhead
INFO: Downloading org.apache.tomee:apache-tomee:7.0.3:zip:plus please 
wait...


i have an arquillian test running up ok but it is complaining
SEVERE - FATAL ERROR: Unknown error in Assembler.  Please send the 
following stack trace and this message to users@tomee.apache.org :
 org.apache.xbean.propertyeditor.PropertyEditorException: Unable to 
resolve class com.mysql.jdbc.Driver


is there any way to directly bring in the mysql driver from maven 
central?  or do i need to download manually and put it into 
src/test/tomee/lib?



On 22/06/18 10:03, Romain Manni-Bucau wrote:

You can theorically but I'd recommand you to write it in the final module
instead of trying to use the parent which will be executed before any other
modules.

If A depends on B which depends on C then write your tests in A for the
complete app tests and write unit tests in B and C (potentially using
arquillian, appcomposer or even other solutions).

For reference:
http://tomee.apache.org/developer/testing/arquillian/index.html and
http://tomee.apache.org/developer/testing/index.html

Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github  |
LinkedIn  | Book



Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
 a écrit :


it sounds like Arquillian might be the best fit in my case.  can the
tests inject CDI beans from the webapps or does everything need to be
done through http?  looking at
https://tomee.apache.org/refcard/refcard.html "Simple Arquilian Test" it
looks as if beans can be injected...

is it possible to create the tests (or at least TomEE instance) in a
parent pom?  i need to run several webapps at once which are all modules
of the parent.  i think code is discouraged in parent project.


On 22/06/18 09:18, Romain Manni-Bucau wrote:

You can set the property openejb.location (or the other ones we have) to
point to an openejb.xml if you want. The advantage of the properties is
that it is filtered during the test and doesnt require a maven build but

it

is up to you and depends the project setup.

Arquillian is great to test complete application*s* in a real server,
ApplicationComposer is good to test small parts of applications or
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real app (single deployment
from the classpath + single test setup) and will save a lot of time.

Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github <

https://github.com/rmannibucau> |

LinkedIn  | Book
<

https://www.packtpub.com/application-development/java-ee-8-high-performance



Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
 a écrit :


i am trying to use ApplicationComposer to create some tests.  CDI is
scanning the classes correctly but i am a little uncertain about how to
load a test database.

i was going to start by just loading the database as normal as it is a
copy of production database.  but how do i specify the username and
password or any other properties that are needed to connect to the db?

@ContainerProperties(@ContainerProperties.Property(name = "mydb", value
= "jdbc:mysql://localhost:3306/mydb"))

is there a way to specify the resource in an xml file?

another question...is it better to start with Arquillian or
ApplicationComposer?







FailOnUnknowActivationSpec for MessageDriven Bean

2018-06-22 Thread Gropp Volker
Hi,

is it possible to either not deploy MessageDriven Beans at all in openejb or 
turn off FailOnUnknowActivationSpec for all Container/MDB using properties? I 
use openEjb for my container based unit-tests and it fails  to deploy a JMS MDB 
with
messageListenerInterface = MessageListener.class,
activationConfig = {
@ActivationConfigProperty(propertyName="maxSession", propertyValue="1")
 }

I found you can declare it in Properties using 
http://tomee.apache.org/admin/configuration/containers.html
But after adding that I get:
Assembler failed to build the container system.
org.apache.openejb.OpenEJBException: No existing resource adapter defined with 
id 'Default JMS Resource Adapter'.

My original error without trying to set FailOnUnknowActivationSpec to false is:

org.apache.openejb.OpenEjbContainer$AssembleApplicationException: 
org.apache.openejb.OpenEJBException: Creating application failed: C:\test: 
Error deploying 'ListenerMDB'.  Exception: class 
org.apache.openejb.OpenEJBException: Unable to create activation spec: No 
setter found for the activation spec properties: [maxSession]: Unable to create 
activation spec: No setter found for the activation spec properties: 
[maxSession]
 at 
org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:347)
 at 
javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:127)
 at 
de.evelopment.openejb.util.EjbTestHelper.startContainer(EjbTestHelper.java:91)
 at de.evelopment.openejb.EjbTestCase.startUp(EjbTestCase.java:39)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
 at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
 at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
 at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
 at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
 at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
 at org.junit.rules.RunRules.evaluate(RunRules.java:20)
 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
 at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
 at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
 at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
 at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
 at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
 at org.junit.rules.RunRules.evaluate(RunRules.java:20)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
 at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
 at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
 at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
 at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
 at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Caused by: org.apache.openejb.OpenEJBException: Creating application failed: 
C:\test: Error deploying 'ListenerMDB'.  Exception: class 
org.apache.openejb.OpenEJBException: Unable to create activation spec: No 
setter found for the activation spec properties: [maxSession]: Unable to create 
activation spec: No setter found for the activation spec properties: 
[maxSession]
 at 
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1050)
 at 
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:721)
 at 
org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:343)
 ... 33 more
Caused by: org.apache.openejb.OpenEJBException: Error deploying 'ListenerMDB'.  
Exception: class org.apache.openejb.OpenEJBException: Unable to crea

Re: TomEE stderr and stdout

2018-06-22 Thread Romain Manni-Bucau
Hi,

did you try:

export CATALINA_OUT=/tmp/tomee-stdout

?

Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github  |
LinkedIn  | Book



Le ven. 22 juin 2018 à 15:18,  a écrit :

> Hi,
>
>
>
> I am searching for a way to re-enable stdout and stderr logging in TomEE
> 7.0.4.
>
>
>
> The files tomee-stderr and tomee-stdout were created automatically in 1.7
> but now they are gone.
>
>
>
> I need these files because log output that was in tomee-stdout after
> enabling kerberos loggin with –Dsun.security.krb5.debug=true is now nowhere
> to be found L
>
>
>
> How do I “switch on” this old feature?
>
>
>
> Thanks and best
>
> Fabian
>


TomEE stderr and stdout

2018-06-22 Thread fabian-a . richter
Hi,

 

I am searching for a way to re-enable stdout and stderr logging in TomEE 7.0.4.

 

The files tomee-stderr and tomee-stdout were created automatically in 1.7 but 
now they are gone.

 

I need these files because log output that was in tomee-stdout after enabling 
kerberos loggin with –Dsun.security.krb5.debug=true is now nowhere to be found L

 

How do I “switch on” this old feature?

 

Thanks and best

Fabian



smime.p7s
Description: S/MIME Cryptographic Signature


Re: tomee testing

2018-06-22 Thread Andy Gumbrecht
I use a resources.xml with property replacement syntax value:-default

The default values should be the local db, and these can be overridden by
env, -D and properties for prod.

Andy.

On Fri, 22 Jun 2018, 09:03 Matthew Broadhead,
 wrote:

> i am trying to use ApplicationComposer to create some tests.  CDI is
> scanning the classes correctly but i am a little uncertain about how to
> load a test database.
>
> i was going to start by just loading the database as normal as it is a
> copy of production database.  but how do i specify the username and
> password or any other properties that are needed to connect to the db?
>
> @ContainerProperties(@ContainerProperties.Property(name = "mydb", value
> = "jdbc:mysql://localhost:3306/mydb"))
>
> is there a way to specify the resource in an xml file?
>
> another question...is it better to start with Arquillian or
> ApplicationComposer?
>


Re: How to pass keystore password to TomEE for PasswordCipher

2018-06-22 Thread Romain Manni-Bucau
Hi,

you can use an environment var or a system property for that.

Alternatively you can use another resource or service in tomee.xml which is
configured as usual and injected into the datasource (PasswordCipher =
$myCipher or PasswordCipher = @myCipher).

Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github  |
LinkedIn  | Book



Le ven. 22 juin 2018 à 10:48, sudhakarvm  a écrit :

> I have implemented PasswordCipher to encrypt and decrypt the DB password
> using AES algorithm. I want to store my AES key in a keystore or in a
> secured place. If I store in a keystore then I need to pass the keystore
> password. What is the best way to pass the keystore password.
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


How to pass keystore password to TomEE for PasswordCipher

2018-06-22 Thread sudhakarvm
I have implemented PasswordCipher to encrypt and decrypt the DB password
using AES algorithm. I want to store my AES key in a keystore or in a
secured place. If I store in a keystore then I need to pass the keystore
password. What is the best way to pass the keystore password.



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html


Re: tomee testing

2018-06-22 Thread Romain Manni-Bucau
You can theorically but I'd recommand you to write it in the final module
instead of trying to use the parent which will be executed before any other
modules.

If A depends on B which depends on C then write your tests in A for the
complete app tests and write unit tests in B and C (potentially using
arquillian, appcomposer or even other solutions).

For reference:
http://tomee.apache.org/developer/testing/arquillian/index.html and
http://tomee.apache.org/developer/testing/index.html

Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github  |
LinkedIn  | Book



Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
 a écrit :

> it sounds like Arquillian might be the best fit in my case.  can the
> tests inject CDI beans from the webapps or does everything need to be
> done through http?  looking at
> https://tomee.apache.org/refcard/refcard.html "Simple Arquilian Test" it
> looks as if beans can be injected...
>
> is it possible to create the tests (or at least TomEE instance) in a
> parent pom?  i need to run several webapps at once which are all modules
> of the parent.  i think code is discouraged in parent project.
>
>
> On 22/06/18 09:18, Romain Manni-Bucau wrote:
> > You can set the property openejb.location (or the other ones we have) to
> > point to an openejb.xml if you want. The advantage of the properties is
> > that it is filtered during the test and doesnt require a maven build but
> it
> > is up to you and depends the project setup.
> >
> > Arquillian is great to test complete application*s* in a real server,
> > ApplicationComposer is good to test small parts of applications or
> > frameworks, TomEE,
> > TomEEEmbeddedSingleRunner is great to test a real app (single deployment
> > from the classpath + single test setup) and will save a lot of time.
> >
> > Romain Manni-Bucau
> > @rmannibucau  |  Blog
> >  | Old Blog
> >  | Github <
> https://github.com/rmannibucau> |
> > LinkedIn  | Book
> > <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
> >
> >
> > Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
> >  a écrit :
> >
> >> i am trying to use ApplicationComposer to create some tests.  CDI is
> >> scanning the classes correctly but i am a little uncertain about how to
> >> load a test database.
> >>
> >> i was going to start by just loading the database as normal as it is a
> >> copy of production database.  but how do i specify the username and
> >> password or any other properties that are needed to connect to the db?
> >>
> >> @ContainerProperties(@ContainerProperties.Property(name = "mydb", value
> >> = "jdbc:mysql://localhost:3306/mydb"))
> >>
> >> is there a way to specify the resource in an xml file?
> >>
> >> another question...is it better to start with Arquillian or
> >> ApplicationComposer?
> >>
>
>


Re: tomee testing

2018-06-22 Thread Matthew Broadhead
it sounds like Arquillian might be the best fit in my case.  can the 
tests inject CDI beans from the webapps or does everything need to be 
done through http?  looking at 
https://tomee.apache.org/refcard/refcard.html "Simple Arquilian Test" it 
looks as if beans can be injected...


is it possible to create the tests (or at least TomEE instance) in a 
parent pom?  i need to run several webapps at once which are all modules 
of the parent.  i think code is discouraged in parent project.



On 22/06/18 09:18, Romain Manni-Bucau wrote:

You can set the property openejb.location (or the other ones we have) to
point to an openejb.xml if you want. The advantage of the properties is
that it is filtered during the test and doesnt require a maven build but it
is up to you and depends the project setup.

Arquillian is great to test complete application*s* in a real server,
ApplicationComposer is good to test small parts of applications or
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real app (single deployment
from the classpath + single test setup) and will save a lot of time.

Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github  |
LinkedIn  | Book



Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
 a écrit :


i am trying to use ApplicationComposer to create some tests.  CDI is
scanning the classes correctly but i am a little uncertain about how to
load a test database.

i was going to start by just loading the database as normal as it is a
copy of production database.  but how do i specify the username and
password or any other properties that are needed to connect to the db?

@ContainerProperties(@ContainerProperties.Property(name = "mydb", value
= "jdbc:mysql://localhost:3306/mydb"))

is there a way to specify the resource in an xml file?

another question...is it better to start with Arquillian or
ApplicationComposer?





Re: [Newsletter] Re: [Newsletter] Re: [Newsletter] Re: [Newsletter] Re: Missing Guava in TomEE 7.0.4 Plus?

2018-06-22 Thread Romain Manni-Bucau
Feel free to do it and if you want submit a pull request or patch if you
have it.

Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github  |
LinkedIn  | Book



Le ven. 22 juin 2018 à 08:28,  a écrit :

> Should I file a bug report?
>
> -Original Message-
> From: Romain Manni-Bucau 
> Sent: Wednesday, June 20, 2018 3:52 PM
> To: users@tomee.apache.org
> Subject: *EXT* [Newsletter] Re: [Newsletter] Re: [Newsletter] Re:
> [Newsletter] Re: Missing Guava in TomEE 7.0.4 Plus?
>
> you are right, this is a bug. We clearly can't import guava in lib/
> (breaks too much apps) so we need to find a solution for that (potentially
> not importing saml).
>
> Romain Manni-Bucau
> @rmannibucau  |  Blog <
> https://rmannibucau.metawerx.net/> | Old Blog <
> http://rmannibucau.wordpress.com> | Github 
> | LinkedIn  | Book <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
>
>
> Le mer. 20 juin 2018 à 15:16,  a
> écrit :
>
> > I dont understand, java-support-7.1.1.jar (which contains all the
> > shibboleth classes) _IS_ part of the TomEE 7.0.4 Plus package
> >
> > -Original Message-
> > From: Romain Manni-Bucau 
> > Sent: Wednesday, June 20, 2018 3:12 PM
> > To: users@tomee.apache.org
> > Subject: *EXT* [Newsletter] Re: [Newsletter] Re: [Newsletter] Re:
> > Missing Guava in TomEE 7.0.4 Plus?
> >
> > It is not in tomee lib so should be coming from your app or
> > environment :s
> >
> > by leak i meant we don't intend to deliver this lib out of the box
> >
> > Romain Manni-Bucau
> > @rmannibucau  |  Blog <
> > https://rmannibucau.metawerx.net/> | Old Blog <
> > http://rmannibucau.wordpress.com> | Github
> > 
> > | LinkedIn  | Book <
> > https://www.packtpub.com/application-development/java-ee-8-high-perfor
> > mance
> > >
> >
> >
> > Le mer. 20 juin 2018 à 15:06,  a
> > écrit :
> >
> > > What do you mean with "leak"? We do not have it in our webapp, we
> > > only have guava but it is not picked up by the parent classloader :(
> > >
> > > -Original Message-
> > > From: Romain Manni-Bucau 
> > > Sent: Wednesday, June 20, 2018 3:00 PM
> > > To: users@tomee.apache.org
> > > Subject: *EXT* [Newsletter] Re: [Newsletter] Re: Missing Guava in
> > > TomEE
> > > 7.0.4 Plus?
> > >
> > > Hmm if we provide it OOTB that's a "leak" on our side, if you have
> > > it in the webapp just drop it.
> > >
> > > Romain Manni-Bucau
> > > @rmannibucau  |  Blog <
> > > https://rmannibucau.metawerx.net/> | Old Blog <
> > > http://rmannibucau.wordpress.com> | Github
> > > 
> > > | LinkedIn  | Book <
> > > https://www.packtpub.com/application-development/java-ee-8-high-perf
> > > or
> > > mance
> > > >
> > >
> > >
> > > Le mer. 20 juin 2018 à 14:58,  a
> > > écrit :
> > >
> > > > Is there a way to not "import shibboleth"? I am pretty sure we
> > > > don’t need it...
> > > >
> > > > -Original Message-
> > > > From: Romain Manni-Bucau 
> > > > Sent: Wednesday, June 20, 2018 2:49 PM
> > > > To: users@tomee.apache.org
> > > > Subject: *EXT* [Newsletter] Re: Missing Guava in TomEE 7.0.4 Plus?
> > > >
> > > > Hi,
> > > >
> > > > yes and no. We intentionnally drop guava and it works with
> > > > opensaml until you import shibboleth which requires it. At that
> > > > moment you have to either drop opensaml libs from tomee libs or
> > > > add the missing
> > ones.
> > > >
> > > > Romain Manni-Bucau
> > > > @rmannibucau  |  Blog <
> > > > https://rmannibucau.metawerx.net/> | Old Blog <
> > > > http://rmannibucau.wordpress.com> | Github
> > > > 
> > > > | LinkedIn  | Book <
> > > > https://www.packtpub.com/application-development/java-ee-8-high-pe
> > > > rf
> > > > or
> > > > mance
> > > > >
> > > >
> > > >
> > > > Le mer. 20 juin 2018 à 14:46, 
> > > > a écrit :
> > > >
> > > > > Hey,
> > > > >
> > > > >
> > > > >
> > > > > when I try to initialize OpenSAML in TomEE 7.0.4 with
> > > > > InitializationService.initialize(); I get
> > > > >
> > > > >
> > > > >
> > > > > java.lang.ClassNotFoundException:
> > > > > com.google.common.base.Function
> > > > >
> > > > >
> > > > > java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> > > > >
> > > > >
> > > > > java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> > > > >
> > > > >
> > > > > java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> > > > >
> > > > >
> > > > > net.shib

Re: tomee testing

2018-06-22 Thread Romain Manni-Bucau
You can set the property openejb.location (or the other ones we have) to
point to an openejb.xml if you want. The advantage of the properties is
that it is filtered during the test and doesnt require a maven build but it
is up to you and depends the project setup.

Arquillian is great to test complete application*s* in a real server,
ApplicationComposer is good to test small parts of applications or
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real app (single deployment
from the classpath + single test setup) and will save a lot of time.

Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github  |
LinkedIn  | Book



Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
 a écrit :

> i am trying to use ApplicationComposer to create some tests.  CDI is
> scanning the classes correctly but i am a little uncertain about how to
> load a test database.
>
> i was going to start by just loading the database as normal as it is a
> copy of production database.  but how do i specify the username and
> password or any other properties that are needed to connect to the db?
>
> @ContainerProperties(@ContainerProperties.Property(name = "mydb", value
> = "jdbc:mysql://localhost:3306/mydb"))
>
> is there a way to specify the resource in an xml file?
>
> another question...is it better to start with Arquillian or
> ApplicationComposer?
>


tomee testing

2018-06-22 Thread Matthew Broadhead
i am trying to use ApplicationComposer to create some tests.  CDI is 
scanning the classes correctly but i am a little uncertain about how to 
load a test database.


i was going to start by just loading the database as normal as it is a 
copy of production database.  but how do i specify the username and 
password or any other properties that are needed to connect to the db?


@ContainerProperties(@ContainerProperties.Property(name = "mydb", value 
= "jdbc:mysql://localhost:3306/mydb"))


is there a way to specify the resource in an xml file?

another question...is it better to start with Arquillian or 
ApplicationComposer?