NameNotFoundException: Name "openejb/PersistenceUnit/fwtool-jpa -963118576localhost" not found - jpa

I'm trying to run TomEE in Docker. It works with tomee:8-jre-7.1.0-plume image but not with 11-jre-8.0.0-M3-plume.
Problem seems to be related to JPA/PersistenceUnit. This is my WebContent/META-INF/persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="fwtool-jpa">
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<class>com.nnn.OneClass</class>
<class>com.nnn.SecondClass</class>
<class>com.nnn.AnotherClass</class>
</persistence-unit>
</persistence>
I build the application to war with maven having:
<source>11</source>
<target>11</target>
tomee.xml:
<?xml version="1.0" encoding="UTF-8"?>
<tomee>
<Resource id="jtaFWTool" type="DataSource">
jdbcDriver com.mysql.jdbc.Driver
jdbcUrl jdbc:mysql://localhost:3306/FWTool
connectionProperties retainStatementAfterResultSetClose=true;autoReconnectForPools=true;useSSL=false
userName xxxx
password yyyy
maxActive 500
maxIdle 50
maxWaitMillis 50000
removeAbandoned true
maxConnLifetimeMillis 6000000
maxAge 6000000
testWhileIdle true
TimeBetweenEvictionRunsMillis 20000
validationQuery SELECT 1
</Resource>
</tomee>
Dockerfile:
FROM tomee:11-jre-8.0.0-M3-plume
COPY target/fwtool.war /usr/local/tomee/webapps/
COPY tomee.xml /usr/local/tomee/conf/
COPY mysql-connector-java-5.1.40.jar /usr/local/tomee/lib/
Docker build and run
docker build -t fwtool:tomee8-java11 .
docker run --net=host -d --name fwtool fwtool:tomee8-java11
When TomEE is starting and deploying the war, something goes wrong:
15-Feb-2020 17:46:15.843 INFO [main] org.apache.openejb.config.AutoConfig.deploy Configuring PersistenceUnit(name=fwtool-jpa)
15-Feb-2020 17:46:15.844 INFO [main] org.apache.openejb.config.AutoConfig.logAutoCreateResource Auto-creating a Resource with id 'jtaFWToolNonJta' of type 'DataSource for 'fwtool-jpa'.
15-Feb-2020 17:46:15.844 INFO [main] org.apache.openejb.config.AutoConfig.deploy Configuring Service(id=jtaFWToolNonJta, type=Resource, provider-id=jtaFWTool)
15-Feb-2020 17:46:15.844 INFO [main] org.apache.openejb.assembler.classic.Assembler.createRecipe Creating Resource(id=jtaFWToolNonJta)
15-Feb-2020 17:46:16.082 WARNING [main] org.apache.openejb.assembler.classic.Assembler.unusedProperty unused property 'maxWaitMillis' for resource 'jtaFWToolNonJta'
15-Feb-2020 17:46:16.083 WARNING [main] org.apache.openejb.assembler.classic.Assembler.unusedProperty unused property 'maxConnLifetimeMillis' for resource 'jtaFWToolNonJta'
15-Feb-2020 17:46:16.089 INFO [main] org.apache.openejb.config.AutoConfig.setJtaDataSource Adjusting PersistenceUnit fwtool-jpa <jta-data-source> to Resource ID 'jtaFWTool' from 'null'
15-Feb-2020 17:46:16.089 INFO [main] org.apache.openejb.config.AutoConfig.setNonJtaDataSource Adjusting PersistenceUnit fwtool-jpa <non-jta-data-source> to Resource ID 'jtaFWToolNonJta' from 'null'
15-Feb-2020 17:46:16.160 INFO [main] org.apache.openejb.config.AppInfoBuilder.build Enterprise application "/usr/local/tomee/webapps/fwtool" loaded.
15-Feb-2020 17:46:16.172 INFO [main] org.apache.openejb.assembler.classic.Assembler.createApplication Assembling app: /usr/local/tomee/webapps/fwtool
15-Feb-2020 17:46:16.491 INFO [main] org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate PersistenceUnit(name=fwtool-jpa, provider=org.eclipse.persistence.jpa.PersistenceProvider) - provider time 273ms
15-Feb-2020 17:46:16.491 INFO [main] org.apache.openejb.assembler.classic.Assembler.destroyApplication Undeploying app: /usr/local/tomee/webapps/fwtool
15-Feb-2020 17:46:16.493 SEVERE [main] jdk.internal.reflect.NativeMethodAccessorImpl.invoke Error destroying child
org.apache.catalina.LifecycleException: An invalid Lifecycle transition was attempted ([before_destroy]) for component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/fwtool]] in state [STARTING_PREP]
at org.apache.catalina.util.LifecycleBase.invalidTransition(LifecycleBase.java:430)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:316)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:814)
at org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1656)
...
...
Caused by: javax.naming.NameNotFoundException: Name "openejb/PersistenceUnit/fwtool-jpa -963118576localhost" not found.
at org.apache.openejb.core.ivm.naming.IvmContext.federate(IvmContext.java:211)
at org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:159)
at org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:2508)
Any idea what is the problem here with TomEE 8?

The final image 8.0.1-plume is now out and my application is deployed and starts normally with that.
https://hub.docker.com/_/tomee
It was just a problem with M3 beta image 11-jre-8.0.0-M3-plume.

Related

Classes inside persistence.xml will be ignored

I have here a wildfly 24.0.1 (on OpenJDK 11) and a ear with following structure:
MyPrj.ear
|- MyPrj_EJB.jar
`- MyPrj_Web.war
My persistence.xml is placed in MyPrj.ear/MyPrj_EJB.jar/META-INF/persistence.xml. I'm sure the persistence.xml isn't anywhere else.
The persistence.xml has following contents:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="myPrj">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>java:/myPrj</jta-data-source>
<class>my.prj.cfg.Config</class>
<properties>
<property name="eclipselink.query-results-cache" value="true"/>
<property name="eclipselink.cache.shared.default" value="true"/>
<property name="eclipselink.target-server" value="JBoss"/>
<property name="eclipselink.weaving" value="false"/>
<property name="jboss.as.jpa.providerModule" value="org.eclipse.persistence"/>
<!-- property name="eclipselink.logging.level" value="FINE" / -->
</properties>
</persistence-unit>
</persistence>
I'm sure that the persistence.xml can be readed, because if I put an invalid character into the persistence-unit name (like an "/": <persistence-unit name="/myPrj">) I get the following error while deploying the application:
Caused by: java.lang.IllegalArgumentException: WFLYJPA0043: Persistence unit name (/myPrj) contains illegal '/' character
So I'm assuming that my persistence.xml is put in the right place and can be read successfully.
But its seems that my <class>-definition will be ignored. Every time if I deploy the ear, I get in the wildfly log file:
...
2022-07-04 18:51:15,694 INFO [org.jboss.as.jpa] (MSC service thread 1-4) WFLYJPA0002: Read persistence.xml for myPrj
2022-07-04 18:52:48,400 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 141) WFLYJPA0003: Starting Persistence Unit Service 'MyPrj.ear/MyPrj_EJB.jar#myPrj'
...
2022-07-04 18:53:16,182 WARN [org.eclipse.persistence] (ServerService Thread Pool -- 184) session_manager_no_partition
...
If I start the application (open the web site) I get:
...
2022-07-04 18:57:45,366 INFO [org.eclipse.persistence] (default task-1) EclipseLink, version: Eclipse Persistence Services - 2.6.0.v20150309-bf26070
2022-07-04 18:57:45,444 INFO [org.eclipse.persistence.connection] (default task-1)
connecting(DatabaseLogin(
platform=>PostgreSQLPlatform
user name=> ""
connector=>JNDIConnector datasource name=>null
))
2022-07-04 18:57:45,444 INFO [org.eclipse.persistence.connection] (default task-1)
Connected: jdbc:postgresql://localhost:5432/myDB
User: myUser
Database: PostgreSQL Version: 9.2.24
Driver: PostgreSQL JDBC Driver Version: 42.2.23
2022-07-04 18:57:45,444 INFO [org.eclipse.persistence.connection] (default task-1)
connecting(DatabaseLogin(
platform=>PostgreSQLPlatform
user name=> ""
connector=>JNDIConnector datasource name=>null
))
2022-07-04 18:57:45,444 INFO [org.eclipse.persistence.connection] (default task-1)
Connected: jdbc:postgresql://localhost:5432/myDB
User: myUser
Database: PostgreSQL Version: 9.2.24
Driver: PostgreSQL JDBC Driver Version: 42.2.23
2022-07-04 18:57:45,446 INFO [org.eclipse.persistence.connection] (default task-1)
/vfs:/content/MyPrj.ear/MyPrj_EJB.jar/_myPrj login successful
2022-07-04 18:57:45,509 WARN [org.eclipse.persistence.metamodel] (default task-1) The
collection of metamodel types is empty. Model classes may not have been found
during entity search for Java SE and some Java EE container managed persistence
units. Please verify that your entity classes are referenced in persistence.xml
using either <class> elements or a global <exclude-unlisted-
classes>false</exclude-unlisted-classes> element
2022-07-04 18:57:45,606 ERROR [org.jboss.as.ejb3.invocation] (default task-1)
WFLYEJB0034: Jakarta Enterprise Beans Invocation failed on component ConfigDAO for
method public my.prj.cfg.Config
my.prj.cfg.ConfigDAO.loadByKey(java.lang.String):
javax.ejb.EJBTransactionRolledbackException: An exception occurred while creating
a query in EntityManager:
Exception Description: Problem compiling [SELECT obj FROM Config obj WHERE
obj.key=:parKey].
[16, 22] The abstract schema type 'Config' is unknown.
[33, 40] The state field path 'obj.key' cannot be resolved to a valid type.
at org.jboss.as.ejb3#24.0.1.Final//org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:219)
Take also note of the warning 2022-07-04 18:57:45,509 WARN org.eclipse.persistence.metamodel] (default task-1) The collection of metamodel types is empty. Model classes may not have been found during entity search for Java SE and some Java EE container managed persistence units. Please verify that your entity classes are referenced in persistence.xml using either <class> elements or a global <exclude-unlisted- classes>false</exclude-unlisted-classes> element.
Also to use <exclude-unlisted-classes>false</exclude-unlisted-classes> instead of the <class>-definition makes no difference.
Here the #Resource annotation of the EntityManager:
#PersistenceContext(unitName="myPrj")
private EntityManager em = null;
And the annotation of the Config entity:
#Entity(name="Config")
#Table(name = "Cfg")
public class Config implements Serializable {
...
#Column(name="key")
private String key = null;
...
}
On the same wildfly I have another EAR running (in a separate standalone instance) which also have JPA access to a database (also eclipselink via persistence.xml) which works without any problems.
What can be wrong here?
Found it! After upgrading eclipselink to V2.7.10 (store eclipselink.jar into .../wildfly-24.0.1.Final/modules/system/layers/base/org/eclipse/persistence/main/) I can deploy and start the application. Not sure which version of eclipselink was used before that (the jar file name don't contains the version information ...)
Switching to eclipselink 3.0.2 don't works because of this problem: Wildfly 21 with eclipselink 3.0 getting error as Persistence Provider not found

Arquillian - Wildfly cannot deploy test.war (Could not connect to http-remoting://127.0.0.1:9990. The connection failed)

I am trying to run a simple JPA test (persist, read, JSON serialize) with Arquillian and Wildfly (8.1.0.Final and 8.2.0.Final tested) container, but until now I was not able to deploy test.war to the embedded server. The test runs with Jboss 7.1.1.Final container.
I have used arquillian-tutorial package given on Arquillian Getting Started Guide and Arquillian Example Project (google: github arquillian tutorial)
I have used Arquillian - Wildfly configuration given here
You can find a downloadable project package on google drive. You can see Maven and Arquillian configurations in that package. I have tried with or without Management realm credentials. On profile wildfy81-embedded-credentials (which is the default in the package), the build first unpacks wildfly package and then overwrites mgmt-users.properties and mgmt-groups.properties where admin user credentials and role is defined.
The exception is
INFO [org.jboss.ws.common.management] JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.2.4.Final
INFO [org.jboss.as] JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
INFO [org.jboss.as] JBAS015951: Admin console listening on http://127.0.0.1:9990
INFO [org.jboss.as] JBAS015874: WildFly 8.1.0.Final "Kenny" started in 3401ms - Started 184 of 233 services (81 services are lazy, passive or on-demand)
INFO [org.xnio] XNIO version 3.2.0.Beta4
INFO [org.xnio.nio] XNIO NIO Implementation Version 3.2.0.Beta4
INFO [org.jboss.remoting] JBoss Remoting version 4.0.3.Final
ERROR [org.jboss.remoting.remote.connection] JBREM000200: Remote connection failed: java.io.IOException: JBREM000202: Abrupt close on Remoting connection 0a93e136 to /127.0.0.1:9990
ERROR [org.jboss.remoting.remote.connection] JBREM000200: Remote connection failed: java.io.IOException: An existing connection was forcibly closed by the remote host
ERROR [org.jboss.remoting.remote.connection] JBREM000200: Remote connection failed: java.io.IOException: JBREM000202: Abrupt close on Remoting connection 084cf5d6 to /127.0.0.1:9990
ERROR [org.jboss.remoting.remote.connection] JBREM000200: Remote connection failed: java.io.IOException: An existing connection was forcibly closed by the remote host
WARN [org.jboss.as.arquillian.container.ArchiveDeployer] Cannot undeploy: test.war: org.jboss.as.controller.client.helpers.standalone.ServerDeploymentHelper$ServerDeploymentException: java.lang.RuntimeException: java.net.ConnectException: JBAS012174: Could not connect to http-remoting://127.0.0.1:9990. The connection failed
at org.jboss.as.controller.client.helpers.standalone.ServerDeploymentHelper.undeploy(ServerDeploymentHelper.java:109) [wildfly-controller-client-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.arquillian.container.ArchiveDeployer.undeploy(ArchiveDeployer.java:55) [wildfly-arquillian-common-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.arquillian.container.CommonDeployableContainer.undeploy(CommonDeployableContainer.java:152) [wildfly-arquillian-common-8.1.0.Final.jar:8.1.0.Final]
Caused by: java.lang.RuntimeException: java.net.ConnectException: JBAS012174: Could not connect to http-remoting://127.0.0.1:9990. The connection failed
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeAsync(AbstractModelControllerClient.java:103) [wildfly-controller-client-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.controller.client.helpers.standalone.impl.ModelControllerClientServerDeploymentManager.executeOperation(ModelControllerClientServerDeploymentManager.java:50) [wildfly-controller-client-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.controller.client.helpers.standalone.impl.AbstractServerDeploymentManager.execute(AbstractServerDeploymentManager.java:79) [wildfly-controller-client-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.controller.client.helpers.standalone.ServerDeploymentHelper.undeploy(ServerDeploymentHelper.java:106) [wildfly-controller-client-8.1.0.Final.jar:8.1.0.Final]
... 82 more
Caused by: java.net.ConnectException: JBAS012174: Could not connect to http-remoting://127.0.0.1:9990. The connection failed
at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:117) [wildfly-protocol-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.protocol.ProtocolConnectionManager$EstablishingConnection.connect(ProtocolConnectionManager.java:256) [wildfly-protocol-8.1.0.Final.jar:8.1.0.Final]
Could you please help me to find the issue here?
Thanks in advance.
Edit 1
From arquillian.xml
<container qualifier="wildfly-embedded-credentials">
<configuration>
<property name="jbossHome">target/wildfly-8.1.0.Final</property>
<property name="modulePath">target/wildfly-8.1.0.Final/modules</property>
<property name="managementAddress">127.0.0.1</property>
<property name="managementPort">9990</property>
<property name="username">admin</property>
<property name="password">admin</property>
<property name="outputToConsole">true</property>
</configuration>
</container>
Deployment code:
#Deployment
public static WebArchive createDeployment() {
return ShrinkWrap.create(WebArchive.class, "test.war")
.addPackage(MyBean.class.getPackage())
.addAsLibraries(new File("target/test-libs/commons-collections.jar"),
new File("target/test-libs/flexjson.jar"))
.addAsResource("test-persistence.xml", "META-INF/persistence.xml")
.addAsWebInfResource("jboss-ds.xml")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
}
I wonder if this is because of URL
INFO Http management interface listening on http://127.0.0.1:9990/management
Edit 2
In the attached project (google drive link above), you will see there is another profile wildfy81-embedded in pom.xml with different arquillian configuration where I do not supply management address or username and password, only jbossHome and modulePath folders are defined. I get same exception (same port as well, 9990).
<container qualifier="wildfly-embedded">
<configuration>
<property name="jbossHome">target/wildfly-8.1.0.Final</property>
<property name="modulePath">target/wildfly-8.1.0.Final/modules</property>
<property name="outputToConsole">true</property>
</configuration>
</container>
On my last test, I have noticed one more exception cause (maybe because of java version or eclipse version that I am using at home). This was the exception at the bottom of other exception lines Could not connect to http-remoting://127.0.0.1:9990. The connection failed
Caused by: java.io.IOException: Invalid response
at org.xnio.http.HttpUpgradeParser.parseVersion(HttpUpgradeParser.java:150) [xnio-api-3.2.0.Beta4.jar:3.2.0.Beta4]
at org.xnio.http.HttpUpgradeParser.parse(HttpUpgradeParser.java:53) [xnio-api-3.2.0.Beta4.jar:3.2.0.Beta4]
at org.xnio.http.HttpUpgrade$HttpUpgradeState$UpgradeResultListener.handleEvent(HttpUpgrade.java:299) [xnio-api-3.2.0.Beta4.jar:3.2.0.Beta4]
at org.xnio.http.HttpUpgrade$HttpUpgradeState$UpgradeResultListener.handleEvent(HttpUpgrade.java:279) [xnio-api-3.2.0.Beta4.jar:3.2.0.Beta4]
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) [xnio-api-3.2.0.Beta4.jar:3.2.0.Beta4]
at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66) [xnio-api-3.2.0.Beta4.jar:3.2.0.Beta4]
at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:87) [xnio-nio-3.2.0.Beta4.jar:3.2.0.Beta4]
at org.xnio.nio.WorkerThread.run(WorkerThread.java:531) [xnio-nio-3.2.0.Beta4.jar:3.2.0.Beta4]
at ...asynchronous invocation...(Unknown Source)
at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:272) [jboss-remoting-4.0.3.Final.jar:4.0.3.Final]
at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:253) [jboss-remoting-4.0.3.Final.jar:4.0.3.Final]
at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:351) [jboss-remoting-4.0.3.Final.jar:4.0.3.Final]
at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:339) [jboss-remoting-4.0.3.Final.jar:4.0.3.Final]
at org.jboss.as.protocol.ProtocolConnectionUtils.connect(ProtocolConnectionUtils.java:78) [wildfly-protocol-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:109) [wildfly-protocol-8.1.0.Final.jar:8.1.0.Final]
... 95 more
I have encountered this exception (invalid response part) a few times because of Nvidia drivers on windows platform. NVIDIA Network Service is using the same port WildFly/JBoss AS is using. If you are using windows with nvidia, then please go to local services and stop this service, then check if the tests work :).
A few comments:
I have tried jboss/wildfly embedded a million times and never gotten it to work. It seems to merge the classpath with your maven or IDE environment with Wildfly. As a result I always have to revert to -managed deployment. Your example project works for me in this sense when I change it to managed.
I would recommend upgrading Arquillian to the latest version: 1.1.9.Final. A lot of bug fixes happen between releases
Your DeploymentFactory is referring to jar files in the /target/ directory but those don't exist under a normal maven run. (maybe your IDE is putting them there?). A better way to get the jar files you need is to use the shrinkwrap maven resolver.
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-depchain</artifactId>
<version>2.1.0</version>
<scope>test</scope>
<type>pom</type>
</dependency>
ConfigurableMavenResolverSystem mvnResolver = Maven.configureResolver();
PomEquippedResolveStage pers = mvnResolver.loadPomFromFile("pom.xml");
return ShrinkWrap.create(WebArchive.class, "test.war")
.addPackage(MyBean.class.getPackage())
.addAsLibraries(pers.resolve("commons-collections:commons-collections").withTransitivity().asFile())
.addAsLibraries(pers.resolve("net.sf.flexjson:flexjson").withTransitivity().asFile())
.addAsResource("test-persistence.xml", "META-INF/persistence.xml")
.addAsWebInfResource("jboss-ds.xml")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
Changing management port in Wildfly worked for me:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<forkCount>1</forkCount>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<jboss.home>${project.basedir}/container/wildfly-8.1.0.Final</jboss.home>
<module.path>${project.basedir}/container/wildfly-8.1.0.Final/modules</module.path>
<jboss.http.port>8181</jboss.http.port>
<jboss.management.http.port>9090</jboss.management.http.port>
</systemPropertyVariables>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
Remember to configure management port for Arquillian in arquillian.xml:
<container qualifier="wildfly-embedded" default="true">
<configuration>
<property name="managementPort">9090</property>
</configuration>
</container>

Error starting JBOSS 7.0.0.0 Final - Services with missing/unavailable dependencies

I am having problems while starting a sample app on JBoss server 7.0.
Below follow piece of start log:
12:19:10,156 ERROR [org.jboss.as] (MSC service thread 1-7) JBoss AS 7.0.0.Final "Lightning" started (with errors) in 16391ms - Started 207 of 331 services (67 services failed or missing dependencies, 57 services are passive or on-demand)
12:19:10,361 INFO [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployment of "crm.war" was rolled back with failure message {"Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"crm.war\".jndiDependencyService missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ClienteDAOBean/emf\", jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ContatoDAOBean/emf\" ]","jboss.deployment.unit.\"crm.war\".component.br/com/crm/model/dao/ContatoDAORemote.START missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ContatoDAOBean/emf\" ]","jboss.persistenceunit.\"crm.war#crmUnity\" missing [ jboss.naming.context.java.jdbc/CRMDS ]","jboss.deployment.unit.\"crm.war\".component.br/com/crm/model/dao/ClienteRemoteDAO.START missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ClienteDAOBean/emf\" ]"]}
12:19:10,443 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) Stopped deployment crm.war in 82ms
12:19:10,445 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"crm.war\".jndiDependencyService missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ClienteDAOBean/emf\", jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ContatoDAOBean/emf\" ]","jboss.deployment.unit.\"crm.war\".component.br/com/crm/model/dao/ContatoDAORemote.START missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ContatoDAOBean/emf\" ]","jboss.persistenceunit.\"crm.war#crmUnity\" missing [ jboss.naming.context.java.jdbc/CRMDS ]","jboss.deployment.unit.\"crm.war\".component.br/com/crm/model/dao/ClienteRemoteDAO.START missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ClienteDAOBean/emf\" ]"]}}}
crm-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>CRMDS</jndi-name>
<connection-url>jdbc:hsqldb:file:database/crm</connection-url>
<driver>hsqldb.jar</driver>
<user-name>SA</user-name>
<password></password>
</local-tx-datasource>
</datasources>
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="crmUnity" transaction-type="JTA">
<jta-data-source>java:/CRMDS</jta-data-source>
<class>br.com.crm.model.entities.Cliente</class>
<class>br.com.crm.model.entities.Contato</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.showSql" value="true"/>
</properties>
</persistence-unit>
</persistence>
The main error is:
ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"crm.war\".component.br/com/crm/model/dao/ClienteRemoteDAO.START missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ClienteDAOBean/emf\" ]","jboss.deployment.unit.\"crm.war\".component.br/com/crm/model/dao/ContatoDAORemote.START missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ContatoDAOBean/emf\" ]","jboss.deployment.unit.\"crm.war\".jndiDependencyService missing [ jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ContatoDAOBean/emf\", jboss.naming.context.java.module.crm.crm.\"env/br.com.crm.model.dao.ClienteDAOBean/emf\" ]","jboss.persistenceunit.\"crm.war#crmUnity\" missing [ jboss.naming.context.java.java:CRMDS ]"]}}}
Thank you in advance for help me.
This error appears to be the entity manager missing the datasource. Make sure the JNDI name in both the persistence.xml and -ds.xml is the same (e.g. they should both be java:/CRMDS).
Also JBoss AS 7.0.0 is extremely outdated, if you are starting a new project you should use something newer (either Wildfly or JBoss EAP).

unable to start terracota

I'm having issue when starting terracota, I did grep on 37.139.24.150 ip in whole system but couldn't find any file containing this IP, any other places to look for? Also i couldn't find tc-config.xml in terracota its actually an old system I'm just starting terracota its not installed/configured by me.
2015-03-12 13:02:09,737 [main] INFO com.terracottatech.dso - Statistics store: '/root/terracotta/server-statistics'.
2015-03-12 13:02:09,750 [main] INFO com.terracottatech.console - Available Max Runtime Memory: 490MB
2015-03-12 13:02:09,958 [main] INFO com.terracottatech.dso - Standard DSO Server created
2015-03-12 13:02:09,962 [main] INFO com.terracottatech.dso - Creating server nodeID: NodeID[37.139.24.150:9510]
2015-03-12 13:02:09,973 [main] ERROR com.terracottatech.console - Unable to find local network interface for 37.139.24.150
2015-03-12 13:02:09,975 [main] ERROR com.terracottatech.dso - Unable to find local network interface for 37.139.24.150
com.tc.exception.TCRuntimeException: Unable to find local network interface for 37.139.24.150
at com.tc.objectserver.impl.DistributedObjectServer.start(DistributedObjectServer.java:502)
at com.tc.server.TCServerImpl.startDSOServer(TCServerImpl.java:531)
at com.tc.server.TCServerImpl.access$600(TCServerImpl.java:92)
at com.tc.server.TCServerImpl$StartAction.execute(TCServerImpl.java:479)
at com.tc.lang.StartupHelper.startUp(StartupHelper.java:39)
at com.tc.server.TCServerImpl.startServer(TCServerImpl.java:510)
at com.tc.server.TCServerImpl.start(TCServerImpl.java:271)
at com.tc.server.TCServerMain.main(TCServerMain.java:30)
I made it work, I've created new tc-config.xml and started server with ./start-tc-server.sh -f /home/tomcat/terracotta/latest/terracotta/bin/tc-config.xml &
<?xml version="1.0" encoding="UTF-8"?>
<!-- All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. -->
<tc:tc-config xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-5.xsd"
xmlns:tc="http://www.terracotta.org/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<!-- Sets where the Terracotta server can be found. Replace the value of host with the server's IP address. -->
<server host="<my-server-ip>" name="localhost">
<data>/home/tomcat/terracotta/server-data</data>
<logs>/home/tomcat/terracotta/server-logs</logs>
<statistics>/home/tomcat/terracotta/server-statistics</statistics>
</server>
<!-- If using more than one server, add an <ha> section. -->
<ha>
<mode>networked-active-passive</mode>
<networked-active-passive>
<election-time>5</election-time>
</networked-active-passive>
</ha>
</servers>
<!-- Sets where the generated client logs are saved on clients. Note that the exact location of Terracotta logs on client machines may vary based on the value of user.home and the local disk layout. -->
<clients>
<logs>/opt/terracotta/client-logs</logs>
</clients>
</tc:tc-config>

EAR Content not Bounded Exception

I am using JBoss AS 5.0.1 and and I am getting the following error when i Try to Invoke my Servlet.
17:11:48,060 ERROR [STDERR] javax.naming.NameNotFoundException: EJBSvcApp not bound
I have Created an EAR by the Above name to which I have Added my EJB and Web Project.
I have also Included EJBClient in deployment assembly of my Web App. Below is the JBoss Log Trace. I also See a warning in the Log Which I am not sure what it is.
17:09:27,962 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext#457214762{vfszip:/C:/jboss- 5.0.1.GA/server/default/deploy/EJBSvcApp.ear/EJBSvcEJB.jar/}
17:09:27,963 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext#457214762{vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/EJBSvcApp.ear/EJBSvcEJB.jar/}
17:09:27,963 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext#457214762{vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/EJBSvcApp.ear/EJBSvcEJB.jar/}
7:09:27,986 WARN [Ejb3AnnotationHandler] JBMETA-4: did not find any bean meta data for annotation bean OrderBean, will create some
17:09:33,622 INFO [JBossASKernel] Created KernelDeployment for: EJBSvcEJB.jar
17:09:33,626 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=EJBSvcApp.ear,jar=EJBSvcEJB.jar,name=OrderBean,service=EJB3
17:09:33,626 INFO [JBossASKernel] with dependencies:
17:09:33,626 INFO [JBossASKernel] and demands:
17:09:33,627 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
17:09:33,627 INFO [JBossASKernel] and supplies:
17:09:33,627 INFO [JBossASKernel] Class:com.webpage.ejb.Order
17:09:33,627 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=EJBSvcApp.ear,jar=EJBSvcEJB.jar,name=OrderBean,service=EJB3) to KernelDeployment of: EJBSvcEJB.jar
17:09:33,776 INFO [SessionSpecContainer] Starting jboss.j2ee:ear=EJBSvcApp.ear,jar=EJBSvcEJB.jar,name=OrderBean,service=EJB3
17:09:33,786 INFO [EJBContainer] STARTED EJB: com.webpage.ejb.OrderBean ejbName: OrderBean
17:09:33,791 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
17:09:33,850 WARN [WebServiceDeployerEJB] Ingore ejb deployment with null classname: org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData#6012d7fe{OrderBean}
17:09:33,928 INFO [TomcatDeployment] deploy, ctxPath=/EJBSvcWeb
I have Created An EJB INterface
#Remote()
public interface Order {...
and Bean
#Stateless(name = "OrderBean")
public class OrderBean implements Order { ...
I am making a lookup in My Servlet as below
Order o = (Order)(new InitialContext()).lookup("EJBSvcApp/OrderBean/remote");
I was curious about this part:
[Ejb3AnnotationHandler] JBMETA-4: did not find any bean meta data for annotation bean OrderBean, will create some
It seems to be that the problem is a Jboss AS 5.1.0 GA's bug.
If I understood the post correctly, the problem is originated because you have an empty META-INF/ejb-jar.xml file.
I would try to:
a) delete the file. (I think this will be enough).
b) or try to fill it with the next :
<ejb-jar version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
</ejb-jar>