Skip to main content

What happened to --profile option for create-domain asadmin subcommand

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
5 replies [Last post]
kneumei
Offline
Joined: 2007-11-13

I am in the process of upgrading glassfish from 2.1.1 to 3.1.1. I see from
the documentation that --profile option for create-domain doesn't do
anything anymore. We made use of custom templates in 2.1.1. How should we
go about migrating this over? Does it have anything to do with the new
domain initializes?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tmueller
Offline
Joined: 2005-10-31

On 4/2/13 3:47 PM, Kyle Neumeier wrote:
> I am in the process of upgrading glassfish from 2.1.1 to 3.1.1. I see
> from the documentation that --profile option for create-domain doesn't
> do anything anymore. We made use of custom templates in 2.1.1. How
> should we go about migrating this over? Does it have anything to do
> with the new domain initializes?
Version 3.1.1 has a --template option that allows the use of custom
templates based on just a different domain.xml file. In 4.0, this
--template option is being change to be based on a JAR that allows the
entire content of the domain to be specified, not just the domain.xml file.

Tom

heq
Offline
Joined: 2013-09-12

Hi Tom,

Do you have any sample custom template class that implements DomainInitializer as defined in Glassfish 4?

Thanks

tmueller wrote:
On 4/2/13 3:47 PM, Kyle Neumeier wrote:
> I am in the process of upgrading glassfish from 2.1.1 to 3.1.1. I see
> from the documentation that --profile option for create-domain doesn't
> do anything anymore. We made use of custom templates in 2.1.1. How
> should we go about migrating this over? Does it have anything to do
> with the new domain initializes?
Version 3.1.1 has a --template option that allows the use of custom
templates based on just a different domain.xml file. In 4.0, this
--template option is being change to be based on a JAR that allows the
entire content of the domain to be specified, not just the domain.xml file.

Tom

tmueller
Offline
Joined: 2005-10-31

No. I'm not working as a GlassFish developer anymore, but as of this past spring, the DomainInitializer interface shouldn't be used anymore. You can unjar the default template that is shipped with 4.0 to see what is in the file. From that, you can create a domain template for your own domain.

heq
Offline
Joined: 2013-09-12

Hi Tom,

Thanks for your reply. But the create-domain subcommand in glassfish 4.0 requires a jar file if you want to use --template option. (I even checked the source code. It's in CreateDomainCommand.java) According to the documentation, inside this jar you are supposed to define your own template class that implements the DomainInitializer interface. I am very surprised to see this change from previous versions, because I feel a template file is much easier to change than a class. I am also surprised to hear that this DomainInitializer shouldn't be used any more because it just appeared in 4.0 documentation. But what the heck. (Sorry this is by no means towards you. I very much appreciate your response. Just out of frustration. )

Now I just need to get by this barrier. You mentioned unjar the default template. Do you mean there is a java class in a jar file that is a template, or an xml file in a jar that is a template?
Even if I find it, how do I get by the --template option if it requires a .jar file?

Thanks again!

heq
Offline
Joined: 2013-09-12

Hi Tom,
Thanks to your pointer, I was able to find the template jar that was shipped with glassfish 4 and modified it for my own purpose. One last question on this topic. There are two files: appserver-domain.jar and nucleus-domain.jar. From the source code, the default template file is nucleus-domain.jar. Do you know what the other file is for?
Thanks