server.properties:
File Structure:
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
added this to my web.xml :
here are the warnings and errors
Any help would be appreciated with configuring Apache Tomee
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
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
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>
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>
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)
Comment