Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7644073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:35:58+00:00 2026-05-31T09:35:58+00:00

I’m trying to implement logging system into OSGI bundle. This is the bundle activator:

  • 0

I’m trying to implement logging system into OSGI bundle. This is the bundle activator:

import javax.sql.DataSource;
import java.sql.SQLException;

import java.util.Properties;
import org.DX_57.osgi.LS_27.api.LoggingSystem;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.Filter;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
import org.osgi.util.tracker.ServiceTracker;


public class LoggingSystemApp implements BundleActivator {

    LoggingSystemImpl log = null;

    public ServiceTracker st;

    @Override
    public void start(final BundleContext bc) throws Exception {
        debug("Activator started");

        ServiceRegistration registerService = bc.registerService(LoggingSystemImpl.class.getName(), new LoggingSystemImpl() {}, new Properties());
          /* Start Logger System */
          log = LoggingSystemImpl.getInstance();
          log.start();       


    }

    public void stop(BundleContext bc) throws Exception {
        boolean ungetService = bc.ungetService(bc.getServiceReference(LoggingSystem.class.getName()));
        st.close();

        log.stop();
    }

    private void debug(String msg) {
        System.out.println("JDBCBundleActivator: " + msg);
    }

}

This is the code if the logging system:

import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import java.sql.Connection;
import javax.sql.DataSource;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Calendar;
import java.util.Locale;
import org.DX_57.osgi.LS_27.api.LoggingSystem;

public class LoggingSystemImpl implements LoggingSystem {

       public LoggingSystemImpl() {
       }


        private final static Calendar calendar = Calendar.getInstance();
        private final static String user = System.getenv("USERNAME").toLowerCase();
        private final static String sMonth = calendar.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.ENGLISH);
        private final static int y = calendar.get(Calendar.YEAR);

        // the name of the log file
        //private final String logName = sysDrive + "\\fttb_web - " + sMonth.toLowerCase() + ", " + y + ".log";
        private final String logName = "logger - " + sMonth.toLowerCase() + ", " + y + ".log";

        private static boolean closed;
        private static LoggingSystemImpl log = null;
        private static BufferedWriter bw = null;
        private static FileOutputStream fos = null;
        private static OutputStreamWriter osw = null;


        /* Utilialize Buffer and wait for data to write */
        public void start() throws IOException{            
            log = LoggingSystemImpl.getInstance();
        }

        public void stop(){            
            log.close();           
        }

        public void WriteLog(String WriteString){
            log.writeln(WriteString);            
        }

        public void LoggingSystemImpl() throws IOException
        {
            fos = new FileOutputStream(logName, true);

            // set encoding to cyrillic (if available)
            if (Charset.isSupported("windows-1251"))
            {
                osw = new OutputStreamWriter(fos, Charset.forName("windows-1251"));
            }
            else { osw = new OutputStreamWriter(fos); }

            bw = new BufferedWriter(osw, 2048); // 2Mb buffer


        }

        // intro header for log session
        public static synchronized LoggingSystemImpl getInstance() throws IOException
        {
            boolean exc = false;
            try
            {
                if (log == null || closed)
                {
                    log = new LoggingSystemImpl() {};
                    closed = false;
                    log.writeln("logged in.");
                    log.nl();
                }
            }
    //      catch(IOException x) { exc = true; throw x; }
            catch(Exception x) { exc = true; x.printStackTrace(); }
            finally
            {
                if (exc)
                {
                    try
                    {
                        if (fos != null) { fos.close(); fos = null; }
                        if (osw != null) { osw.close(); fos = null; }
                        if (bw != null)  { bw.close(); bw = null; }
                    }
                    catch(Exception x) { x.printStackTrace(); }
                }
            }
            return log;
        }


        public synchronized void nl()
        {
            try { bw.newLine(); }
            catch(IOException x) {x.printStackTrace();}
        }

        public synchronized void nl(int count)
        {
            try
            {
                for (int i = 0; i < count; i++) bw.newLine();
            }
            catch(IOException x) {x.printStackTrace();}
        }
        public synchronized void writeln(String s)
        {
            try { bw.write(getTime() + ": " + s); bw.newLine(); }
            catch(IOException x) {x.printStackTrace();}
        }

        public synchronized void write(String s)
        {
            try { bw.write(s); }
            catch (IOException x) {x.printStackTrace();}
        }

        public synchronized void close()
        {
            try
            {
                if (bw != null)
                {
                    writeln("logged out.");
                    nl();
                    bw.flush();
                    bw.close();
                    closed = true;

                    fos = null;
                    osw = null;
                    bw = null;
                }
            }
            catch(IOException x) { x.printStackTrace(); }

        }

        public synchronized boolean isClosed() { return closed; }

        public synchronized void writeException(Exception x)
        {
            writeln("");
            write("\t" + x.toString()); nl();
            StackTraceElement[] ste = x.getStackTrace();
            int j = 0;
            for (int i = 0; i < ste.length; i++)
            {

                if (i < 15) { write("\t\tat " + ste[i].toString()); nl(); }
                else { j++; }

            }

            if (j > 0) { write("\t\t... " + j + " more"); nl(); }

            nl(2);
        }

        private String getTime()
        {
            Calendar c = Calendar.getInstance();
            int month = c.get(Calendar.MONTH) + 1;

            int d = c.get(Calendar.DAY_OF_MONTH);
            int h = c.get(Calendar.HOUR_OF_DAY);

            int m = c.get(Calendar.MINUTE);
            int s = c.get(Calendar.SECOND);
            int y = c.get(Calendar.YEAR);

            String dd = d < 10 ? "0"+d : ""+d;
            String hh = h < 10 ? "0"+h : ""+h;
            String mm = m < 10 ? "0"+m : ""+m;
            String ss = s < 10 ? "0"+s : ""+s;
            String sm = month < 10 ? "0"+month : ""+month;

            return user + " [" + y + "." + sm + "." + dd + " " + hh +  ":" + mm +  ":" + ss + "]";
        }



}

This is the Java interface:

public interface LoggingSystem {



}

When I try to deploy the code on Glassfish server I get this error stack:

[#|2012-03-14T13:20:42.940+0200|INFO|glassfish3.1.2|org.hibernate.validator.util.Version|_ThreadID=50;_ThreadName=Thread-2;|Hibernate Validator 4.2.0.Final|#]

[#|2012-03-14T13:20:44.147+0200|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=50;_ThreadName=Thread-2;|WEB0671: Loading application [__admingui] at [/]|#]

[#|2012-03-14T13:20:44.150+0200|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=50;_ThreadName=Thread-2;|CORE10010: Loading application __admingui done in 12,777 ms|#]

[#|2012-03-14T13:20:44.150+0200|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.admin.adapter|_ThreadID=50;_ThreadName=Thread-2;|The Admin Console application is loaded.|#]

[#|2012-03-14T13:20:54.222+0200|INFO|glassfish3.1.2|javax.enterprise.system.tools.admin.com.sun.enterprise.container.common|_ThreadID=66;_ThreadName=Thread-2;|User [] from host localhost does not have administration access|#]

[#|2012-03-14T13:21:10.569+0200|INFO|glassfish3.1.2|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=75;_ThreadName=Thread-2;|Created EjbThreadPoolExecutor with thread-core-pool-size 16 thread-max-pool-size 32 thread-keep-alive-seconds 60 thread-queue-capacity 2147483647 allow-core-thread-timeout false |#]

[#|2012-03-14T13:21:12.530+0200|INFO|glassfish3.1.2|com.sun.jersey.server.impl.application.WebApplicationImpl|_ThreadID=75;_ThreadName=Thread-2;|Initiating Jersey application, version 'Jersey: 1.11 12/09/2011 10:27 AM'|#]

[#|2012-03-14T13:21:13.546+0200|INFO|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.admin.rest.adapter|_ThreadID=75;_ThreadName=Thread-2;|REST00001: Listening to REST requests at context: /management/domain|#]

[#|2012-03-14T13:21:13.587+0200|INFO|glassfish3.1.2|org.glassfish.admingui|_ThreadID=74;_ThreadName=Thread-2;|Redirecting to /common/index.jsf|#]

[#|2012-03-14T13:21:14.133+0200|INFO|glassfish3.1.2|org.glassfish.admingui|_ThreadID=72;_ThreadName=Thread-2;|Admin Console: Initializing Session Attributes...|#]

[#|2012-03-14T13:22:04.476+0200|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=74;_ThreadName=Thread-2;|Stopped LS_27-api [470]|#]

[#|2012-03-14T13:22:04.489+0200|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=74;_ThreadName=Thread-2;|Uninstalled LS_27-api [470]|#]

[#|2012-03-14T13:22:04.878+0200|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=137;_ThreadName=Thread-2;|com.sun.webui.jsf.component.DropDown::The current value of component propertyForm:deployTable:topActionsGroup1:filter does not match any of the selections. 
Did you forget to reset the value after changing the options? |#]

[#|2012-03-14T13:22:19.830+0200|WARNING|glassfish3.1.2|org.apache.catalina.connector.Request|_ThreadID=135;_ThreadName=Thread-2;|PWC4011: Unable to set request character encoding to UTF-8 from context , because request parameters have already been read, or ServletRequest.getReader() has already been called|#]

[#|2012-03-14T13:22:19.968+0200|INFO|glassfish3.1.2|org.glassfish.admingui|_ThreadID=135;_ThreadName=Thread-2;|GUI deployment: uploadToTempfile|#]

[#|2012-03-14T13:22:19.995+0200|INFO|glassfish3.1.2|org.glassfish.admingui|_ThreadID=135;_ThreadName=Thread-2;|uploadFileName=LS_27-api-1.0-SNAPSHOT.jar|#]

[#|2012-03-14T13:22:20.081+0200|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=302;_ThreadName=Thread-2;|Installed LS_27-api [472] from reference:file:/opt/glassfish3/glassfish/domains/domain1/applications/LS_27-api-1.0-SNAPSHOT/|#]

[#|2012-03-14T13:22:20.090+0200|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=302;_ThreadName=Thread-2;|Started LS_27-api [472]|#]

[#|2012-03-14T13:22:20.128+0200|INFO|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=302;_ThreadName=Thread-2;|LS_27-api-1.0-SNAPSHOT was successfully deployed in 115 milliseconds.|#]

[#|2012-03-14T13:22:33.840+0200|WARNING|glassfish3.1.2|org.apache.catalina.connector.Request|_ThreadID=313;_ThreadName=Thread-2;|PWC4011: Unable to set request character encoding to UTF-8 from context , because request parameters have already been read, or ServletRequest.getReader() has already been called|#]

[#|2012-03-14T13:22:33.962+0200|INFO|glassfish3.1.2|org.glassfish.admingui|_ThreadID=313;_ThreadName=Thread-2;|GUI deployment: uploadToTempfile|#]

[#|2012-03-14T13:22:33.963+0200|INFO|glassfish3.1.2|org.glassfish.admingui|_ThreadID=313;_ThreadName=Thread-2;|uploadFileName=LS_27-impl-1.0-SNAPSHOT.jar|#]

[#|2012-03-14T13:22:34.043+0200|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=311;_ThreadName=Thread-2;|Installed LS_27-impl [473] from reference:file:/opt/glassfish3/glassfish/domains/domain1/applications/LS_27-impl-1.0-SNAPSHOT/|#]

[#|2012-03-14T13:22:34.046+0200|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=311;_ThreadName=Thread-2;|JDBCBundleActivator: Activator started|#]

[#|2012-03-14T13:22:34.050+0200|SEVERE|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=311;_ThreadName=Thread-2;|Exception while invoking class org.glassfish.extras.osgicontainer.OSGiDeployedBundle start method
java.lang.RuntimeException: org.osgi.framework.BundleException: Activator start error in bundle LS_27-impl [473].
    at org.glassfish.extras.osgicontainer.OSGiDeployedBundle.startBundle(OSGiDeployedBundle.java:110)
    at org.glassfish.extras.osgicontainer.OSGiDeployedBundle.resume(OSGiDeployedBundle.java:83)
    at org.glassfish.extras.osgicontainer.OSGiDeployedBundle.start(OSGiDeployedBundle.java:67)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
    at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
    at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:391)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
    at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:214)
    at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:207)
    at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:148)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
    at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
    at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
    at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
    at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
    at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer._service(GrizzlyContainer.java:182)
    at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.service(GrizzlyContainer.java:147)
    at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:148)
    at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
    at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:722)
Caused by: org.osgi.framework.BundleException: Activator start error in bundle LS_27-impl [473].
    at org.apache.felix.framework.Felix.activateBundle(Felix.java:2027)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
    at org.glassfish.extras.osgicontainer.OSGiDeployedBundle.startBundle(OSGiDeployedBundle.java:107)
    ... 56 more
Caused by: java.lang.ExceptionInInitializerError
    at org.DX_57.osgi.LS_27.impl.LoggingSystemApp.start(LoggingSystemApp.java:38)
    at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:641)
    at org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
    ... 59 more
Caused by: java.lang.NullPointerException
    at org.DX_57.osgi.LS_27.impl.LoggingSystemImpl.<clinit>(LoggingSystemImpl.java:41)
    ... 62 more
|#]

[#|2012-03-14T13:22:34.072+0200|SEVERE|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=311;_ThreadName=Thread-2;|Exception while loading the app|#]

[#|2012-03-14T13:22:34.077+0200|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=311;_ThreadName=Thread-2;|Uninstalled LS_27-impl [473]|#]

[#|2012-03-14T13:22:34.080+0200|SEVERE|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=311;_ThreadName=Thread-2;|Exception while loading the app : org.osgi.framework.BundleException: Activator start error in bundle LS_27-impl [473].
org.osgi.framework.BundleException: Activator start error in bundle LS_27-impl [473].
    at org.apache.felix.framework.Felix.activateBundle(Felix.java:2027)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
    at org.glassfish.extras.osgicontainer.OSGiDeployedBundle.startBundle(OSGiDeployedBundle.java:107)
    at org.glassfish.extras.osgicontainer.OSGiDeployedBundle.resume(OSGiDeployedBundle.java:83)
    at org.glassfish.extras.osgicontainer.OSGiDeployedBundle.start(OSGiDeployedBundle.java:67)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
    at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
    at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:391)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
    at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:214)
    at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:207)
    at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:148)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
    at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
    at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
    at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
    at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
    at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer._service(GrizzlyContainer.java:182)
    at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.service(GrizzlyContainer.java:147)
    at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:148)
    at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
    at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ExceptionInInitializerError
    at org.DX_57.osgi.LS_27.impl.LoggingSystemApp.start(LoggingSystemApp.java:38)
    at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:641)
    at org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
    ... 59 more
Caused by: java.lang.NullPointerException
    at org.DX_57.osgi.LS_27.impl.LoggingSystemImpl.<clinit>(LoggingSystemImpl.java:41)
    ... 62 more
|#]

[#|2012-03-14T13:22:34.084+0200|INFO|glassfish3.1.2|org.glassfish.admingui|_ThreadID=313;_ThreadName=Thread-2;|Exception Occurred :Error occurred during deployment: Exception while loading the app : org.osgi.framework.BundleException: Activator start error in bundle LS_27-impl [473].. Please see server.log for more details.|#]

I have an error in the bundle activator which I cannot find.
I want to implement logging bundle which writes error messages into text file. When the bundle is deployed the bundle must open the text file and listens for messages from other OSGI bundles which it must record into the file.

Best Wishes
Peter

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T09:35:59+00:00Added an answer on May 31, 2026 at 9:35 am

    It seems the Exception is thrown at the class intitialization (as pointed by the stacktrace at ... LoggingSystemImpl.<clinit>).
    This is usually thrown when there is some error at the class static fields initialization stage.

    Checking your LoggingSystemImpl class code, found this at the fields declaration:

    private final static String user = System.getenv("USERNAME").toLowerCase();
    

    If system can’t find this environment value, it will return null (reference), and thus, the toLowerCase invocation on a null reference will throw a NullPointerException.

    Have you checked if the environment property "USERNAME" is available at runtime?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.