No ClassLoaders found exception when trying to start JBoss

org.jboss.deployment.DeploymentException: No ClassLoaders found for: org.jboss.management.j2ee.LocalJBossServerDomain
Cause:
You get this error when after extracting JBoss, you try to start it

Solution:
This happens if you try to extract JBoss archive using windows archiver. It doesn't properly extract the library files. Use a different archiver and ditch Windows.

JBoss Application Server Start Failed. HTTP Connector port 8080 is already in use

JBoss Application Server Start Failed. HTTP Connector port 8080 is already in use
Cause:
When you try to start JBoss Application Server. In my case, within NetBeans. As the error indicates, this happens when the port JBoss tries to listen on is in use.

Solution:
Change the default port to a different port. In this case, 7070
  1. Change port number to an unused port
  2. Edit C:\jboss-4.0.5.GA\server\default\deploy\jbossweb-tomcat55.sar\server.xml
  3. Change connector port 8080 to 7070

How to set the initial context in Axis?

javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at axiscds.test.Test.testMain(Test.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:32)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:421)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:912)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:766)
Cause:
Axis cannot find the context

Solution:
Set initial context.

Example:
Properties props = new Properties();
props.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
props.setProperty("java.naming.provider.url", "127.0.0.1:1099");
Context ctx = new InitialContext(props);

Access denied error when trying to create a tmp file in Java on Windows NT

java.io.IOException: Access is denied
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.checkAndCreate(File.java:1345)
at java.io.File.createTempFile(File.java:1434)
Cause:
When you try to create a tmp file in java for exclusive use in Windows operating system

Solution:
There are a number of reasons you could get this error.
  1. You have a multi-threaded program and two threads are trying to create the same file. This is a logical error, the solution is to recheck your logic (put a mutex!)
  2. You don't have access to the path. Read only?
  3. If neither of the above checks out, then check if the file you are trying to create already exists. If it does, delete it and try again. This worked for me