Java Reference
In-Depth Information
tempting to deploy the application. Improper packaging of classes and libraries
causes a lot of class-loading issues. You also need to understand the dependency
of your applications on helper classes and third-party libraries and package them
accordingly. Avoid duplication of libraries in multiple places. Instead, find a way
to package your applications, and configure your application server so that you can
share common libraries from multiple modules within the same application.
Avoid using proprietary APIs and annotations . Don't use vendor-specific tags or
annotations unless it's the only way to accomplish your task. Weigh doing so
against the disadvantages, such as making your code less portable. If you're de-
pending on proprietary behavior, check whether you can take advantage of a pro-
prietary deployment descriptor.
Leverage your database administrator ( DBA) . Work with your DBA to automate
the creation of any database schemas for your application. Avoid depending on the
automatic table creation feature for entities, because it may not meet your produc-
tion deployment requirement. Make sure that the database is configured properly
and that it doesn't become a bottleneck for your application. Past experience in-
dicates that making friends with the DBA assigned to your project really helps! If
your application requires other resources such as a JMS provider or LDAP-com-
pliant security provider, then work with the appropriate administrators to configure
them correctly. Again, using O/R mapping with XML and resource dependencies
with XML descriptors can help you troubleshoot configuration issues without hav-
ing to fiddle with the code.
Use your build tools . Most likely you'll be using Maven to build your applications,
but whatever tools you use, make sure you understand how to use them well and
take complete advantage of them. Avoid any manual intervention to package your
application. If you find yourself with manual steps, you're either not using the tool
to its full potential or your tool of choice isn't adequate and you should replace it
with something that will better suit your needs.
Now that you have some best practices in place, what do you do when that's still not
enough? We'll let you in on a few secrets from the trenches that will make solving those
packaging problems easier.
13.6.2. Troubleshooting common deployment problems
This section examines some common deployment problems that you may run into. Most
can be addressed by properly assembling your application:
Search WWH ::




Custom Search