Yes, that's possible:
<?xml version="1.0" encoding="UTF-8"?> <server> <mbean code="org.jboss.naming.NamingAlias" name="org.myapp:alias=myDSAlias"> <attribute name="FromName">aliasJNDIName</attribute> <attribute name="ToName">java:DefaultDS</attribute> </mbean> </server>
Well I think I understand something wrong.
drop DefaultDS (the hsqldb connector)
create a new Oracle datasource with name 'MyDatasource'
--> here the start of ejbtimer failed because of missing DefaultDS
create a file alias-service.xml (example from last post)
--> the DefaultDS is still not available
What is wrong? Must I set some dependencies?
I misunderstood your first question then. The NamingAlias just creates a LinkRef for a source to target jndi name.
From what I see in your latest post, you are trying something different. The DefaultDS does some other things that just binding to JNDI at java:DefaultDS. For example, there are multiple MBeans which are created using the "DefaultDS" as the name for those services. And then there are numerous other services which depend on the name of this DefaultDS MBeans. So in your case, when you drop the DefaultDS in favour of the MyDataSource name, you have to make sure that the dependent MBeans also you this new name to depend on.
This wiki http://community.jboss.org/wiki/ChangeDefaultDataSource has the details of which exact files need to be changed.
what I want to is to have one Datasource with two different names for full compatible EJB2, EJB3 persistence and other plain JDBC access via pool.
This is because of orchestring applications from different suppliers, we don't have the permission to change the EAR descriptor.
Remove the DefaultDS was only experimental to have a default installation without complex application.