Code Monkey home page Code Monkey logo

tomee-buildpack's Introduction

Cloud Foundry TomEE Buildpack

The tomee-buildpack is a Cloud Foundry buildpack for running JVM-based applications. It is designed to run many JVM-based applications (Grails, Groovy, Java Main, Play Framework, Spring Boot, and Java EE Web Profile) with no additional configuration, but supports configuration of the standard components, and extension to add custom components. This buildpack has been customised to use TomEE. The standard Java Buildpack currently uses Tomcat.

Usage

To use this buildpack specify the URI of the repository when pushing an application to Cloud Foundry:

$ cf push <APP-NAME> -p <ARTIFACT> -b https://github.com/cloudfoundry-community/tomee-buildpack.git

Examples

The following are very simple examples for deploying the artifact types that we support.

Configuration and Extension

The buildpack default configuration can be overridden with an environment variable matching the configuration file you wish to override minus the .yml extension and with a prefix of JBP_CONFIG. It is not possible to add new configuration properties and properties with nil or empty values will be ignored by the buildpack (in this case you will have to extend the buildpack, see below). The value of the variable should be valid inline yaml, referred to as "flow style" in the yaml spec (Wikipedia has a good description of this yaml syntax). For example, to change the default version of Java to 11 and adjust the memory heuristics apply this environment variable to the application.

$ cf set-env my-application JBP_CONFIG_OPEN_JDK_JRE '{ jre: { version: 11.+ }, memory_calculator: { stack_threads: 25 } }'

If the key or value contains a special character such as : it should be escaped with double quotes. For example, to change the default repository path for the buildpack.

$ cf set-env my-application JBP_CONFIG_REPOSITORY '{ default_repository_root: "http://repo.example.io" }'

If the key or value contains an environment variable that you want to bind at runtime you need to escape it from your shell. For example, to add command line arguments containing an environment variable to a Java Main application.

$ cf set-env my-application JBP_CONFIG_JAVA_MAIN '{ arguments: "--server.port=9090 --foo=bar" }'

An example of configuration is to specify a javaagent that is packaged within an application.

$ cf set-env my-application JAVA_OPTS '-javaagent:app/META-INF/myagent.jar -Dmyagent.config_file=app/META-INF/my_agent.conf'

Environment variable can also be specified in the applications manifest file. For example, to specify an environment variable in an applications manifest file that disables Auto-reconfiguration.

env:
  JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: '{ enabled: false }'

This final example shows how to change the version of TomEE that is used by the buildpack with an environment variable specified in the applications manifest file.

env:
  JBP_CONFIG_TOMEE: '{ tomee: { version: 1.7.+ } }'

See the Environment Variables documentation for more information.

To learn how to configure various properties of the buildpack, follow the "Configuration" links below.

The buildpack supports extension through the use of Git repository forking. The easiest way to accomplish this is to use GitHub's forking functionality to create a copy of this repository. Make the required extension changes in the copy of the repository. Then specify the URL of the new repository when pushing Cloud Foundry applications. If the modifications are generally applicable to the Cloud Foundry community, please submit a pull request with the changes. More information on extending the buildpack is available here.

Additional Documentation

Building Packages

The buildpack can be packaged up so that it can be uploaded to Cloud Foundry using the cf create-buildpack and cf update-buildpack commands. In order to create these packages, the rake package task is used.

Note that this process is not currently supported on Windows. It is possible it will work, but it is not tested, and no additional functionality has been added to make it work.

Online Package

The online package is a version of the buildpack that is as minimal as possible and is configured to connect to the network for all dependencies. This package is about 50K in size. To create the online package, run:

$ bundle install
$ bundle exec rake clean package
...
Creating build/tomee-buildpack-cfd6b17.zip

Offline Package

The offline package is a version of the buildpack designed to run without access to a network. It packages the latest version of each dependency (as configured in the config/ directory) and disables remote_downloads. This package is about 180M in size. To create the offline package, use the OFFLINE=true argument:

To pin the version of dependencies used by the buildpack to the ones currently resolvable use the PINNED=true argument. This will update the config/ directory to contain exact version of each dependency instead of version ranges.

$ bundle install
$ bundle exec rake clean package OFFLINE=true PINNED=true
...
Creating build/tomee-buildpack-offline-cfd6b17.zip

Package Versioning

Keeping track of different versions of the buildpack can be difficult. To help with this, the rake package task puts a version discriminator in the name of the created package file. The default value for this discriminator is the current Git hash (e.g. cfd6b17). To change the version when creating a package, use the VERSION=<VERSION> argument:

$ bundle install
$ bundle exec rake clean package VERSION=2.1
...
Creating build/tomee-buildpack-2.1.zip

Running Tests

To run the tests, do the following:

$ bundle install
$ bundle exec rake

Running Cloud Foundry locally is useful for privately testing new features.

Contributing

Pull requests are welcome; see the contributor guidelines for details.

License

This buildpack is released under version 2.0 of the Apache License.

tomee-buildpack's People

Contributors

aloismayr avatar arghya88 avatar arthfl avatar bijukunjummen avatar cgfrost avatar chook avatar dmevada avatar dmitri-gb avatar ekcasey avatar fwanggg avatar glyn avatar jandubois avatar jy2697 avatar mayrstefan avatar michele-mancioppi avatar mmanciop avatar mmc2004jp avatar nebhale avatar pavankrish123 avatar prodion23 avatar reshnm avatar sabbey37 avatar seymurfarziyev avatar spring-builds avatar stipx avatar svrc avatar vchrisb avatar violetagg avatar youngm avatar zrob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tomee-buildpack's Issues

Support of Tomee+

Hi,

I want to use JMS within cloud foundry but, of course, it doesn't work with standard tomee. Would it be possible to integrate tomee+ somehow in a fast and easy way?

Best

Creating resources.xml is broken

I think the process of creating the resources.xml may be broken, the properties are being injected with some of the fields being null - only the jdbcUrl appears to be populated, username, scheme, password etc is null.

For eg. consider an application bound to mysql database, the following properties are returned via the resources.xml file:

JtaManaged=true
JdbcDriver=org.mariadb.jdbc.Driver
JdbcUrl=jdbc:mysql://server:3306/instance?user=auser&password=apwed
UserName=null
Password=null
PasswordCipher=PlainText
OpenEJBResourceClasspath=false
TestOnBorrow=true
ValidationQuery=SELECT 1

This leads to an error of the following type:

Caused by: org.mariadb.jdbc.internal.util.dao.QueryException: Could not connect: Access denied for user 'vcap'@'10.254.0.6' (using password: NO)
2017-05-01T18:27:32.28-0700 [APP/PROC/WEB/0] OUT        at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.authentication(AbstractConnectProtocol.java:571)
2017-05-01T18:27:32.28-0700 [APP/PROC/WEB/0] OUT        at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.handleConnectionPhases(AbstractConnectProtocol.java:503)
2017-05-01T18:27:32.28-0700 [APP/PROC/WEB/0] OUT        at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connect(AbstractConnectProtocol.java:382)
2017-05-01T18:27:32.28-0700 [APP/PROC/WEB/0] OUT        at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:839)

This can be traced back to the spring-cloud-connector libraries which sets only the JDBCUrl and not the other fields - https://github.com/spring-cloud/spring-cloud-connectors/blob/master/spring-cloud-cloudfoundry-connector/src/main/java/org/springframework/cloud/cloudfoundry/RelationalServiceInfoCreator.java#L74

Auto-reconfiguration of Resources for TomEE

Problem:
Today configuration of cloud foundry backing services in TomEE is cumbersome. If I want to use postgres, I need to specify the following in my resources.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <!--
    mainly a tomee.xml embed in the application
    (META-INF or WEB-INF)
  -->
  <Resource id="jdbc/DefaultDB" type="DataSource">
      JdbcDriver org.postgresql.Driver
      JdbcUrl = jdbc:postgres://rohit:[email protected]:4980/ilovejets
      UserName rohit
      Password blahblahblah
      JtaManaged true
  </Resource>
</resources>

An the following in my persistence.xml

<jta-data-source>jdbc/DefaultDB</jta-data-source>

Where the URL is the one that I will have when I bind a postgres service and the name of the datasource in resources.xml and persistence.xml must be one and the same.

Solution:
Modifications to the tomee Buildpack that provide facilities for automatically configuring as much of the resources.xml file for tomee as possible in order to remove as much of the busywork from app migration as possible.

The buildpack will perform all of this automatic configuration by interpreting the data it finds in the VCAP_SERVICES environment variable that is configured automatically by Cloud Foundry via either brokered services or user-provided services.

User Story
As a developer I would like to have a mechanism that will automatically configure the tomee server in Cloud Foundry with the bound services.

Implementation Details
This can be achieved with ServiceProvider mechanism in TomEE.

One possible solution would be to carry out all of the automatic configuration work based on user-provided services (often simply called "cups"), with the underlying assumption being that managed brokered services imply a level of green-field preparation that allows application developers to consume the VCAP_SERVICES environment variables directly or through libraries like Spring Boot.

Database Configurations

We are migrating apps from websphere environment to PCF. Currently, the dependent jar in the app uses JNDI lookup to make the database connection. So we choose tomee buildpack to deploy the app in PCF.
Tomee buildpack creates jndi entries in the resources.xml and will read connection details through CUPS created for that app.

Now we trying to set the connection pool details like (maxActive, maxIdle) properties as like websphere. We tried couple of ways to set those configuration, but couldn’t able to read the configuration details through our java code.

  1. configured –Djdbc/jndiname.maxActive=50 through JAVA_OPTS in the manifest.yml.
  2. Tried by adding the maxActive as a parameter while creating the CUPS.

But in both the cases, we getting the max connection as zero in the JAVA code.

• Please share me the steps to configure the connection pool properties?
• Please share me the steps to test the connection pool properties?

jndi resources configuration should look for additional criteria - along with "relational" tag

Tomee resource configuration depends on bound services having a "relational" tag for their entries to be added in as tomee created JNDI resources(resources.xml file). It will be great if additional ways of detecting if a bound service is a relational service is considered.

For eg, if you were to create a User provided relational service it is not possible to add a tag at all and hence no entry is added into the resources.xml file.

Additional criteria could be:

  • Checking for known schema names - mysql, oracle, db2 etc.
  • Checking for jdbc:

TomEE downloaded by buildpack has an incorrect jarsToSkip configuration

Hi

Deploying applications that needs commons-codec I have had the following error:

01T11:33:32.40+0100 [App/0] OUT Caused by: java.lang.ClassNotFoundException: org.apache.commons.codec.binary.Base64
01T11:33:32.40+0100 [App/0] OUT      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
01T11:33:32.40+0100 [App/0] OUT      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
01T11:33:32.40+0100 [App/0] OUT      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
01T11:33:32.40+0100 [App/0] OUT      at java.lang.Class.forName0(Native Method)
01T11:33:32.40+0100 [App/0] OUT      at java.lang.Class.forName(Class.java:348)
01T11:33:32.40+0100 [App/0] OUT      at org.apache.openejb.core.TempClassLoader.loadClass(TempClassLoader.java:152)
01T11:33:32.40+0100 [App/0] OUT      at org.apache.openejb.core.TempClassLoader.loadClass(TempClassLoader.java:83)
01T11:33:32.40+0100 [App/0] OUT      ... 53 more

But I have added the commons-codec in my lib folder. Checking the buildpack logs I have detected that the tomEE located in:

https://java-buildpack.cloudfoundry.org/tomee/tomee-7.0.4.tar.gz

it has (I think) a incorrect configuration in catalina.properties. If you check the property "jarsToSkip" you can check the jars that are provided by tomEE and they are not included in the JarScanner

tomcat.util.scan.StandardJarScanFilter.jarsToSkip=\
bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,\
annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,websocket-api.jar,\
jaspic-api.jar,\
catalina.jar,catalina-ant.jar,catalina-ha.jar,catalina-storeconfig.jar,\
catalina-tribes.jar,\
jasper.jar,jasper-el.jar,ecj-*.jar,\
tomcat-api.jar,tomcat-util.jar,tomcat-util-scan.jar,tomcat-coyote.jar,\
tomcat-dbcp.jar,tomcat-jni.jar,tomcat-websocket.jar,\
tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,\
tomcat-juli-adapters.jar,catalina-jmx-remote.jar,catalina-ws.jar,\
tomcat-jdbc.jar,\
tools.jar,\
commons-beanutils*.jar,commons-codec*.jar,commons-collections*.jar,\
commons-dbcp*.jar,commons-digester*.jar,commons-fileupload*.jar,\
commons-httpclient*.jar,commons-io*.jar,commons-lang*.jar,commons-logging*.jar,\
commons-math*.jar,commons-pool*.jar,\
jstl.jar,taglibs-standard-spec-*.jar,\
geronimo-spec-jaxrpc*.jar,wsdl4j*.jar,\
ant.jar,ant-junit*.jar,aspectj*.jar,jmx.jar,h2*.jar,hibernate*.jar,httpclient*.jar,\
jmx-tools.jar,jta*.jar,log4j*.jar,mail*.jar,slf4j*.jar,\
xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,\
junit.jar,junit-*.jar,hamcrest-*.jar,easymock-*.jar,cglib-*.jar,\
objenesis-*.jar,ant-launcher.jar,\
cobertura-*.jar,asm-*.jar,dom4j-*.jar,icu4j-*.jar,jaxen-*.jar,jdom-*.jar,\
jetty-*.jar,oro-*.jar,servlet-api-*.jar,tagsoup-*.jar,xmlParserAPIs-*.jar,\
xom-*.jar

But if you check the lib of this tomEE the commons-codec (and others) are not included

image

Currently I have had to delete this dependency but our applications that are planning to run on tomEE are hundreds. Maybe I can make a fork of the buildpack to change the tomEE but I would prefer use the official revision.

Thanks in advance.
Manuel.

Tomcat Logging support not working

The following manifest.yml
`

applications:

leads to the following error during startup:
2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR Handler error 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR java.lang.ClassNotFoundException: com.gopivotal.cloudfoundry.tomcat.logging.CloudFoundryConsoleHandler 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at java.net.URLClassLoader.findClass(URLClassLoader.java:382) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at java.lang.ClassLoader.loadClass(ClassLoader.java:418) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at java.lang.ClassLoader.loadClass(ClassLoader.java:351) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:601) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:538) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:336) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at java.util.logging.LogManager$3.run(LogManager.java:399) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at java.util.logging.LogManager$3.run(LogManager.java:396) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at java.security.AccessController.doPrivileged(Native Method) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:396) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at java.util.logging.LogManager.access$800(LogManager.java:145) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at java.util.logging.LogManager$2.run(LogManager.java:345) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at java.security.AccessController.doPrivileged(Native Method) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:338) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at java.util.logging.LogManager.getLogManager(LogManager.java:378) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at java.util.logging.Logger.demandLogger(Logger.java:448) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at java.util.logging.Logger.getLogger(Logger.java:502) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at org.apache.tomee.jul.formatter.log.JULLogger.<init>(JULLogger.java:67) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at org.apache.tomee.jul.formatter.log.ReloadableLog$ReloadableLogHandler.initDelegate(ReloadableLog.java:93) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at org.apache.tomee.jul.formatter.log.ReloadableLog$ReloadableLogHandler.<init>(ReloadableLog.java:54) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at org.apache.tomee.jul.formatter.log.ReloadableLog.newLog(ReloadableLog.java:37) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at org.apache.tomee.jul.formatter.log.TomEELog.<init>(TomEELog.java:79) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:121) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:141) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:196) 2021-03-03T16:35:13.45+0100 [APP/PROC/WEB/0] ERR at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:52)

This happens even though the log states that it downloaded the respective JAR-File:
2021-03-03T17:06:35.01+0100 [STG/0] OUT �[1m�[31m----->�[0m�[22m Downloading �[1m�[34mTomcat Logging Support�[0m�[22m �[34m2.5.0_RELEASE�[0m from https://java-buildpack.cloudfoundry.org/tomcat-logging-support/tomcat-logging-support-2.5.0_RELEASE.jar �[3m�[32m(0.0s)�[0m�[23m

Looking into the tomcat/libs folder on the server, the tomcat-logging-support-2.5.0_RELEASE.jar is missing. I guess this should be included there by the buildpack? Any ideas how I get the logging working?

AopInvocationException when connecting to IBM MQ from an EAR application when deployed on CloudFoundry

Hi,

we are integrating our EAR application with an IBM MQ Broker and when we send a message we obtain de following error:

2018-04-04T22:49:16.41+0200 [App/0] ERR org.springframework.aop.AopInvocationException: AOP configuration seems to be invalid: tried calling method [public abstract javax.jms.Connection javax.jms.ConnectionFactory.createConnection() throws javax.jms.JMSException] on target [com.ibm.mq.connector.outbound.ConnectionFactoryImpl@7dce618e]; nested exception is java.lang.IllegalArgumentException: object is not an instance of declaring class 2018-04-04T22:49:16.41+0200 [App/0] ERR at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:325) 2018-04-04T22:49:16.41+0200 [App/0] ERR at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:201) 2018-04-04T22:49:16.41+0200 [App/0] ERR at com.sun.proxy.$Proxy66.createConnection(Unknown Source) 2018-04-04T22:49:16.41+0200 [App/0] ERR at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:180) 2018-04-04T22:49:16.41+0200 [App/0] ERR at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:484) 2018-04-04T22:49:16.41+0200 [App/0] ERR at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:580) 2018-04-04T22:49:16.41+0200 [App/0] ERR at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:706) 2018-04-04T22:49:16.41+0200 [App/0] ERR at internal.JournalWriterImpl.sendMessage(JournalWriterImpl.java:40) 2018-04-04T22:49:16.41+0200 [App/0] ERR at internal.JournalBusinessWriterImpl.sendMessage(JournalBusinessWriterImpl.java:75) 2018-04-04T22:49:16.41+0200 [App/0] ERR at internal.JournalRecordAdapterBusinessImpl.writeData(JournalRecordAdapterBusinessImpl.java:132) 2018-04-04T22:49:16.41+0200 [App/0] ERR at internal.JournalRecordAdapterBusinessImpl.writeReceive(JournalRecordAdapterBusinessImpl.java:73) 2018-04-04T22:49:16.41+0200 [App/0] ERR at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2018-04-04T22:49:16.41+0200 [App/0] ERR at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 2018-04-04T22:49:16.41+0200 [App/0] ERR at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2018-04-04T22:49:16.41+0200 [App/0] ERR at java.lang.reflect.Method.invoke(Method.java:606) 2018-04-04T22:49:16.41+0200 [App/0] ERR at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222) 2018-04-04T22:49:16.41+0200 [App/0] ERR at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) 2018-04-04T22:49:16.41+0200 [App/0] ERR at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) 2018-04-04T22:49:16.41+0200 [App/0] ERR at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:775) 2018-04-04T22:49:16.41+0200 [App/0] ERR at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705) 2018-04-04T22:49:16.41+0200 [App/0] ERR at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) 2018-04-04T22:49:16.41+0200 [App/0] ERR at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) 2018-04-04T22:49:16.41+0200 [App/0] ERR at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) 2018-04-04T22:49:16.41+0200 [App/0] ERR at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:965) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:867) 2018-04-04T22:49:16.42+0200 [App/0] ERR at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:841) 2018-04-04T22:49:16.42+0200 [App/0] ERR at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.cloudfoundry.router.ClientCertificateMapper.doFilter(ClientCertificateMapper.java:77) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.tomee.catalina.OpenEJBSecurityListener$RequestCapturer.invoke(OpenEJBSecurityListener.java:97) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:677) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1457) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) 2018-04-04T22:49:16.42+0200 [App/0] ERR at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 2018-04-04T22:49:16.42+0200 [App/0] ERR at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) 2018-04-04T22:49:16.42+0200 [App/0] ERR at java.lang.Thread.run(Thread.java:745) 2018-04-04T22:49:16.42+0200 [App/0] ERR Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class 2018-04-04T22:49:16.42+0200 [App/0] ERR at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2018-04-04T22:49:16.42+0200 [App/0] ERR at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 2018-04-04T22:49:16.42+0200 [App/0] ERR at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2018-04-04T22:49:16.42+0200 [App/0] ERR at java.lang.reflect.Method.invoke(Method.java:606) 2018-04-04T22:49:16.42+0200 [App/0] ERR at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) 2018-04-04T22:49:16.42+0200 [App/0] ERR ... 60 more

This problem only occurs when we use the TomEE Buildpack deployed on CloudFoundry. If you deploy the same EAR in a TomEE running locally, the message is sent correctly.

We are using (locally and in CloudFoundry) the Tomee-7.0.4 buildpack (https://java-buildpack.cloudfoundry.org/tomee/tomee-7.0.4.tar.gz).

Our deployed EAR has the following structure:

MyApp.ear
| META-INF
| | application.xml
| | resource.xml
| drivers
| | com.ibm.*.jar (when we deploy this ear locally, jars in this folder are copied in tomme/lib manually)
| MyApp.war

MQ resources (Resource adapter, Connection factory and Queue) are defined in the resource.xml file.

Is there any differences between a "local" TomEE and a TomEE deployed in CloudFoundry that could generate this problem?

Thanks.

Generic Loading of Resources

The current implementation allows for the loading of JDBC resources based on the contents of the bound services. It would be nice if we could generically create resources using the property lists features, so that if we had a bound service like

    "credentials": {
     "class-name": "org.cloudfoundry.test.MyType",
     "id": "someId",
     "includeInResources": "true",
     "name1": "val1",
     "name2": "val2"
    },
    "label": "user-provided",
    "name": "my-test-resource",
    "syslog_drain_url": "",
    "tags": [],
    "volume_mounts": []
   }

it could create a resource like

<Resource class-name='org.cloudfoundry.test.MyType' id='someId'>
  name1 = val1
  name2 = val2
</Resource>

This has the advantage of allowing customers to use non-JDBC resources as well as custom resources.

Pretty formatting potential issues

If I am using the tomee buildpack in a chain with another buildpack (multi-buildpack pattern), the tomee buildpack must be last in the chain as it lacks a supply script.

Suppose that other buildpack (https://github.com/tom-collings/simple-buildpack as an example) automatically creates resources based on bound services and produces a Resource node as follows:

<Resource class-name='org.cloudfoundry.test.MyType' id='someId'>
  name1 = val1
  name2 = val2
</Resource>

`
The whitespace in the property values (name1, name2) is very important to tomee. While the sample buildpack uses the REXML:Formatter:Transitive formatter (which respects whitespace) to write the file, the tomee buildpack uses the REXML:Formatter:Pretty formatter (which does not respect whitespace) which removes the necessary whitespace and results in a Resource node like:

<Resource class-name='org.cloudfoundry.test.MyType' id='someId'>name1 = val1 name2 = val2</Resource>

As the tomee buildpack is last in the multi-buildpack chain, this final Pretty format is the one that is used for the final form of the resources.xml file.

Which prevents the proper loading of the resource.

Spring Auto Reconfiguration is not operational when deploying EAR

When Spring Auto Reconfiguration is enabled and there is spring-core*.jar artifacts [1]
in the application binaries, a modification of web.xml provided by web module will be made
and Spring Auto Reconfiguration jar file will be added to the additional libraries [2].

When the deployment artifact is WAR file the collection of the additional libraries will be added
to WEB-INF/lib [3]. Thus Spring Auto Reconfiguration will be able to load classes provided by spring-core*.jar.

In case of EAR the additional libraries will be added to <TomEE-Home>/lib [3]. Thus
Spring Auto Reconfiguration will not be able to load the classes provided by spring-core*.jar
because they are provided by the application binaries and not by TomEE installation.

The exception below will appear:

   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextInitializer
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at java.lang.ClassLoader.defineClass1(Native Method)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at java.security.AccessController.doPrivileged(Native Method)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at org.apache.openejb.core.TempClassLoader.loadClass(TempClassLoader.java:225)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at org.apache.openejb.core.TempClassLoader.loadClass(TempClassLoader.java:83)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at org.cloudfoundry.reconfiguration.spring.AutoReconfigurationServletContainerInitializer.<clinit>(AutoReconfigurationServletContainerInitializer.java:33)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at java.lang.Class.forName0(Native Method)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at java.lang.Class.forName(Class.java:348)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:188)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:159)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1622)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at org.apache.catalina.startup.OpenEJBContextConfig.processServletContainerInitializers(OpenEJBContextConfig.java:479)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1135)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at org.apache.catalina.startup.OpenEJBContextConfig.webConfig(OpenEJBContextConfig.java:402)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:775)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at org.apache.catalina.startup.OpenEJBContextConfig.configureStart(OpenEJBContextConfig.java:123)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5087)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	... 23 more
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContextInitializer
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
   2017-08-10T14:37:48.66-0400 [APP/PROC/WEB/0] OUT 	... 52 more

[1] https://github.com/cloudfoundry-community/tomee-buildpack/blob/master/lib/java_buildpack/framework/spring_auto_reconfiguration.rb#L53
[2] https://github.com/cloudfoundry-community/tomee-buildpack/blob/master/lib/java_buildpack/framework/spring_auto_reconfiguration.rb#L39
[3] https://github.com/cloudfoundry-community/tomee-buildpack/blob/master/lib/java_buildpack/container/tomee/tomee_instance.rb#L62

Getting an error when building offline tomee buildpack

I'm trying to build the latest tomee offline buildpack (https://github.com/cloudfoundry-community/tomee-buildpack/archive/refs/tags/v4.34.zip) and got the following error:

deployment-vm/6bbd056e-73e7-40ea-adb1-acd7fd16e39d:~/workspace/buildpacks/tomee-buildpack-4.34$ bundle exec rake clean package OFFLINE=true PINNED=true
Pinning groovy version to 2.5.9
Pinning spring_boot_cli version to 2.3.5_RELEASE
Pinning tomee version to 7.0.5
Pinning lifecycle_support version to 2.5.0_RELEASE
Pinning logging_support version to 2.5.0_RELEASE
Pinning access_logging_support version to 2.5.0_RELEASE
Pinning resource_configuration version to 1.5.0_RELEASE
Pinning redis_store version to 1.3.6_RELEASE
Pinning jre version to 11.0.12_7
Pinning jre version to 14.0.2_13
Pinning jre version to 1.8.0_275
Pinning jvmkill_agent version to 1.16.0_RELEASE
Pinning memory_calculator version to 3.13.0_RELEASE
Pinning app_dynamics_agent version to 20.10.0_31173
[VersionResolver] WARN Discarding illegal version 2.4.0-BETA: Invalid micro version '0-BETA'
Pinning azure_application_insights_agent version to 2.6.2
Pinning client_certificate_mapper version to 1.11.0_RELEASE
Pinning container_customizer version to 2.6.0_RELEASE
Pinning container_security_provider version to 1.18.0_RELEASE
Pinning contrast_security_agent version to 3.7.10_17525
Pinning dynatrace_appmon_agent version to 7.1.0_1803
Pinning elastic_apm_agent version to 1.18.1
Pinning google_stackdriver_debugger version to 2.26.0
Pinning google_stackdriver_profiler version to 0.1.0
[DownloadCache] WARN Request failure 1, retrying after 5s. Failure: 403 Forbidden
Forbidden!
[DownloadCache] WARN Request failure 2, retrying after 10s. Failure: 403 Forbidden
Forbidden!
[DownloadCache] WARN Request failure 3, retrying after 20s. Failure: 403 Forbidden
Forbidden!
[DownloadCache] WARN Request failure 4, retrying after 40s. Failure: 403 Forbidden
Forbidden!
[DownloadCache] WARN Request failure 5, retrying after 60s. Failure: 403 Forbidden
Forbidden!
[InternetAvailability] WARN Internet availability set to false: Request failed: 403 Forbidden
Forbidden!
[DownloadCache] WARN Unable to download https://ca.bintray.com/apm-agents/index.yml into cache build/staging/resources/cache: 403 Forbidden
Forbidden!
rake aborted!
Unable to find cached file for https://ca.bintray.com/apm-agents/index.yml
/var/vcap/store/deployment-vm/home/ptran/workspace/buildpacks/tomee-buildpack-4.34/lib/java_buildpack/util/cache/download_cache.rb:79:in get' /var/vcap/store/deployment-vm/home/ptran/workspace/buildpacks/tomee-buildpack-4.34/rakelib/dependency_cache_task.rb:183:in get_from_cache'
/var/vcap/store/deployment-vm/home/ptran/workspace/buildpacks/tomee-buildpack-4.34/rakelib/dependency_cache_task.rb:175:in block (2 levels) in uris' /var/vcap/store/deployment-vm/home/ptran/workspace/buildpacks/tomee-buildpack-4.34/rakelib/dependency_cache_task.rb:173:in each'
/var/vcap/store/deployment-vm/home/ptran/workspace/buildpacks/tomee-buildpack-4.34/rakelib/dependency_cache_task.rb:173:in block in uris' /var/vcap/store/deployment-vm/home/ptran/workspace/buildpacks/tomee-buildpack-4.34/rakelib/dependency_cache_task.rb:172:in each'
/var/vcap/store/deployment-vm/home/ptran/workspace/buildpacks/tomee-buildpack-4.34/rakelib/dependency_cache_task.rb:172:in uris' /var/vcap/store/deployment-vm/home/ptran/workspace/buildpacks/tomee-buildpack-4.34/rakelib/dependency_cache_task.rb:46:in initialize'
/var/vcap/store/deployment-vm/home/ptran/workspace/buildpacks/tomee-buildpack-4.34/Rakefile:42:in new' /var/vcap/store/deployment-vm/home/ptran/workspace/buildpacks/tomee-buildpack-4.34/Rakefile:42:in <top (required)>'
/home/ptran/.rbenv/versions/2.5.8/bin/bundle:23:in load' /home/ptran/.rbenv/versions/2.5.8/bin/bundle:23:in

'
(See full trace by running task with --trace)

It looked like the build process (package task) was trying to download a package index (https://ca.bintray.com/apm-agents/index.yml?) and got 403 forbidden error.

Any idea what could be wrong and how can we fix this issue?

Unable to Read JNDI value from Birt report

I am working on migrating Websphere application in to cloud foundry using tomee buildpack. In Websphere, the birt report read the JNDI data source to generate the report.
Similarly, i added the JNDI entries in the resources.xml file and added the resource ref entries in the web.xml file. The birt report unable to read the JNDI entry and throwing exception in tomee buildpack.
Do i need to add any additional configuration for birt report?

Using Oracle Service provided by CUPS does not work properly with only jdbcUrl

Hi,

I have defined a CUPS for accessing to a oracle database and the driver is not loaded/detected when the application (EAR with different WARs) starts.

To define my cups I have tried few combinations by anyone works properly

  1. Defining with all the params: cf cups ARQRUNDataSource -p "hostname,port,name, username,password"

It generates the following VCAP_SERVICES

 "VCAP_SERVICES": {
  "user-provided": [
   {
    "credentials": {
     "hostname": "<domain>",
     "name": "<servicename>",
     "password": "<password>",
     "port": "<port>",
     "username": "<username>"
    },
    "label": "user-provided",
    "name": "ARQRUNDataSource",
    "syslog_drain_url": "",
    "tags": []
   }
  ]
 }
}
  1. Using URI param: cf cups ARQRUNDataSource -p {"uri"}

Where the URI has the following value:
oracle://<username>:<password>@<host>:<port>/<serviceName>

It generates the following VCAP_SERVICES

"VCAP_SERVICES": {
 "user-provided": [
  {
   "credentials": {
    "uri": "oracle://<username>:<password>@<hostname>:<port>/<servicename>"
   },
   "label": "user-provided",
   "name": "ARQRUNDataSource",
   "syslog_drain_url": "",
   "tags": []
  }
 ]
}

I have followed for example the following references:

Deliver Service Credentials to an Application
Binding Credentials

When the application starts I can see the following logs about HSQLDB:

  2018-02-22T16:26:37.82+0100 [App/0] OUT [CONTAINER] OpenEJB.startup.config                             INFO    Configuring Service(id=Default JDBC Database, type=Resource, provider-id=De
atabase)
  2018-02-22T16:26:37.82+0100 [App/0] OUT [CONTAINER] OpenEJB.startup.config                             INFO    Auto-creating a Resource with id 'Default JDBC Database' of type 'javax.sql
for 'WebApp_ID.Comp1361995231'.
  2018-02-22T16:26:37.83+0100 [App/0] OUT [CONTAINER] OpenEJB.startup.service                            INFO    Creating Resource(id=Default JDBC Database)
  2018-02-22T16:26:38.17+0100 [App/0] OUT [CONTAINER] hsqldb.db.HSQLDB61BE1F9C4E.ENGINE                  INFO    Checkpoint start
  2018-02-22T16:26:38.17+0100 [App/0] OUT [CONTAINER] hsqldb.db.HSQLDB61BE1F9C4E.ENGINE                  INFO    checkpointClose start
  2018-02-22T16:26:38.19+0100 [App/0] OUT [CONTAINER] hsqldb.db.HSQLDB61BE1F9C4E.ENGINE                  INFO    checkpointClose end
  2018-02-22T16:26:38.19+0100 [App/0] OUT [CONTAINER] hsqldb.db.HSQLDB61BE1F9C4E.ENGINE                  INFO    Checkpoint end - txts: 1
  2018-02-22T16:26:38.21+0100 [App/0] OUT [CONTAINER] OpenEJB.startup.config                             INFO    Auto-linking resource-ref 'jdbc/ARQRUNDataSource' in bean WebApp_ID.Comp136
esource(id=Default JDBC Database)

As you can see it links with HSQLDB instead use my oracle driver, I don't know why. How can "force" the driver class name by cups?

My EAR is like these logs

EAR
   |__drivers
   |_____ojdbc6.jar
   |__META-INF
   |_____application.xml
   |__application1.war

Feature Request: TomEE buildpack needs to support the deployment of ear files

A number of existing JavaEE enterprise applications are packaged as ear files. In order to replatform these applications using the TomEE buildpack onto Cloud Foundry the TomEE buildpack needs to support the cf push of ear files.

Underlying runtime TomEE itself supports the deployment of ear files. See http://tomee.apache.org/deploying-in-tomee.html

There is no reason we should force developers to repackage their apps as war files in order to run on TomEE in CloudFoundry

Failure to stage embeddable standalone ejbcontainer jar

tomee buildpack fails to stage apps with embeddable EJB Container

Steps to recreate the issue

  1. svn co http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/simple-singleton
  2. cd simple-singleton
  3. mvn clean install
  4. cf push simple-singleton -p target/simple-singleton-1.1.0-SNAPSHOT.jar -b https://github.com/cloudfoundry-community/tomee-buildpack.git

Staging Output:

Creating app simple-singleton in org EVP / space pse-staging as rkelapure@pivotal.io...
OK

Using route simple-singleton.cfapps.io
Binding simple-singleton.cfapps.io to simple-singleton...
OK

Uploading simple-singleton...
Uploading app files from: target/simple-singleton-1.1.0-SNAPSHOT.jar
Uploading 8.5K, 12 files
Done uploading               
OK

Starting app simple-singleton in org EVP / space pse-staging as rkelapure@pivotal.io...
Creating container
Successfully created container
Downloading app package...
Downloaded app package (5.2K)
Downloading buildpacks (https://github.com/cloudfoundry-community/tomee-buildpack.git)...
Downloaded buildpacks
Staging...
[Buildpack]                      ERROR Compile failed with exception #<RuntimeError: No container can run this application. Please ensure that youve pushed a valid JVM artifact or artifacts using the -p command line argument or path manifest entry. Information about valid JVM artifacts can be found at https://github.com/cloudfoundry/java-buildpack#additional-documentation. >
No container can run this application. Please ensure that youve pushed a valid JVM artifact or artifacts using the -p command line argument or path manifest entry. Information about valid JVM artifacts can be found at https://github.com/cloudfoundry/java-buildpack#additional-documentation. 
-----> Java Buildpack Version: b716fbb | https://github.com/cloudfoundry-community/tomee-buildpack.git#b716fbb
Failed to compile droplet
Exit status 223
Staging failed: Exited with status 223

FAILED
BuildpackCompileFailed

EAR failing to start when deployed on PCFDev

When deploying an EAR file to a local PCFDev instance with the tomee-buildpack, the application fails to start with an exception, ClassNotFoundException, for the org.apache.activemq.ra.ActiveMQResourceAdapter class, although the class is included in the EAR. Specifically, the class is included as a dependency in the WAR, since the error appears to be originating from the WAR. Has anyone seen anything like this when deploying an EAR to cloud foundry using the tomee-buildpack? The ear includes multiple EJBs and a WAR.

We were able to add the dependency to the tomee-buildpack by configuring the manifest.yml file to use the tomee-plus distribution, which includes the missing libraries.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.