Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • mabboud
    started a topic Apache TomEE 1.7.3 server.properties configurations

    Apache TomEE 1.7.3 server.properties configurations

    server.properties:
    Code:
    webRoot: C:/apache-tomee-plus-1.7.3/webapps/ROOT/
    
    project.datasources: $webRoot/shared/ds
    project.ui: $webRoot/shared/ui
    project.apps: $webRoot/shared/app
    
    sql.defaultDS.driver.name: java:openejb/Resource/jdbc/DefaultDS
    sql.defaultDS.database.type: sqlserver
    sql.defaultDS.interface.type: jndi
    File Structure:
    Code:
    ROOT
    C:\apache-tomee-plus-1.7.3\
    
    WAR LOCATION
    C:\apache-tomee-plus-1.7.3\apps\alliance.ear\crm2.war
    
    WEB ROOT LOCATION
    C:\apache-tomee-plus-1.7.3\webapps\ROOT
    I am having Trouble with setting couple of issues setting up the WEB-INF/classes/server.properties :

    1. first issue webRoot setting it cannot auto detect the webRoot only way i can get it to work is to set it up with the Absolute Path which is not what i want it to do .. is there a way to configure a relative path since this will be installed differently in production . right now the war files is placed under the C:\apache-tomee-plus-1.7.3\apps\alliance.ear\ folder and root is in different location \webapps\ROOT as you can see from the previous file structure so i had to get it using the absolute path

    2. Second issue is using the JNDI configuration for SQL server :
    right now the my context for the jndi is " openejb:Resource/jdbc/DefaultDS " but thats giving me an warning and error
    we have been using this context in out existing application without any issues or problem where it did deploy correctly and allows to connect


    here is my Tomee.xml for the JNDI configuration
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <tomee>
        <!-- see http://tomee.apache.org/containers-and-resources.html -->
        <Resource id="jdbc/DefaultDS" type="DataSource">
            JdbcDriver com.microsoft.sqlserver.jdbc.SQLServerDriver
            JdbcUrl jdbc:sqlserver://localhost;selectMethod=direct;DatabaseName=myDB
            UserName user
            Password pass
            JtaManaged true
        </Resource>
    
        <!-- activate next line to be able to deploy applications in apps -->
        <Deployments dir="apps" />
    </tomee>
    added this to my web.xml :
    Code:
        <resource-ref>
            <res-ref-name>jdbc/DefaultDS</res-ref-name>
            <res-type>java:openejb/Resource/jdbc/DefaultDS</res-type>
            <res-auth>Container</res-auth>
        </resource-ref>
    here are the warnings and errors
    Code:
    11-28 11:27:30 [WARNING] Failed to create MBean for naming resource [jdbc/DefaultDS]
    javax.management.MalformedObjectNameException: Invalid character ':' in value part of property
        at javax.management.ObjectName.construct(ObjectName.java:618)
        at javax.management.ObjectName.<init>(ObjectName.java:1382)
        at org.apache.catalina.mbeans.MBeanUtils.createObjectName(MBeanUtils.java:578)
        at org.apache.catalina.mbeans.MBeanUtils.createMBean(MBeanUtils.java:181)
        at org.apache.catalina.deploy.NamingResources.addResource(NamingResources.java:378)
        at org.apache.tomee.catalina.OpenEJBNamingResource.addResource(OpenEJBNamingResource.java:102)
        at org.apache.tomee.catalina.TomcatJndiBuilder.mergeRef(TomcatJndiBuilder.java:653)
        at org.apache.tomee.catalina.TomcatJndiBuilder.mergeJndi(TomcatJndiBuilder.java:139)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1338)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1100)
        at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:130)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5419)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    
    11-28 11:27:33 [SEVERE] Error merging Java EE JNDI entries in to war /crm2: Exception: Unable to load type 'java:openejb/Resource/jdbc/DefaultDS' for comp/env/jdbc/DefaultDS
    org.apache.openejb.OpenEJBException: Unable to load type 'java:openejb/Resource/jdbc/DefaultDS' for comp/env/jdbc/DefaultDS
        at org.apache.openejb.assembler.classic.JndiEncBuilder.getType(JndiEncBuilder.java:617)
        at org.apache.openejb.assembler.classic.JndiEncBuilder.buildMap(JndiEncBuilder.java:291)
        at org.apache.openejb.assembler.classic.JndiEncBuilder.buildBindings(JndiEncBuilder.java:173)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1387)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1100)
        at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:130)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5419)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    Any help would be appreciated with configuring Apache Tomee

  • Isomorphic
    replied
    What is the purpose of having multiple web apps share these directories? The key thing to understand is that you should not be running different versions of the client and server, so with your approach where e.g. isomorphic/ is "shared", when you upgrade to a new version of SmartClient or SmartGWT, you would need to redeploy both the ROOT app that contains isomorphic/ (for the client-side) and simultaneously ALL the apps that use it.

    If this is the outcome you want, why have separate apps at all?

    Leave a comment:


  • mabboud
    replied
    it did not work setting it to
    Code:
    webRoot: __AUTODETECT__/../../../webapps/ROOT
    looks like the Token has to be alone for the auto detect to work cant be embedded inside of a relative path

    Code:
     
    
    Isomorphic Init: Exception in Init.go()
    java.lang.Exception: Configured webRoot path is invalid please check your server.properties setting.  Current value is:
    __AUTODETECT__/../../../webapps/ROOT
            at com.isomorphic.base.ISCInit.go(ISCInit.java:118)
            at com.isomorphic.base.InitListener.contextInitialized(InitListener.java:92)
            at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5017)
            at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5531)
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
            at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
            at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
    Isomorphic Init: Exception in Init.go()
    java.lang.Exception: Configured webRoot path is invalid please check your server.properties setting.  Current value is:
    __AUTODETECT__/../../../webapps/ROOT
            at com.isomorphic.base.ISCInit.go(ISCInit.java:118)
            at com.isomorphic.base.Init.go(Init.java:92)
            at com.isomorphic.base.Init.go(Init.java:97)
            at com.isomorphic.base.Init.init(Init.java:105)
            at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
            at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
            at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
            at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5267)
            at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5557)
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
            at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
            at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
    Isomorphic Init: Exception in Init.go()
    java.lang.Exception: Configured webRoot path is invalid please check your server.properties setting.  Current value is:
    __AUTODETECT__/../../../webapps/ROOT
            at com.isomorphic.base.ISCInit.go(ISCInit.java:118)
            at com.isomorphic.base.Init.go(Init.java:92)
            at com.isomorphic.servlet.BaseServlet.init(BaseServlet.java:141)
            at com.isomorphic.servlet.PreCache.init(PreCache.java:76)
            at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
            at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
            at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
            at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5267)
            at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5557)
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
            at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
            at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
    Isomorphic Init: Exception in Init.go()
    java.lang.Exception: Configured webRoot path is invalid please check your server.properties setting.  Current value is:
    __AUTODETECT__/../../../webapps/ROOT
            at com.isomorphic.base.ISCInit.go(ISCInit.java:118)
            at com.isomorphic.base.Base.<clinit>(Base.java:52)
            at com.isomorphic.servlet.BaseServlet.init(BaseServlet.java:151)
            at com.isomorphic.servlet.PreCache.init(PreCache.java:76)
            at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
            at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
            at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
            at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5267)
            at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5557)
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
            at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
            at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
    12-07 12:28:59 [INFO] Isomorphic PreCache servlet loading
    Problem loading builtinTypes.xml
    Exception when loading from __AUTODETECT__/../../../webapps/ROOT/isomorphic/system/schema/builtinTypes.xml:
    java.io.FileNotFoundException: __AUTODETECT__\..\..\..\webapps\ROOT\__AUTODETECT__\..\..\..\webapps\ROOT\isomorphic\syst
    em\schema\builtinTypes.xml (The system cannot find the path specified)
            at java.io.FileInputStream.open0(Native Method)
            at java.io.FileInputStream.open(FileInputStream.java:195)
            at java.io.FileInputStream.<init>(FileInputStream.java:138)
            at com.isomorphic.io.file.ISCNativeFile.getInputStream(ISCNativeFile.java:159)
            at com.isomorphic.xml.XML$DocumentCache.loadObjectFromFile(XML.java:414)
            at com.isomorphic.store.ProcessedFileCache.getObjectFromFile(ProcessedFileCache.java:147)
            at com.isomorphic.xml.XML.getXMLDocument(XML.java:434)
            at com.isomorphic.xml.XML.toDSRecords(XML.java:442)
            at com.isomorphic.xml.XML.toDSRecords(XML.java:446)
            at com.isomorphic.xml.XML.toDSRecords(XML.java:451)
            at com.isomorphic.datasource.DataSource.<clinit>(DataSource.java:1110)
            at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:168)
            at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:121)
            at com.isomorphic.servlet.PreCache.preLoadDataSources(PreCache.java:142)
            at com.isomorphic.servlet.PreCache.init(PreCache.java:89)
            at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
            at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
            at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
            at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5267)
            at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5557)
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
            at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
            at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)

    Leave a comment:


  • Isomorphic
    replied
    In theory yes. But in practice, it will be interpreted as relative to the cwd at the point the jvm that boostraps the app server. Note also that the jvm itself (or a possible wrapper script that invokes it on the end user's machine) or the app server bootstrap logic could change the cwd before our init block runs.

    If you really know what you're doing, and you'd like to strike out on your own, without further support from us, you can attempt to set the webRoot value to use autodetect mode with a relative path like so:

    Code:
    webRoot: __AUTODETECT__/../../foo/bar
    This hasn't been tested at all and so may or may not work. It also may or may not work in any given container or configuration. You're totally on your own here. Hope this helps.

    Leave a comment:


  • mabboud
    replied
    is there any way to use Relative Path in the webRoot server.properties ?

    Leave a comment:


  • Isomorphic
    replied
    That is highly inadvisable. Although in advanced, very specific configurations you could theoretically have a shared location like this, it's really easy to run into trouble. First of all, doing this will require you to specify an explicit webRoot in server.properties - which is what you're trying to avoid doing (for good reason). There's no way for us to get outside of the deployment directory and figure out automatically that you've moved the isomorphic/ dir. And some containers would preclude filesystem access outside the deployment dir.

    Furthermore, both client and server need to see the contents of both isomorphic/ and shared/ (the datasources contained in both of these dirs are used by both the client and server) and in almost every case, every app has its own copies of these and they shouldn't be shared between apps. Apps may also use different versions of SmartClient/SmartGWT and sharing these would cause really obscure gotcha bugs.

    Bottom line is: don't do this. The only thing you're saving is disk space, and not very much at that.

    Leave a comment:


  • mabboud
    replied
    I did that setup. i copied the isomorphic and shared folders to the webapps/ROOT
    cause i would like the other wars in the EAR using the same isomorphic folder and shared folder

    Leave a comment:


  • Isomorphic
    replied
    I'm using 1.7.4 - so slightly different, but I can't imagine it accounts for this delta. I'm trying to understand how the isomorphic/ and shared/ folders are ending up in webapps/ROOT (which is what you said was happening in post #10)

    Leave a comment:


  • mabboud
    replied
    That is the default WEB application development i dont see where my CRM2.war is deploying in the webapps/Root folder ?
    what version of TomEE are u using in your test environment ? would u like me to setup a quick tomee configuration and send it your way ?

    Leave a comment:


  • Isomorphic
    replied
    Ok, so what is causing the webapps/ROOT deployment?

    Leave a comment:


  • mabboud
    replied
    if you look closely to the Log attached it clearly exploding the crm2.war into the EAR folder
    Code:
    11-28 13:23:03 [INFO] Configuring Service(id=jdbc/DefaultDS, type=Resource, provider-id=Default JDBC Database)
    11-28 13:23:03 [INFO] Extracting jar: C:\apache-tomee-plus-1.7.3\apps\alliance.ear\crm2.war
    11-28 13:23:03 [INFO] Extracted path: C:\apache-tomee-plus-1.7.3\apps\alliance.ear\crm2
    its doing the same as u described which extracting the war into the EAR .. and not Exploding into webapps folder

    webapps/ROOT\ folder only contains isomorphic and shared folders.

    no other wars installed in the webapps/ROOT folder

    Leave a comment:


  • mabboud
    replied
    C:\apache-tomee-plus-1.7.3\conf\tomee.xml

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <tomee>
        <!-- see http://tomee.apache.org/containers-and-resources.html -->
        <Resource id="jdbc/DefaultDS" type="DataSource">
            JdbcDriver com.microsoft.sqlserver.jdbc.SQLServerDriver
            JdbcUrl jdbc:sqlserver://localhost;selectMethod=direct;DatabaseName=pltfloor
            UserName user
            Password pass
            JtaManaged true
        </Resource>
    
        <!-- activate next line to be able to deploy applications in apps -->
        <Deployments dir="apps" />
    </tomee>

    Leave a comment:


  • Isomorphic
    replied
    In my testing, the EAR explodes the WAR in the apps/ directory. I'd like to understand how your configuration has both an apps/ and a webapps/ copy. Can you share your conf/tomee.xml? Any deviations from stock install there or in any other configuration files?

    Leave a comment:


  • mabboud
    replied
    here is C:\apache-tomee-plus-1.7.3\apps\alliance.ear\META-INF\application.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <application>
        <display-name>MAIN APPLICATION</display-name>
    
         <module>
            <ejb>ejb-utility.jar</ejb>
        </module>
        <module>
            <ejb>ats_axiom.jar</ejb>
        </module>
    
        <module>
            <ejb>ejb-shiftcal.jar</ejb>
        </module>
    
        <module>
            <ejb>ejb-sm4.jar</ejb>
        </module>
    
        <module>
            <ejb>rollstock_ejb.jar</ejb>
        </module>
    
        <module>
            <web>
                <web-uri>crm2.war</web-uri>
                <context-root>crm2</context-root>
            </web>
        </module>    
    
        <module>
            <web>
                <web-uri>common.war</web-uri>
                <context-root>common</context-root>
            </web>
        </module>
        <module>
            <web>
                <web-uri>avista_commonweb.war</web-uri>
                <context-root>/avista/common</context-root>
            </web>
        </module>     
    </application>
    The CRM2 application gets deployed relative to the ROOT context so they are are not distinct in matter of deployment .. but they are is separate folders .

    Leave a comment:


  • Isomorphic
    replied
    Can you share the configuration of the webapps in the ear? META-INF/application.xml at the .ear level, I think.

    Are the 'crm2' and 'ROOT' apps distinct? Or is the crm2 app being mapped to / and hence appearing in multiple places? I'm trying to see if our initializer is somehow firing somewhere it shouldn't or maybe they are distinct apps and both use SmartClient - in which case maybe this is a classloader issue...

    Anything more you can share about the intended layout and config would be helpful

    Leave a comment:

Working...
X