You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ahernandez <ah...@alidasoftware.com> on 2016/10/31 19:40:44 UTC

java.lang.IllegalAccessError: tried to access method org.apache.camel.component.quickfixj.QuickfixjComponent.createEndpoint

Hi,
I'm using camel-quickfix-2.9.1 in a Java implementation but I´m getting the
error 'java.lang.IllegalAccessError: tried to access method
org.apache.camel.component.quickfixj.QuickfixjComponent.createEndpoint(Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lorg/apache/camel/Endpoint;
from class com.alidasoftware.fix.FixInitiator
	at com.alidasoftware.fix.FixInitiator.start(FixInitiator.java:299)'

Is possible to use an absolute path for inprocess.cfg in
"quickfix:/examples/inprocess.cfg"?

Thans,
Adriana


public void start() {

		m_xqLog.logInformation(m_logPrefix + "Starting...");
		
		/********************************************/
	    try {
			settingsFile = File.createTempFile("quickfixj_test_", ".cfg");
	        settingsFile2 = File.createTempFile("quickfixj_test2_", ".cfg");
			sessionID = new SessionID(FixVersions.BEGINSTRING_FIX44, "INITIATOR",
"ACCEPTOR");
			settings = new SessionSettings();
			settings.setString(Initiator.SETTING_SOCKET_CONNECT_PROTOCOL, "tcp");
			settings.setBool(Session.SETTING_USE_DATA_DICTIONARY, false);
			settings.setLong(sessionID, Initiator.SETTING_SOCKET_CONNECT_PORT, 5000);
			setSessionID(settings, sessionID);
			writeSettings();
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

        camelContext = new DefaultCamelContext();
        component = new
org.apache.camel.component.quickfixj.QuickfixjComponent();
        component.setCamelContext(camelContext);
        camelContext.addComponent("quickfix", component);
        try {
			camelContext.start();
		} catch (Exception e2) {
			// TODO Auto-generated catch block
			e2.printStackTrace();
		}

        Method converterMethod = null;
		try {
			converterMethod = QuickfixjConverters.class.getMethod("toSessionID", new
Class<?>[] {String.class});
	       
camelContext.getTypeConverterRegistry().addTypeConverter(SessionID.class,
String.class,  new StaticMethodTypeConverter(converterMethod, false));
		} catch (NoSuchMethodException | SecurityException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        
		Endpoint e1;
		try {
			Map<String, Object> parameters = new HashMap<String, Object>();
			e1 =
component.createEndpoint("quickfix:/examples/inprocess.cfg","examples/inprocess.cfg",
parameters);
			System.out.println("Despues ");
		} catch (Exception e) {
			// TODO Auto-generated catch block
			System.out.println("Ex " + e.getMessage());
			e.printStackTrace();
		}
				
		m_xqLog.logInformation(m_logPrefix + "Started...");

	}



--
View this message in context: http://camel.465427.n5.nabble.com/java-lang-IllegalAccessError-tried-to-access-method-org-apache-camel-component-quickfixj-QuickfixjCot-tp5789527.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: java.lang.IllegalAccessError: tried to access method org.apache.camel.component.quickfixj.QuickfixjComponent.createEndpoint

Posted by Tomohisa Igarashi <tm...@gmail.com>.
Hi,

2.9.1? Is there any reason you need to use that far old version? Can you try with latest camel?

Looking at the error, it is suggesting a version mismatch on camel-quickfix, say using version A for compile and version B for runtime. Note that createEndpoint is "protected" on upstream master.

Thanks,
Tomo

On 11/01/2016 04:40 AM, ahernandez wrote:
> Hi,
> I'm using camel-quickfix-2.9.1 in a Java implementation but I�m getting the
> error 'java.lang.IllegalAccessError: tried to access method
> org.apache.camel.component.quickfixj.QuickfixjComponent.createEndpoint(Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lorg/apache/camel/Endpoint;
> from class com.alidasoftware.fix.FixInitiator
> 	at com.alidasoftware.fix.FixInitiator.start(FixInitiator.java:299)'
>
> Is possible to use an absolute path for inprocess.cfg in
> "quickfix:/examples/inprocess.cfg"?
>
> Thans,
> Adriana
>
>
> public void start() {
>
> 		m_xqLog.logInformation(m_logPrefix + "Starting...");
> 		
> 		/********************************************/
> 	    try {
> 			settingsFile = File.createTempFile("quickfixj_test_", ".cfg");
> 	        settingsFile2 = File.createTempFile("quickfixj_test2_", ".cfg");
> 			sessionID = new SessionID(FixVersions.BEGINSTRING_FIX44, "INITIATOR",
> "ACCEPTOR");
> 			settings = new SessionSettings();
> 			settings.setString(Initiator.SETTING_SOCKET_CONNECT_PROTOCOL, "tcp");
> 			settings.setBool(Session.SETTING_USE_DATA_DICTIONARY, false);
> 			settings.setLong(sessionID, Initiator.SETTING_SOCKET_CONNECT_PORT, 5000);
> 			setSessionID(settings, sessionID);
> 			writeSettings();
> 		} catch (IOException e1) {
> 			// TODO Auto-generated catch block
> 			e1.printStackTrace();
> 		} catch (Exception e) {
> 			// TODO Auto-generated catch block
> 			e.printStackTrace();
> 		}
>
>         camelContext = new DefaultCamelContext();
>         component = new
> org.apache.camel.component.quickfixj.QuickfixjComponent();
>         component.setCamelContext(camelContext);
>         camelContext.addComponent("quickfix", component);
>         try {
> 			camelContext.start();
> 		} catch (Exception e2) {
> 			// TODO Auto-generated catch block
> 			e2.printStackTrace();
> 		}
>
>         Method converterMethod = null;
> 		try {
> 			converterMethod = QuickfixjConverters.class.getMethod("toSessionID", new
> Class<?>[] {String.class});
> 	
> camelContext.getTypeConverterRegistry().addTypeConverter(SessionID.class,
> String.class,  new StaticMethodTypeConverter(converterMethod, false));
> 		} catch (NoSuchMethodException | SecurityException e) {
> 			// TODO Auto-generated catch block
> 			e.printStackTrace();
> 		} catch (Exception e) {
> 			// TODO Auto-generated catch block
> 			e.printStackTrace();
> 		}
>
> 		Endpoint e1;
> 		try {
> 			Map<String, Object> parameters = new HashMap<String, Object>();
> 			e1 =
> component.createEndpoint("quickfix:/examples/inprocess.cfg","examples/inprocess.cfg",
> parameters);
> 			System.out.println("Despues ");
> 		} catch (Exception e) {
> 			// TODO Auto-generated catch block
> 			System.out.println("Ex " + e.getMessage());
> 			e.printStackTrace();
> 		}
> 				
> 		m_xqLog.logInformation(m_logPrefix + "Started...");
>
> 	}
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/java-lang-IllegalAccessError-tried-to-access-method-org-apache-camel-component-quickfixj-QuickfixjCot-tp5789527.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>